-
Notifications
You must be signed in to change notification settings - Fork 128
fix: replace git reference injection with wheel artifacts in charm test workflows #2252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…rkflows Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com>
Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com>
Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com>
tonyandrewmeyer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot the pack test can't use the wheels because the packing is done in a sandboxed environment. Please revert the changes to charmcraft-pack.yaml.
Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com>
Reverted in d012d43. The charmcraft-pack.yaml workflow now uses the original git reference approach since the packing is done in a sandboxed environment that cannot access local wheel files. |
Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com>
Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com>
|
@copilot the observability tests are failing: |
Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com>
…vironment Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com>
Fixed in 2bbca32. Changed to use |
|
@copilot let's work around this by having the observability tests (only, not the other workflows) force a newer version of interface tester. Something like |
…tests Co-authored-by: tonyandrewmeyer <826522+tonyandrewmeyer@users.noreply.github.com>
Added workaround in c5f97df. The observability-charm-tests workflow now forces an upgrade of pytest-interface-tester to version >=3.4 using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR replaces git reference injection with wheel artifacts in charm compatibility test workflows to avoid race conditions where git revisions might not be available immediately from CI runners.
Changes:
- Added a reusable workflow
_build-wheels.yamlto build wheel artifacts for ops, ops-scenario, and ops-tracing packages - Updated four test workflows (observability, published-charms, db-charm, hello-charm) to download and use wheel artifacts instead of git references
- Modified dependency patching logic in all workflows to reference local wheel files instead of git URLs
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/_build-wheels.yaml |
New reusable workflow that builds wheels for all workspace packages and uploads them as artifacts |
.github/workflows/published-charms-tests.yaml |
Updated to use wheel artifacts for both charm-tests and charmcraft-profile-tests jobs |
.github/workflows/observability-charm-tests.yaml |
Updated to use wheel artifacts including ops-tracing, added pytest-interface-tester upgrade step |
.github/workflows/hello-charm-tests.yaml |
Updated to download and use ops wheel artifact |
.github/workflows/db-charm-tests.yaml |
Updated to use wheel artifacts, removed unnecessary repository checkout step |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
james-garner-canonical
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall approach seems reasonable, and the workflows that run on PRs do appear to be working correctly with this approach. Could we get a run of the others (just published charm tests?) to verify those as well.
I do wonder if there's a simpler approach that could work. For example, what if the charm test workflows used actions/checkout to check ops out into a subdirectory (e.g. local_ops) and we just pointed their dependency files there instead of to Github?
| build-wheels: | ||
| uses: ./.github/workflows/_build-wheels.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it problematic that we run this workflow multiple times (once for every workflow that shares a trigger) and upload the same artifact with the same name multiple times? Other than being a bit inefficient -- any correctness issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there are correctness issues. With v4 and above artefacts get replaced and I believe that's atomic, so it's just inefficient.
We could have a single workflow that does the db-charm-tests, hello-charm-tests, observability-charm-tests. There's a reasonable amount of overlap there already and they are all doing roughly the same thing and the by-team organisation could just be within the workflow. Or a single workflow that's triggered that calls those workflows.
I don't think we'd want to combine those with the published-charms-tests one, though. In particular, that one is only run on a schedule and has a lot of regular failures (particularly at the moment with the Python version issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on the published charm tests. Factoring the workflows differently could always be a separate PR later if we feel the need.
Sure.
I went with the build wheels approach because:
None of those are super strong arguments for doing wheels over a local file, though. Are you asking to switch to that, or are you ok with the wheel approach? |
james-garner-canonical
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you asking to switch to that, or are you ok with the wheel approach?
I'm OK with it assuming the other reviewer is too.
For our compatibility tests, instead of patching the dependencies to require the branch's version of ops[...] via a Git link, build local wheels from the branch and patch the requirements to use that. This avoids races where the appropriate revision of the branch is not yet available from the CI runner.
Changes: