ci(deploy): reset hfs/hts DB on deploy and bootstrap hts terminologies#177
Merged
Conversation
Wipe the database on each hfs and hts deploy so servers start clean. For hts, ship the bundled terminology-data to the host and set HTS_BOOTSTRAP_DIR so the server auto-imports all terminologies on startup; clearing the DB also clears the bootstrap_imports ledger so the import re-runs fresh each deploy. Also write the systemd unit on every deploy (instead of only when absent) so env changes like HTS_BOOTSTRAP_DIR reconcile on existing hosts.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Changes the CD
deployjob in.github/workflows/ci.ymlso that the hfs and hts deployments start from a clean database, and hts auto-loads its bundled terminologies on startup.hfs
/opt/hfs/fhir.db(+ WAL/SHM) and thedata/hfs.db*job-state variants. Search-parameter JSON underdata/is preserved — only.dbfiles are removed.hts
/opt/hts/data/hts.db*. This also clears thebootstrap_importsledger, so terminologies re-import fresh on startup.terminology-data(already bundled in the release tarball, previously discarded at deploy time).scp'd to the host at/opt/hts/terminology-data.HTS_BOOTSTRAP_DIR=/opt/hts/terminology-data, triggering auto-import on startup.Supporting change
HTS_BOOTSTRAP_DIR) reconcile on hosts that already have the service. This also means changes likeHFS_BASE_URLnow reconcile for the other servers.Notes
is-activecheck usesType=simple, so it passes once the process is up and won't fail the deploy while the import is still running.fhirpath-serverandsof-serverdeploys are unchanged (no DB to reset).