fix: unblock CI (codecov GPG flakiness + py21cmfast 4.2 struct rename) - #116
Open
steven-murray wants to merge 2 commits into
Open
fix: unblock CI (codecov GPG flakiness + py21cmfast 4.2 struct rename)#116steven-murray wants to merge 2 commits into
steven-murray wants to merge 2 commits into
Conversation
Two independent, pre-existing breakages on main (unrelated to any dependency bump) were failing nearly every Testing matrix job: - codecov/codecov-action@v6.0.0's uploader intermittently fails GPG signature verification because of an upstream key-hosting issue (codecov/codecov-action#1955), which then fails the whole ubuntu-latest job because fail_ci_if_error was true. Set it to false so a flaky third-party upload doesn't fail the test job. - py21cmfast 4.2 renamed the internal `struct` property on output objects to `_struct`. Since tuesday's pyproject.toml pins 21cmFAST>=4.0.0b (floating), pip resolves 4.1.1 on some Python versions and 4.2 on others, so the mock-cache test fixture now supports both attribute names. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR stabilizes the CI test matrix by relaxing Codecov failure handling in the GitHub Actions workflow and updating a py21cmfast test fixture to be compatible with both pre-4.2 and 4.2+ struct attribute names. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Instead of relying on a runtime hasattr check for
o._structvso.struct, consider centralizing this version-dependent logic (e.g., helper function or compatibility layer) so that future py21cmfast struct changes are easier to manage and test. - Relaxing
fail_ci_if_errorto false for Codecov avoids flakiness but may hide real upload issues; consider scoping this change (e.g., to affected OS/Python versions) or adding a separate monitoring step so upload failures remain visible.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Instead of relying on a runtime hasattr check for `o._struct` vs `o.struct`, consider centralizing this version-dependent logic (e.g., helper function or compatibility layer) so that future py21cmfast struct changes are easier to manage and test.
- Relaxing `fail_ci_if_error` to false for Codecov avoids flakiness but may hide real upload issues; consider scoping this change (e.g., to affected OS/Python versions) or adding a separate monitoring step so upload failures remain visible.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #116 +/- ##
=======================================
Coverage 85.75% 85.75%
=======================================
Files 12 12
Lines 772 772
Branches 189 189
=======================================
Hits 662 662
Misses 46 46
Partials 64 64
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
Nearly every job in the Testing matrix on
mainis currently red (onlymacos-latest, 3.11passes). This is pre-existing breakage onmain, unrelated to the two open Dependabot PRs (#114, #115) that happen to inherit it. Two independent causes:ubuntu-latestjobs:codecov/codecov-action@v6.0.0's uploader intermittently fails GPG signature verification because of an upstream key-hosting problem (see GPG public key import returns invalid OpenPGP data, blocking Codecov uploads codecov/codecov-action#1955, where a keyserver 404 body gets piped intogpgas if it were key material). Becausefail_ci_if_error: true, this flaky third-party step fails the whole job even when all tests pass. Set it tofalse.python 3.12/3.13jobs on both OSes:tests/test_simulators/test_py21cmfast/test_lightcones.py's mock-cache fixture accesseso.struct.primitive_fields.py21cmfast4.2 renamed that property to_struct(confirmed against upstream source between v4.1.1 and v4.2 tags of 21cmfast/21cmFAST). Sincepyproject.tomlpins21cmFAST>=4.0.0b(floating), pip resolves 4.1.1 on some Python versions and 4.2 on others in CI right now, so the fixture needs to support both attribute names rather than hard-switching to the new one.Test plan
struct->_structrename directly against the21cmFASTv4.1.1 and v4.2 tags on GitHub.python 3.11jobs resolve21cmFAST==4.1.1and3.12/3.13jobs resolve21cmFAST==4.2, matching the pass/fail pattern in the matrix.Generated with Claude Code
Summary by Sourcery
Unblock the CI test matrix by relaxing a flaky Codecov upload step and updating tests to be compatible with multiple py21cmfast versions.
Bug Fixes:
structand new_structattribute names to avoid version-dependent failures.CI:
Tests: