Repository navigation
refactor(util): move the remaining Actions output onto the helper (#2047) - #2079
Conversation
) - util/discussion_report.py, project_status.py, python_versions.py, superseded.py, verdict_covers_checkout.py: annotations, step outputs and summary lines go through util/_actions.py; the scripts' own escape()s and write_github_output's delimiter code go. Output is unchanged byte for byte, except that values the scripts interpolated unescaped are now escaped: --file in python_versions, --repo in project_status, VERDICT_SHA, --head and bot-commit paths in verdict_covers_checkout. - Workflows: the sparse checkouts in deploy-pages, experimental (both), python-compatibility and unit-tests list util/_actions.py; Project Status fetches it beside project_status.py at the same ref; Create Release copies the released commit's helper beside its python_versions.py where it has one. - Tests pin each script's whole stdout, $GITHUB_OUTPUT and summary (they pass on main bar the escaping changes), run the Project Status step and the released reader with the helper, and hold every sparse checkout of a helper script to listing it; test_actions_helper_2047 lists the five scripts. - docs: workflows.rst and deploy-pages.yml say what is checked out. tests/project leg under run_unittest_leg.py: 2051 tests OK (71 skipped).
|
GOOD TO GO at
Every invocation site: the reviewer checked every job that runs one of the five scripts. Each one has Output: old and new give byte-identical output on every input tried, apart from the three listed escaping fixes. One more, not in the body: Unverified until a live run: that a failed |
|
Coverage: 91.54% (unit tier, Python 3.15,
Per-file detail: the |
|
Ready to merge at |
Step 2 of #1967, third batch for create-release.yml: three of version_check's inline shell steps move into stdlib-only scripts, on the python3 setup-python puts first on PATH, with each step's name, id and env: unchanged; only the run: bodies differ. Get Version stays inline. * util/release_tiers.py: "Read the released Python versions", with #2079's copy of the released commit's util/_actions.py, where it has one. * util/release_published.py pypi|anaconda: "Check PyPI publish completeness" and "Check Anaconda publish completeness", which shared all but endpoint, expectation and count. Same curl, URLs and /tmp paths. * workflows.rst lists both scripts. tests/project/test_release_version_check_scripts_1967.py runs each former shell, kept verbatim, and its script on the same cases against stand-in python3, git, mktemp and curl, requiring the same status, output, $GITHUB_OUTPUT, calls and scratch files; the tables reach every exit and path of each shell, and planted divergences are caught. The tests that ran or pinned the shell now run or read the scripts.
) Step 2 of #1967, third batch for create-release.yml: three of version_check's inline shell steps move into stdlib-only scripts, on the python3 setup-python puts first on PATH, with each step's name, id and env: unchanged; only the run: bodies differ. Get Version stays inline. * util/release_tiers.py: "Read the released Python versions", with #2079's copy of the released commit's util/_actions.py, where it has one. * util/release_published.py pypi|anaconda: "Check PyPI publish completeness" and "Check Anaconda publish completeness", which shared all but endpoint, expectation and count. Same curl, URLs and /tmp paths. * workflows.rst lists both scripts. tests/project/test_release_version_check_scripts_1967.py runs each former shell, kept verbatim, and its script on the same cases against stand-in python3, git, mktemp and curl, requiring the same status, output, $GITHUB_OUTPUT, calls and scratch files; the tables reach every exit and path of each shell, and planted divergences are caught. The tests that ran or pinned the shell now run or read the scripts.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
ci— changes to CI configuration files and scriptsDescription of your pull request and other information
The last batch for #2047.
discussion_report,project_status,python_versions,supersededandverdict_covers_checkoutnow write their Actions output throughutil/_actions.py. Their output is byte-identical except where a value used to be printed unescaped:verdict_covers_checkout: bot-commit paths and author emails were raw. Onmain, a path containing\n::error::…printed an annotation of its own; it is escaped now.python_versions: the--filepath in the error prefix is now escaped.project_status: the repo in the search query is now escaped, though a valid repo name has no%.Workflow changes needed for the import:
util/_actions.pyis added indeploy-pages.yml,experimental.yml,python-compatibility.ymlandunit-tests.yml.project-status.yml(pull_request_target): it already downloads its script through the API at${SCRIPT_REF}. It now fetchesproject_status.pyand_actions.pyin a loop at the same ref, still with no checkout and no expression insiderun:.create-release.yml, Read the released Python versions: it also copies the released commit'sutil/_actions.py, but only when that commit has the file.Tests:
$GITHUB_OUTPUTand summary are pinned. The byte pins pass onmain's scripts too, apart from the escaping changes above._actions.pyin the released commit.ModuleNotFoundError: No module named '_actions'when the fetch or copy is dropped.61bb4ba66: theSCRIPTStuple is the union and the patch-id is unchanged. The readers pass, and the full project leg ran 2051 tests with 0 failures.Overlap: #2076 also changes
superseded.py(stopped=true), so whichever merges second needs a rebase.