Description
When running the CI: Release workflow from main for a backport release tag, the check-release-notes job can fail before it actually checks the release notes.
Example workflow run:
The run was manually dispatched from main with:
git-tag: v12.9.7
component: cuda-bindings
The job failed with:
Run python ci/tools/check_release_notes.py \
+ python ci/tools/check_release_notes.py --git-tag v12.9.7 --component cuda-bindings
python: can't open file '/home/runner/work/cuda-python/cuda-python/ci/tools/check_release_notes.py': [Errno 2] No such file or directory
Error: Process completed with exit code 2.
Root cause
The check-release-notes job checks out the release tag:
- name: Checkout Source
uses: actions/checkout@...
with:
ref: ${{ inputs.git-tag }}
For v12.9.7, that means the job checks out the 12.9.x backport branch commit:
v12.9.7 -> a4e89b567d7fa367414b2a1fb1e2bcb706124967
That commit does not contain ci/tools/check_release_notes.py. The checker was added later on main in:
As a result, the release workflow definition from main tries to run a helper script that exists on main, but the job workspace has already been replaced with the older backport tag checkout.
Why this is different from #2062
This is related to, but different from:
Issue #2062 was about the Self-test release-notes checker step failing because pytest ci/tools/tests imported the repo-level conftest.py, which required cuda.pathfinder. That issue was worked around by commenting out the self-test step in:
The current failure happens after that step is skipped/commented out. It fails in the actual Check versioned release notes exist step because the checker script is not present in the checked-out release tag.
Expected behavior
The release workflow should be able to validate release notes for older/backport tags, even when the helper script was introduced after the release branch diverged.
In this scenario, it should either:
- run the checker from the workflow branch/ref, while checking release-note files in the release-tag checkout; or
- avoid running the checker for tags whose checked-out source tree does not contain the checker; or
- otherwise make the
check-release-notes job robust for backport releases.
Suggested fix
Use separate checkouts for the workflow tooling and the release source tree. For example:
- Checkout the workflow ref/current branch normally so
ci/tools/check_release_notes.py is available.
- Checkout
${{ inputs.git-tag }} into a subdirectory such as release-src.
- Run the checker from the workflow checkout, but pass the release checkout as
--repo-root:
python ci/tools/check_release_notes.py \
--repo-root release-src \
--git-tag "${{ inputs.git-tag }}" \
--component "${{ inputs.component }}"
This keeps the validation logic on main, while validating the release-note files that actually belong to the release tag.
Additional context
The current v12.9.7 release attempt needs this path because v12.9.7 is a backport release from 12.9.x, while the release workflow being dispatched from main includes newer release-checking infrastructure.
Description
When running the
CI: Releaseworkflow frommainfor a backport release tag, thecheck-release-notesjob can fail before it actually checks the release notes.Example workflow run:
The run was manually dispatched from
mainwith:git-tag:v12.9.7component:cuda-bindingsThe job failed with:
Root cause
The
check-release-notesjob checks out the release tag:For
v12.9.7, that means the job checks out the12.9.xbackport branch commit:That commit does not contain
ci/tools/check_release_notes.py. The checker was added later onmainin:As a result, the release workflow definition from
maintries to run a helper script that exists onmain, but the job workspace has already been replaced with the older backport tag checkout.Why this is different from #2062
This is related to, but different from:
Issue #2062 was about the
Self-test release-notes checkerstep failing becausepytest ci/tools/testsimported the repo-levelconftest.py, which requiredcuda.pathfinder. That issue was worked around by commenting out the self-test step in:The current failure happens after that step is skipped/commented out. It fails in the actual
Check versioned release notes existstep because the checker script is not present in the checked-out release tag.Expected behavior
The release workflow should be able to validate release notes for older/backport tags, even when the helper script was introduced after the release branch diverged.
In this scenario, it should either:
check-release-notesjob robust for backport releases.Suggested fix
Use separate checkouts for the workflow tooling and the release source tree. For example:
ci/tools/check_release_notes.pyis available.${{ inputs.git-tag }}into a subdirectory such asrelease-src.--repo-root:This keeps the validation logic on
main, while validating the release-note files that actually belong to the release tag.Additional context
The current
v12.9.7release attempt needs this path becausev12.9.7is a backport release from12.9.x, while the release workflow being dispatched frommainincludes newer release-checking infrastructure.