perf: ADO REST metadata fetcher to avoid clone-based fetch#1852
Open
Aaryan-Dadu wants to merge 3 commits into
Open
perf: ADO REST metadata fetcher to avoid clone-based fetch#1852Aaryan-Dadu wants to merge 3 commits into
Aaryan-Dadu wants to merge 3 commits into
Conversation
Azure DevOps marketplace sources fetched metadata (apm.yml, description,
version) through the generic-git path, resolving files via a subprocess
clone. GitHub and GitLab already have dedicated REST fetchers that avoid a
clone for single-file metadata reads; ADO now matches that fast path.
Add an `ado` source kind that routes to a new `_fetch_ado` via the existing
_FETCHERS dispatch. It reads single files through the Azure DevOps Git items
API (GET .../_apis/git/repositories/{repo}/items) and falls back to the
generic-git clone on any REST/transport failure or offline condition, so
there is no regression. A confirmed 404 returns None (file absent) without a
wasted clone.
Auth reuses AuthResolver's ADO context via try_with_fallback: ADO_APM_PAT as
HTTP Basic with an AAD `az` bearer runtime fallback; the token is never
logged or placed in the URL. ADO joins the JSON sidecar cache (1h TTL) for
parity with the GitLab REST fetcher.
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
When APM reads a marketplace hosted on Azure DevOps, it used to clone the whole repo just to read one small metadata file. GitHub and GitLab marketplaces already skip that, they fetch the single file directly over the host's API. This change gives Azure DevOps the same shortcut, so those reads are faster.
How it works:
ADO_APM_PATtoken orazlogin).Closes #1808
Type of change
Testing
Spec conformance (OpenAPM v0.1)
If this PR changes behaviour that an OpenAPM v0.1
req-XXXcovers,confirm the three-step ritual (see CONTRIBUTING.md "Adding or
changing a normative requirement"):
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.