Skip to content

Add CI: tests, project-file validation, mapping.tsv freshness, weekly FBbt release check - #2

Merged
Clare72 merged 3 commits into
mainfrom
ci
Oct 6, 2026
Merged

Clare72 merged 3 commits into
mainfrom
ci

Conversation

@Clare72

@Clare72 Clare72 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On every PR and push to main (.github/workflows/ci.yml, offline, ~seconds):

  • pytest in the locked uv environment (Python 3.14)
  • scripts/validate_project_files.py: every committed mapping / type_mapping / term-request / provenance / samples file is run through the same .claude/hooks/check_*.py validators Claude Code uses on write, so hand edits and PR edits are checked too
  • scripts/check_mapping_tsv.py: fails if a mapping.tsv no longer matches what collate_mapping.py produces (kurmangaliyev_2020 skipped until it is re-collated)

Weekly + on demand (.github/workflows/fbbt-release-check.yml):

  • scripts/check_fbbt_release.py compares OLS's current FBbt release with checks/fbbt_last_checked.json; only when it is newer does it re-verify every project's FBbt terms (current, non-obsolete, label unchanged)
  • on success the record is updated and committed by the workflow; on failure the job fails and the record is kept, so the next run re-checks
  • record seeded with FBbt 2026-10-01: all 64 Davie and 62 Kurmangaliyev terms verified OK

Fixes found while setting this up

  • samples.schema.json rejected the stock field on every sample (both projects) and Davie's clustering name; nothing caught it because samples.json is written by a script, not via the Write hook. Schema fixed; data unchanged.
  • collate_mapping.py wrote CRLF, so every re-run showed a spurious diff; it now writes LF. collate() / verify() are callable for reuse by the checks.

Notes

  • The weekly job pushes its record to main with GITHUB_TOKEN; if branch protection blocks bot pushes it will need to open a PR instead (or an Actions bypass).
  • Scheduled workflows only run from the default branch, so the weekly check starts after merge.

Test plan

  • uv run pytest (41 passed)
  • uv run python scripts/validate_project_files.py (350 files valid)
  • uv run python scripts/check_mapping_tsv.py --skip kurmangaliyev_2020 (davie_2018 ok)
  • uv run python scripts/check_fbbt_release.py (full check on new release, then no-op on rerun)
  • CI workflow passes on this PR

🤖 Generated with Claude Code

Clare72 and others added 3 commits October 6, 2026 11:10
samples.json has carried `stock` (FBst ids) since stocks were added, and Davie's
clusterings carry a `name`, but the schema still rejected both. Nothing caught it
because samples.json is written by a script, not via the Write hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
collate_mapping.collate() and verify_mappings.verify() return results without
writing/printing, for reuse by CI checks. mapping.tsv is written with LF line
endings so re-collating no longer shows a spurious change against git.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…elease check

- ci.yml (PRs + pushes to main): pytest; validate every committed mapping,
  type_mapping, term-request, provenance and samples file with the same
  .claude/hooks validators; fail if a mapping.tsv is stale vs collate
  (kurmangaliyev_2020 skipped until re-collated)
- fbbt-release-check.yml (weekly + manual): only when OLS has a newer FBbt
  release than checks/fbbt_last_checked.json, re-verify all projects' FBbt
  terms; record and commit the release on success, fail and keep the old
  record otherwise
- record seeded with FBbt 2026-10-01 (all 64 Davie + 62 Kurmangaliyev terms OK)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Clare72
Clare72 merged commit 37ad386 into main Oct 6, 2026
1 check passed
@Clare72
Clare72 deleted the ci branch October 6, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant