fix: include caller job name in coverage artifact names - #139
Open
lengau wants to merge 4 commits into
Open
Conversation
When test-python.yaml is called multiple times in the same workflow run
(e.g. test-common, test-java-plugins, test-python-plugins), the coverage
artifact names collide because they only include platform and Python
version. This causes 409 Conflict errors on upload.
Add ${{ github.job }} to all coverage artifact names so each caller
gets unique artifact names (e.g. coverage-test-common-slow-ubuntu-24.04-3.12
vs coverage-test-java-plugins-slow-ubuntu-24.04-3.12).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a verify-coverage-artifacts job that runs after all test jobs and uses the GitHub API to check that: - No duplicate coverage artifact names exist - Each caller job (test-python, test-python-custom, test-python-as-root) produced fast, slow, and lowest coverage artifacts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
github.job returns the job ID within the reusable workflow (e.g. 'fast', 'slow'), not the caller's job key. Instead, use the recently-shipped job.check_run_id context property to look up the full compound job name via the REST API (e.g. 'test-common / Fast tests') and extract the caller's job key for unique artifact naming. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lengau
commented
May 12, 2026
| slow-test-python-versions: '["3.14"]' | ||
| lowest-python-version: "3.8" | ||
| lowest-python-platform: '["jammy", "arm64"]' | ||
| lowest-python-platform: '["focal", "amd64"]' |
Contributor
Author
There was a problem hiding this comment.
Drive-by: test that we work on Canonical's focal runners :-)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent GitHub Actions coverage artifact upload collisions when the reusable test-python.yaml workflow is invoked multiple times in a single workflow run by making artifact names unique per caller job.
Changes:
- Adds a “Resolve caller job name” step in
test-python.yamland prefixes coverage artifact names with the resolved caller identifier. - Updates
self-test-qa.yamlto document intentional parameter overlap, and adds a job that verifies coverage artifacts are present and unique.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
.github/workflows/test-python.yaml |
Prefixes coverage artifact names with a resolved “caller job” value to avoid name collisions across multiple callers. |
.github/workflows/self-test-qa.yaml |
Adjusts self-test inputs, documents overlap intent, and adds an artifacts verification job to catch collisions/missing uploads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
mr-cal
approved these changes
Jul 17, 2026
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.
Problem
When
test-python.yamlis called multiple times in the same workflow run (e.g. in craft-parts), the coverage artifact names collide because they only include platform and Python version. This causes409 Conflict: an artifact with this name already exists on the workflow runerrors on upload.Fix
Include
${{ github.job }}in all coverage artifact names. In reusable workflows,github.jobresolves to the caller's job key, making names unique across callers:coverage-slow-ubuntu-24.04-3.12coverage-test-common-slow-ubuntu-24.04-3.12coverage-slow-ubuntu-24.04-3.12❌ conflictcoverage-test-java-plugins-slow-ubuntu-24.04-3.12✅Testing
The existing
self-test-qa.yamlalready exercises this scenario —test-python-customandtest-python-as-rootcalltest-python.yamlwith overlapping parameters (ubuntu-latest, Python3.14, lowest3.8). Added a comment documenting this intentional overlap.