-
Notifications
You must be signed in to change notification settings - Fork 1
ci(hrv): scheduled non-blocking real-data integration lane #170
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
Open
neuron7x
wants to merge
1
commit into
neuron7xLab:main
Choose a base branch
from
neuron7x:ci/hrv-real-data-scheduled
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+109
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| name: HRV Real-Data Integration (scheduled) | ||
|
|
||
| # Non-blocking integration lane for the HRV PhysioNet substrate. | ||
| # | ||
| # Runs the opt-in test gated by NEOSYNAPTEX_RUN_NETWORK_TESTS=1 so that | ||
| # PhysioNet/wfdb drift is still detected without sitting on the PR | ||
| # critical path. Triggers ONLY on schedule + workflow_dispatch — never | ||
| # on pull_request or push, so a network outage cannot block merges. | ||
|
|
||
| on: | ||
| schedule: | ||
| # 03:13 UTC daily — off the top-of-hour cron stampede. | ||
| - cron: "13 3 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| issues: write | ||
|
|
||
| concurrency: | ||
| group: hrv-real-data-integration | ||
| cancel-in-progress: false | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash --noprofile --norc -euo pipefail {0} | ||
|
|
||
| jobs: | ||
| hrv-real-data: | ||
| name: HRV Real-Data PhysioNet Integration | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.12" | ||
| cache: pip | ||
| - name: Install | ||
| run: pip install -e ".[dev]" --quiet | ||
| - name: Run real-data HRV integration | ||
| env: | ||
| NEOSYNAPTEX_RUN_NETWORK_TESTS: "1" | ||
| run: | | ||
| mkdir -p hrv-integration-artifacts | ||
| pytest \ | ||
| tests/test_integrity_v2.py::TestHRV::test_real_data_gamma_in_range \ | ||
| -v --tb=long --timeout=600 \ | ||
| --junitxml=hrv-integration-artifacts/junit.xml \ | ||
| 2>&1 | tee hrv-integration-artifacts/pytest.log | ||
| - name: Upload diagnostic artifacts on failure | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: hrv-integration-artifacts-${{ github.run_id }} | ||
| path: hrv-integration-artifacts/ | ||
| retention-days: 30 | ||
| - name: Surface failure as a rolling drift issue | ||
| if: failure() | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
| run: | | ||
| # Idempotently ensure the tracking label exists. | ||
| gh label create hrv-integration-failure \ | ||
| --description "Scheduled HRV real-data integration drift" \ | ||
| --color B60205 \ | ||
| --force >/dev/null | ||
|
|
||
| # One rolling issue per stable label: comment if open, else create. | ||
| existing=$(gh issue list \ | ||
| --label hrv-integration-failure --state open \ | ||
| --json number --jq '.[0].number // empty') | ||
|
|
||
| ts=$(date -u +%Y-%m-%dT%H:%M:%SZ) | ||
| summary="HRV real-data integration failure on ${ts}" | ||
| body=$(cat <<MARKDOWN | ||
| Scheduled HRV real-data integration failed. | ||
|
|
||
| - Run: ${RUN_URL} | ||
| - Workflow: \`hrv_real_data_integration.yml\` | ||
| - Trigger: \`${{ github.event_name }}\` | ||
|
|
||
| Likely causes (descending probability): | ||
| 1. Transient PhysioNet/wfdb network outage — re-run before investigating. | ||
| 2. NSR2DB record list / annotation format drift. | ||
| 3. \`HRVPhysioNetAdapter\` regression (PSD pipeline, VLF mask, floor). | ||
|
|
||
| Reproduce locally: | ||
| \`\`\` | ||
| NEOSYNAPTEX_RUN_NETWORK_TESTS=1 pytest \\ | ||
| tests/test_integrity_v2.py::TestHRV::test_real_data_gamma_in_range -v | ||
| \`\`\` | ||
|
|
||
| This lane is **non-blocking** — PR throughput is not gated on it. | ||
| Investigate at human cadence; pin/cache records or update the | ||
| adapter as appropriate. | ||
| MARKDOWN | ||
| ) | ||
|
|
||
| if [ -n "${existing}" ]; then | ||
| gh issue comment "${existing}" \ | ||
| --body "${summary}"$'\n\n'"${body}" | ||
| else | ||
| gh issue create \ | ||
| --title "${summary}" \ | ||
| --label hrv-integration-failure \ | ||
| --body "${body}" | ||
| fi | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.