Skip to content

Fix CI test data cache behavior - #626

Merged
d-chambers merged 6 commits into
masterfrom
os_caches
Mar 14, 2026
Merged

Fix CI test data cache behavior#626
d-chambers merged 6 commits into
masterfrom
os_caches

Conversation

@d-chambers

@d-chambers d-chambers commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fix the test-data cache path by using pooch's cache directory directly
  • make test-data cache keys OS-specific and include the data version and registry hash
  • simplify CI by removing the standalone cache-priming workflow and priming on cache miss within each workflow

Testing

  • verified the workflow/action diffs locally
  • did not run GitHub Actions from the CLI

Summary by CodeRabbit

  • Chores
    • Enhanced test data cache management in CI/CD pipelines with support for on-demand cache priming across multiple operating systems.
    • Consolidated cache restoration and data preparation into a single unified step, improving workflow efficiency and reducing redundant operations.
    • Updated cache key generation to incorporate OS, data version, and registry hash for more granular cache management.

@coderabbitai

coderabbitai Bot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@d-chambers has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 58 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 69c12214-f71f-40ab-aa57-afc34835b5de

📥 Commits

Reviewing files that changed from the base of the PR and between e184e8d and 0d4d909.

📒 Files selected for processing (6)
  • .github/actions/cache-test-data/action.yml
  • .github/workflows/get_coverage.yml
  • .github/workflows/profile.yml
  • .github/workflows/run_min_dep_tests.yml
  • .github/workflows/runtests.yml
  • .github/workflows/test_doc_build.yml

Walkthrough

Adds a prime-on-miss input to the cache-test-data GitHub Action that pre-fetches test data on cache misses when using restore-save mode. Updates multiple workflows to use the consolidated restore-save mode with prime-on-miss enabled, eliminating separate download and save steps. Removes the dedicated prime_test_data_cache workflow file.

Changes

Cohort / File(s) Summary
Cache Test Data Action
.github/actions/cache-test-data/action.yml
Added prime-on-miss input (default false) to enable pre-fetching test data on cache miss. Updated cache-key description to reflect OS, data version, and registry hash derivation. Enhanced prerequisites validation for Python and Pooch. Integrated data version retrieval from dascore.constants.DATA_VERSION into cache key construction. Introduced conditional step to download all registered test data when prime-on-miss is true and cache miss occurs. Modified save step condition to skip only when cache hit occurs with prime-on-miss enabled.
Workflows Updated
.github/workflows/get_coverage.yml, .github/workflows/profile.yml, .github/workflows/run_min_dep_tests.yml, .github/workflows/runtests.yml, .github/workflows/test_doc_build.yml
Consolidated separate download and save steps into single cache action invocation with mode: restore-save and prime-on-miss: "true". Added matrix strategy for OS-specific cache priming in run_min_dep_tests.yml and runtests.yml (ubuntu-latest, macos-latest, windows-latest). Removed explicit "Download all registered test data" and "Save primed test data cache" steps across all workflows.
Workflow Deleted
.github/workflows/prime_test_data_cache.yml
Removed entire workflow file that previously handled scheduled and manual cache priming via separate restore, download, and save steps.

Possibly related PRs

Suggested labels

CI

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly reflects the main change: fixing CI test data cache behavior across multiple workflows and the action configuration.
Description check ✅ Passed The description clearly outlines the main changes and testing performed, though it does not follow the repository's template structure with checklist items.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch os_caches
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the CI continuous integration label Mar 14, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e184e8df51

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

registry_path = Path("dascore/data_registry.txt")
print(f"DATA_REGISTRY_HASH={sha256(registry_path.read_bytes()).hexdigest()}")
PY
constants = runpy.run_path("dascore/constants.py")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid importing full constants module in cache metadata step

Loading DATA_VERSION via runpy.run_path("dascore/constants.py") executes the entire constants module, which imports heavy runtime deps (pandas, numpy, and dascore) that are not guaranteed in environments that only need cache restore. In this repo, .github/actions/mamba-install-dascore/action.yml invokes this cache action even when install-package: false (used by run_min_dep_tests before pip install -e .[test]), so the new metadata step can fail with ModuleNotFoundError before tests start; reading DATA_VERSION without executing module imports would avoid breaking that workflow.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/actions/cache-test-data/action.yml:
- Line 22: The output description for the `cache-key` in action.yml is
incomplete — it omits the `cache-number` component; update the `description`
value for the `cache-key` output (and the identical occurrence at the other
location) to state that the generated cache key is derived from OS, data
version, registry hash, and cache-number so the doc matches the actual generated
key.
- Around line 12-15: Update the description for the action input named
"prime-on-miss" to match the actual implementation: state that it only applies
when mode is set to "restore-save" (not any restore mode). Locate the
"prime-on-miss" input entry in action.yml and change the description text to
explicitly mention "only used when mode='restore-save'" so users won't assume it
applies to all restore-related modes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2f417a29-fb82-46da-bcee-69267f5438ba

📥 Commits

Reviewing files that changed from the base of the PR and between 6d927bc and e184e8d.

📒 Files selected for processing (7)
  • .github/actions/cache-test-data/action.yml
  • .github/workflows/get_coverage.yml
  • .github/workflows/prime_test_data_cache.yml
  • .github/workflows/profile.yml
  • .github/workflows/run_min_dep_tests.yml
  • .github/workflows/runtests.yml
  • .github/workflows/test_doc_build.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/prime_test_data_cache.yml

Comment thread .github/actions/cache-test-data/action.yml
Comment thread .github/actions/cache-test-data/action.yml Outdated
@codecov

codecov Bot commented Mar 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.93%. Comparing base (6d927bc) to head (0d4d909).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #626      +/-   ##
==========================================
+ Coverage   99.49%   99.93%   +0.44%     
==========================================
  Files         135      135              
  Lines       11570    11570              
==========================================
+ Hits        11511    11562      +51     
+ Misses         59        8      -51     
Flag Coverage Δ
unittests 99.93% <ø> (+0.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@d-chambers
d-chambers merged commit 293a00f into master Mar 14, 2026
25 checks passed
@d-chambers
d-chambers deleted the os_caches branch March 14, 2026 17:34
@d-chambers d-chambers mentioned this pull request Mar 16, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI continuous integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant