Add daily CFS feed warm-up and make azpysdk tool pins scannable - #48557
Draft
jenny (JennyPng) wants to merge 1 commit into
Draft
Add daily CFS feed warm-up and make azpysdk tool pins scannable#48557jenny (JennyPng) wants to merge 1 commit into
jenny (JennyPng) wants to merge 1 commit into
Conversation
Move the hardcoded static-analysis tool versions (mypy, pylint, pyright, sphinx, black, bandit, breaking) out of the azpysdk check modules and into eng/tool_requirements/*.txt as a single, machine-scannable source of truth, loaded at runtime via azpysdk._tool_reqs. Add eng/scripts/warm_cfs_feed.py, which scans every declared dependency in the repo (dev_requirements.txt, pyproject.toml, shared eng/*.txt files, and the new tool-requirement files) and runs 'pip download' with transitive dependencies against the CFS feed. Add eng/pipelines/warm-cfs-feed.yml to run it daily, authenticated, so unpinned transitive deps of tools like mypy are pulled through and cached before unauthenticated PR pipelines need them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
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.
Add daily CFS feed warm-up and make azpysdk tool pins scannable
Problem
This repo installs everything from the CFS pull-through feed instead of PyPI. CFS only serves versions it has already cached, and unauthenticated pipelines (fork PR CI) cannot trigger an upstream pull-through — they can only read what is already cached.
The static-analysis tools that
azpysdkinstalls at runtime (mypy, pylint, pyright, sphinx, black, bandit, breaking) had their versions hardcoded in Python (e.g.MYPY_VERSION = "1.19.1"), invisible to any dependency scanner. When a tool's unpinned transitive dependency (e.g. one of mypy's deps) publishes a new release, an unauthenticated CI job resolves to that brand-new, uncached version and fails.Fix
Part A — Make azpysdk tool deps scannable (single source of truth)
eng/tool_requirements/*.txt(mypy,mypy_next,pylint,pylint_next,pyright,pyright_next,sphinx,sphinx_next,black,bandit,breaking, + README).azpysdk/_tool_reqs.py(load_requirements,pin,pinned_version) reads them fromREPO_ROOT/eng/tool_requirements/— the same patternCheck.pyalready uses foreng/test_tools.txt/pylintrc, so no packaging changes.*_VERSIONconstants are kept but derived from the files for backwards compatibility (nothing else imports them).verifytypesnow reusespyright.txt, removing a duplicate pin.Part B — Daily CFS warm-up
eng/scripts/warm_cfs_feed.py: scans every declared dependency in the repo — alldev_requirements.txt, everypyproject.toml(deps + optional-deps), the sharedeng/*.txtrequirement files, and the new tool-requirement files — then runspip downloadwith transitive dependencies against the CFS feed. Continue-on-error, JSON report,--dry-run/--index-url/--dest/--fail-on-error.eng/pipelines/warm-cfs-feed.yml: runs the script daily, authenticated (viaauth-dev-feed.yml, required for pull-through), and publishes the report artifact.Because the daily authenticated job downloads each tool's full closure at latest, the unpinned transitive dep gets cached before unauthenticated PR pipelines resolve it.
Validation
tests/test_tool_reqs.py(6 tests) + existingtest_pylint.py/test_breaking.pypass.azpysdkCLI parser builds; all refactored modules import.--dry-runconfirmed it discovers the tool pins (mypy==1.19.1/2.1.0,pyright==1.1.407/1.1.411,black==24.4.0,sphinx==8.2.0) alongsidepyproject.tomldeps (275 unique third-party specs; 416 first-party skipped).Notes / open questions
--only-tool-requirementsfast path for a more frequent tools-only job if desired.