Uh oh!
There was an error while loading. Please reload this page.
fix: remove double-normalization in overridePersistedExtraheader - #44492
Conversation
…add trailing-slash test Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…xtraheader test Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Updates git auth helper behavior and tests to ensure URL normalization happens at the correct layer, avoiding passing pre-normalized values into helpers that also normalize.
Changes:
- Update
overridePersistedExtraheaderto pass the rawserverUrlintogetExtraheaderValues()(which normalizes internally). - Add a test asserting that a trailing-slash server URL results in normalized git config keys for both read and write operations.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/git_auth_helpers.cjs | Removes pre-normalization before calling getExtraheaderValues() to clarify normalization responsibility. |
| actions/setup/js/git_auth_helpers.test.cjs | Adds regression test for trailing-slash URLs to ensure normalized git config keys are used consistently. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Low
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
🎉 This pull request is included in a new release. Release: |
The Matt Pocock Skills Reviewer flagged several issues in the git auth helper code introduced with the CI trigger push feature. Issues 1–4 (the
overrideAppliedguard, push-failure test,getErrorMessageusage, and missingsilentflag on the write) were already resolved before this PR.Changes
git_auth_helpers.cjs):overridePersistedExtraheaderwas callingnormalizeServerUrl()on the input and then passing the result togetExtraheaderValues(), which normalizes again internally. Each function now normalizes its own input, making the contract unambiguous.git_auth_helpers.test.cjs): added aoverridePersistedExtraheadertest with a trailing-slash URL to explicitly assert that both the read (--get-all) and write (--replace-all) git config calls use the normalized key — documenting the normalization contract at the right layer.