Repository navigation
perf(install): authenticated in-process fetch and ref listing for github.com - #5353
Merged
Daniel Meppiel (danielmeppiel) merged 26 commits intoNov 24, 2026
Merged
Conversation
…ged github-basic header only) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…d token differential, user extraHeader -> git, no token in output) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…' env places it Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…on A''s managed-auth seam (no PR) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A private repository's listing in process equals git ls-remote byte for byte and carries only git's own extraheader. A redirect, a revoked token, a user extraHeader or an env without APM's managed header falls back to git, and neither a hit nor a fallback logs the token. apm-spec-waiver: test-only cells for the authenticated in-process listing Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 24, 2026 11:48
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new test module lacks a required behavioral marker and will fail the taxonomy gate, while private-repository token retries bypass the advertised in-process ref listing.
2 open issues
What changed in this PR
Extends APM's in-process Git transport to authenticated github.com requests, building on earlier anonymous and Windows support to reduce install overhead.
Changes:
- Sends APM-managed credentials per request for pinned fetches and ref listings, preserving transport gates and git fallback.
- Adds authenticated ref listing to the resolver's auth-first path.
- Adds credential-isolation, fallback, and git-parity tests, plus a performance changelog entry.
| File | Description |
|---|---|
src/apm_cli/cache/inprocess_fetch.py |
Extracts managed authentication and passes it to pinned-fetch requests. |
src/apm_cli/deps/anonymous_ref_listing.py |
Adds authenticated listings using existing validation and transport gates. |
src/apm_cli/deps/git_reference_resolver.py |
Attempts authenticated in-process listing before git in the primary path. |
tests/unit/cache/test_inprocess_fetch_gate.py |
Checks managed-header extraction and request-only credentials. |
tests/integration/test_inprocess_fetch_world.py |
Covers authenticated fetch parity, private repositories, and credential handling. |
tests/integration/test_anonymous_ref_listing_auth_world.py |
Covers authenticated listing parity, redirects, fallback, and log privacy. |
changelog.d/5353.changed.md |
Records the authenticated-install performance improvement. |
Review effort: Balanced
…ndows' into danielmeppiel-inprocess-fetch-auth
…W3d R1, LA3) A throttle or any 403 on an in-process listing trips the command's breaker, and a tripped breaker sends every later listing and fetch straight to git. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ppiel-inprocess-fetch-auth
…ppiel-inprocess-fetch-auth
…ndows' into danielmeppiel-inprocess-fetch-auth
…ndows' into danielmeppiel-inprocess-fetch-auth
… patch collaborators The authenticated fetch and listing build their per-request credential header with http_credentials (owner rule transport-platform-authenticated-egress); the A' gate cells no longer import the git_env owner they patch. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Base automatically changed from
danielmeppiel-inprocess-fetch-windows
to
main
November 24, 2026 15:13
…ndows' into danielmeppiel-inprocess-fetch-auth # Conflicts: # tests/unit/cache/test_inprocess_fetch_gate.py
…process-fetch-auth
…reads the world's ambient TLS config Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because a concurrency finding omitted from the published review may allow additional requests after the shared throttling breaker has tripped.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The cells script git ls-remote, but branch_and_tag_refs first asks the in-process anonymous listing, which reached the real github.com/owner/repo on Windows runners and answered its real refs (main red at 3fb82ec). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…scripted listing Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ot a patch (AQ004) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…sting install-cold-auth: 0 clones, 20 requests, +343 files written (pack objects written by the in-process fetch, as on the anonymous path), git.config +1 (the checkout-attributes probe). install-warm-auth: the ref probe is 10 requests, not 10 ls-remote spawns. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Another listing or fetch can trip the command's breaker while this one is in its config, proxy and TLS checks; the request now stays unsent. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-inprocess-fetch-auth
branch
November 24, 2026 19:43
7 of 13 tasks
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 24, 2026
… A' cell SC6: an authenticated listing and fetch over the Windows-store session to an untrusted peer (reached through a CONNECT tunnel) send no application byte, so never the Authorization header. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 24, 2026
…th pack POSTs The managed github-basic header is split from the env before the gate, exactly as fetch_worktree does, and sent per request (exact origin, no redirect hop, never on the session) on the capability GET and the trees and blobs POSTs. Without managed auth nothing changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 24, 2026
This was referenced Nov 24, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Stacked on #5351. Authenticated installs from github.com get the in-process speed-up too: the pinned fetch (A') and the ref listing (lever 1) carry APM's own github-basic credential, per request, exactly where today's git path would send it.
Who gets it. Authenticated github.com installs (public and private):
GITHUB_APM_PAT/GITHUB_TOKENwithAPM_GITHUB_AUTH_FIRST, and the token retry after an anonymous failure. GHE, Azure DevOps, GitLab and Artifactory hosts, sparse checkouts and any user-configuredhttp.extraHeader/helper still use git. No user changes rate-limit bucket: the same credential goes to the same origin as git would send it, with fewer requests.Mechanism (W3d row w3d:ruling:b1-authenticated, A1-A10; listing LA1-LA5).
_split_managed_authconsumes exactly onehttp.extraheaderentry: theAuthorization: Basic b64(x-access-token:<token>)thatutils/git_envwrites underAPM_GIT_MANAGED_AUTH_INTENT=1. It returns the env without it. Bearer, foreign or malformed values, or two managed entries, refuse. The gate, memos and logs only ever see the token-free env; any other extraHeader stays and sends the fetch to git._post(..., authorization): the header goes on the request only (neversession.headers), viaorigin_bounded_requestwith the exact origin,max_hops=0andambient_credentials=False.del authorizationfollows the post.WWW-Authenticateor any non-200 refuses, so git runs in the SAMEtry_with_fallbackattempt with the same env.anonymous_ref_listing.list_refs_authenticated): the same managed-auth seam forgit ls-remote. It runs perf(outdated): list public github.com refs in process for the anonymous attempt #4960's own_list_refsgates on the token-free env (same charset, size/time caps and output filter)._split_managed_auth; unitonly_apms_github_basic_header_is_taken_post; listing cella_redirect_falls_back_and_never_carries_the_header_awayheader_is_sent_per_request_and_never_on_the_sessionanonymous_ref_listing._proxyin_gate(https:// proxy or userinfo -> git)_gate;_redact; cellstoken_never_reaches_debug_output,the_token_never_reaches_debug_logs_admit; cellsrevoked_token_fails_exactly_like_git_and_never_leaks,a_revoked_token_falls_back_to_git_which_fails_as_today_admitted_post+_rate_limited(unchanged)a_bearer_or_foreign_header_is_not_consumed; cellsuser_extra_header_sends_the_authenticated_fetch_to_git,a_user_extra_header_sends_the_listing_to_gitauthorization,delafter the postauthenticated_attempt_fetches_in_process_with_only_apms_header(lockfile + tree ==APM_NO_INPROCESS_FETCH=1),private_repository_installs_in_process_like_git,retry_env_fetches_in_process_and_an_anonymous_env_tooa_private_listing_in_process_equals_git_with_the_same_header,an_env_without_apms_header_never_lists_in_process_list_refsgates on the token-free envthe_token_never_reaches_debug_logsgit ls-remote --tags --headsThis replaces #5330's cell "an authenticated attempt never uses the in-process fetch": the authenticated attempt now engages by design.
Windows scope. Windows numbers apply to Windows with the OpenSSL TLS backend. Default Git for Windows uses schannel, which falls back to git until #5376 lands.
Evidence. Population: authenticated token-first, github.com (incl. private repos), for both A' and lever 1. Headline = the authenticated harness; the anonymous runs are no-regression checks only.
git ls-remote50 -> 0.Issue and approved scope
Issue: Refs #4939
Human scope-approval comment: none yet for this item. Ordered by the PERF lead chain under #4939; W3d ruled A1-A10 and LA1-LA5 OK with conditions; QL granted the combined-PR timing override.
This does not complete #4939.
Type of change
Testing
Fast check (declared before dispatch): base = #5351 head, new = this head, authenticated harness (GITHUB_APM_PAT + APM_GITHUB_AUTH_FIRST=1) and the anonymous harness. install-cold + install-warm, tree-50, rtt 30, 6 pairs, Linux + Windows. Bar: an authenticated cold win, at most 1.010 elsewhere, 0 errors. Runs at 679208c: headline, authenticated harness, Linux 45387819588 and Windows 45387843433; no-regression only, anonymous harness, Linux 45387735840 and Windows 45387762251 (pending).
Final read at 20bd3e7 vs main d62aebe (PERF VP). Authenticated harness: Windows cold t50 40.23 -> 20.43 s (0.503), warm 0.886; Linux cold 11.84 -> 7.00 s (0.578), warm 0.817; requests 251 -> 101, spawns 365 -> 19 [45424300764 / 45424160141]. Anonymous harness: cold Linux 0.998, Windows 0.989. Disclosure: anonymous warm +1.6% CPU on both OSes (Linux 1.016, Windows 1.017 [45424456133 / 45424540252]) with identical requests; no named function at profile resolution; accepted against the ~2x authenticated win. Later heads (3002278, e0ba7e9) are test-only.
Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
CONFORMANCE.{md,json}regeneratedapm-spec-waiver: transport change below the lockfile; no OpenAPM requirement covers how a pinned commit is fetched or refs are listed