Repository navigation
Fix repo memory retry head refresh authentication - #63497
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The targeted fix resolves the reported authentication failure and includes appropriate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes authenticated retry-head refreshes for concurrent repo-memory pushes on private/internal repositories.
Changes:
- Uses the authenticated retry URL for
git ls-remote. - Suppresses credential-bearing command output.
- Adds focused regression coverage.
| File | Description |
|---|---|
actions/setup/js/push_repo_memory.cjs |
Authenticates retry head refreshes. |
actions/setup/js/push_repo_memory.test.cjs |
Verifies authenticated, silent refresh behavior. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
@copilot There is still forward progress needed on this PR.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. No ADR enforcement needed: PR does not have the 'implementation' label and has <=100 new lines of code in business logic directories.
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
|
🔎 PR Code Quality Reviewer is reviewing code quality for this pull request... |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs — small, well-scoped fix with a targeted regression test. No actionable issues found.
📋 Analysis
Root cause fix: The retry-refresh ls-remote was previously run against unauthenticated origin, which fails silently (caught and swallowed) on private/internal repos, causing retries to never rebase onto the latest remote head and eventually exhaust MAX_RETRIES. Switching to repoUrlWithToken (the same authenticated URL already used for fetch/reconcileRepoMemoryRetry) fixes the root cause rather than just a symptom.
Credential hygiene: Adding silent: true is correct and necessary — @actions/exec echoes the full command line (including the embedded-token URL) to the log unless silent is set, so this avoids a credential leak that the URL swap would otherwise introduce.
Regression test: The new test in push_repo_memory.test.cjs asserts the exact ls-remote call args (retryRepoUrl, silent: true) and confirms the retry succeeds after a transient failure — this pins the fix and would catch a regression back to origin.
Minor observations (non-blocking):
- The catch block for
lsRemoteErrorat line 190 only logsgetErrorMessage(lsRemoteError); this is fine since@actions/exec's default thrown error doesn't embed the command string, so no token leakage risk there either. - No test exercises the
ls-remotefailure path (falling back to existingcurrentBaseRef), but that path is unchanged by this PR, so it's out of scope here.
Nothing else stood out as risky given the narrow, one-line production change.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 40.4 AIC · ⌖ 13.4 AIC · ⊞ 10.1K
Comment /matt to run again
The branch already includes the current |
|
🎉 This pull request is included in a new release. Release: |
Concurrent
push_repo_memorywriters could exhaust retries on private/internal repos because retry head refresh used unauthenticatedorigin. Whengit ls-remote originfailed, reconciliation never rebased onto the latest remote head.origin.origin.