-
Notifications
You must be signed in to change notification settings - Fork 28
fix data cache #555
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
fix data cache #555
Conversation
WalkthroughIntroduces caching keyed by a data registry hash in the reusable mamba-install-dascore action, with cache verification and logging. Updates multiple workflows to pass a cache-number input to this action. No public API changes. Changes
Possibly related PRs
Suggested labels
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #555 +/- ##
=======================================
Coverage 99.92% 99.92%
=======================================
Files 126 126
Lines 10472 10472
=======================================
Hits 10464 10464
Misses 8 8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/actions/mamba-install-dascore/action.yml(2 hunks).github/workflows/get_coverage.yml(1 hunks).github/workflows/run_min_dep_tests.yml(1 hunks).github/workflows/runtests.yml(1 hunks).github/workflows/test_doc_build.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: test_code_min_deps (windows-latest, 3.13)
- GitHub Check: test_code (ubuntu-latest, 3.11)
- GitHub Check: test_code (macos-latest, 3.13)
- GitHub Check: Run benchmarks
🔇 Additional comments (4)
.github/workflows/test_doc_build.yml (1)
21-25: LGTM – wiring the cache number inputThanks for threading the new
cache-numberinto the docs workflow; this keeps the caching behavior consistent with the updated action..github/workflows/get_coverage.yml (1)
19-23: LGTM – cache input propagation looks goodPassing the cache number through here keeps coverage runs aligned with the shared caching scheme.
.github/workflows/runtests.yml (1)
51-55: LGTM – using the shared environment knobHooking the action up to
env.CACHE_NUMBERgives us a single toggle for cache busting across the matrix. Nice touch..github/workflows/run_min_dep_tests.yml (1)
46-52: LGTM – cache-number plumbed throughThe min-deps workflow now opts into the same cache controls as the others. All good here.
| - name: get data registry hash | ||
| shell: bash | ||
| run: | | ||
| echo "DATA_REGISTRY_HASH=$(sha256sum dascore/data_registry.txt | cut -d' ' -f1)" >> $GITHUB_ENV | ||
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.
Replace sha256sum with a cross-platform hash computation
The new cache key step runs on macOS runners, where sha256sum is not installed by default. This will cause every macOS job to fail before we even get to caching. Please switch to a portable approach (e.g., Python’s hashlib) so the hash generation works across Linux, macOS, and Windows.
Apply this diff to fix the issue:
- name: get data registry hash
- shell: bash
- run: |
- echo "DATA_REGISTRY_HASH=$(sha256sum dascore/data_registry.txt | cut -d' ' -f1)" >> $GITHUB_ENV
+ shell: bash
+ run: |
+ python - <<'PY'
+from pathlib import Path
+import hashlib
+import os
+
+data = Path("dascore/data_registry.txt").read_bytes()
+hash_value = hashlib.sha256(data).hexdigest()
+with open(os.environ["GITHUB_ENV"], "a", encoding="utf-8") as env_file:
+ env_file.write(f"DATA_REGISTRY_HASH={hash_value}\n")
+PY🤖 Prompt for AI Agents
In .github/actions/mamba-install-dascore/action.yml around lines 67 to 71 the
step uses the non-portable `sha256sum` which is missing on macOS runners;
replace that shell command with a cross-platform Python invocation that reads
dascore/data_registry.txt in binary, computes hashlib.sha256(...).hexdigest(),
and appends the result to $GITHUB_ENV (e.g., run a one-liner python -c that
prints the hex digest and echo it into DATA_REGISTRY_HASH) so the hash
generation works on Linux, macOS, and Windows runners.
CodSpeed Performance ReportMerging #555 will not alter performanceComparing Summary
|
Description
This PR tries to fix the data cache in the CI. It uses the data registry to invalidate the cache.
Checklist
I have (if applicable):
Summary by CodeRabbit
Chores
Tests