Summary
The fix released in v0.83.5 for #48414 does not prevent duplicate Authorization headers in fork-backed create_pull_request.
The runtime contains withGitHubHostToken, but the first fork git ls-remote still fails with:
remote: Duplicate header: "Authorization"
fatal: unable to access 'https://github.com/bryanchen-d/vscode.git/': The requested URL returned error: 400
The restore loop then accumulates another visible value on every attempt (read 1, then 2, 3, 4).
Environment
Reproduction
Workflow run: https://github.com/microsoft/vscode-engineering/actions/runs/30472145297
Relevant sequence from the first attempt:
git_auth_helpers: read 1 existing extraheader value(s)
git_auth_helpers: overriding http.https://github.com/.extraheader with CI trigger token
git config --replace-all http.https://github.com/.extraheader Authorization: basic ***
git_auth_helpers: extraheader override applied
git ls-remote --heads https://github.com/bryanchen-d/vscode.git ...
remote: Duplicate header: "Authorization"
git_auth_helpers: restoring 1 previous extraheader value(s)
Subsequent operations report read 2, read 3, and read 4, and all fail with the same duplicate-header HTTP 400.
No fork branch or PR is created; fallback-as-issue produces an issue instead.
Expected
withGitHubHostToken should ensure exactly one effective Authorization source and restoration should return to the original cardinality.
Analysis
getExtraheaderValues reads effective values with unscoped git config --get-all, while overridePersistedExtraheader and restorePersistedExtraheader write through the repository-local default scope. If another scope or injected config contributes the second header, --replace-all in the local scope cannot remove it. The helper should either:
- explicitly enumerate and neutralize all effective sources for the fork operation, or
- invoke git with a one-shot config/environment that suppresses inherited auth and supplies exactly one header.
Also verify that the outer withGitHubHostToken wrapper is not combined with another auth mechanism inside pushSignedCommits.
Related
Summary
The fix released in v0.83.5 for #48414 does not prevent duplicate Authorization headers in fork-backed
create_pull_request.The runtime contains
withGitHubHostToken, but the first forkgit ls-remotestill fails with:The restore loop then accumulates another visible value on every attempt (
read 1, then2,3,4).Environment
696e63acbcc80e7cb5604653ee12014762d100e4(v0.83.5)setup/js/create_pull_request.cjstarget-repo:microsoft/vscodehead-repo:bryanchen-d/vscodesafe-outputs.github-appandcreate-pull-request.head-github-appReproduction
Workflow run: https://github.com/microsoft/vscode-engineering/actions/runs/30472145297
Relevant sequence from the first attempt:
Subsequent operations report
read 2,read 3, andread 4, and all fail with the same duplicate-header HTTP 400.No fork branch or PR is created;
fallback-as-issueproduces an issue instead.Expected
withGitHubHostTokenshould ensure exactly one effective Authorization source and restoration should return to the original cardinality.Analysis
getExtraheaderValuesreads effective values with unscopedgit config --get-all, whileoverridePersistedExtraheaderandrestorePersistedExtraheaderwrite through the repository-local default scope. If another scope or injected config contributes the second header,--replace-allin the local scope cannot remove it. The helper should either:Also verify that the outer
withGitHubHostTokenwrapper is not combined with another auth mechanism insidepushSignedCommits.Related