Repository navigation
fix(checkouts): secure git auth and protect mirror acquisition - #326
Conversation
|
/agentic_review |
I can’t inspect pull request 327 from this environment, so I can’t confirm duplication from the link alone. This PR adds three main changes: authenticated Git HTTP via Basic auth, direct fetching of missing SHA-1/SHA-256 or PR/MR-only commits, and locking around mirror acquisition/eviction. If you paste PR 327’s description or diff, I can compare them precisely and identify any duplicated or conflicting changes. |
Code Review by QodoResolved findings 1.
|
|
@qodo here is the #327's description:
|
Thanks—this provides context for the earlier transport-auth and checkout-origin fixes in #327. It does not correspond to the two findings in the current review:
The authentication change appears intended and is covered by the new Git smart-HTTP test; the origin-restoration change is separate from these active findings. |
Yes—the current PR changes GitHub/GitHub Enterprise Git transport authentication from |
|
Cross-checked against #327 rather than relying on Qodo’s comparison: both change |
|
Addressed both Qodo findings in aa323c8. Mirror checkout now accepts a commit only when reachable from current repository heads/tags or equal to an advertised pull/merge-request head; it fetches that named review ref, never a bare SHA. Previously fetched objects and deleted review refs no longer grant authorization. The new regressions failed before the fix and pass now. DiffRequest also accepts a 64-character SHA-256 |
|
Follow-up for Qodo’s new older-review-commit finding: c9badc8 resolves the SHA to PR/MR IDs through the target repository’s forge API, checks each candidate against currently advertised review refs, fetches only the named ref and proves the requested SHA is an ancestor of its fetched tip. A stale cached commit, unrelated fork commit or deleted/force-pushed ref cannot authorize checkout. The new old-commit regression failed on aa323c8 and passes now; GitHub’s commit-to-PR endpoint was also checked against an actual older core#322 commit. Local gates: 8,403 tests and 96.69% pre-push coverage. Michele’s review and fresh CI remain required. |
What
Fix outstanding checkout defects from merged PRs #311, #312, #313 and #318:
oauth2username.Review disposition
The reviewed #311/#312 heads merged unchanged. #313/#318 received other fixes, but these outstanding defects remained on the actual merged
developmenttree. #318 already corrected the process allowlist/timeout finding; this PR leaves that correction intact. The export-ignored regression-pair issue is addressed separately in #325.No changes to the Java ownership work in #323. No public API or dependency-pin changes.
Verification
Before the fix, the current merged baseline failed the GitHub/GHE authenticated Git regressions and the SHA-256 checkout regression; the GitLab control passed.
Real-Git baseline smoke reproduced rejection of a commit retained only by a PR ref and deletion of an actively fetching mirror.
Focused checkout/provider suite: 103 passed.
Standalone production-provider smoke: PR-only checkout/refresh, synchronized eviction and release, SHA-256 checkout/history all succeeded.
Real read-only private GitHub
ls-remotewithForgeApi.git_headersmatched the independently authenticated forge API HEAD; no credential was printed or written.Full unit gate: 8,395 passed, 1 existing skip.
Mandatory pre-push lint/coverage gates passed: 8,395 passing cases, 1 existing skip, 96.20% coverage (80% required).
Native PostgreSQL 18.6 integration suite: 3,025 cases passed, 3 existing skips, across the complete invocation and a targeted rerun after setting the isolated cluster to the UTC timezone expected by the existing freshness test. No unrelated production behavior was changed.
Replaced brittle filename-substring leak assertions with actual workspace-lifecycle checks; temporary roots are outside the workstation's parent Git repository. No hooks or gates were bypassed.
Related: #311, #312, #313, #318. Continuous operations / XWING-2440.
This PR is for review only; auto-merge is not requested.