Repository navigation
Conversation
… the org secret Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #290 +/- ##
==========================================
+ Coverage 74.04% 75.11% +1.07%
==========================================
Files 153 155 +2
Lines 11769 11889 +120
Branches 2010 2041 +31
==========================================
+ Hits 8714 8931 +217
+ Misses 2313 2202 -111
- Partials 742 756 +14
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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
Both Modal deploys copied the org-wide
HUGGING_FACE_TOKENActions secret into the runtime's Modal secret: production (deploy.yml, intopolicyengine-uk-chat-secrets) and previews (pr-beta-deploy.yml). That org secret holds an individual's personal, long-lived Hugging Face token with write access, which every repository in the org can read. It is being retired. This PR moves both deploys to a dedicated repository secret,HF_RUNTIME_READ_TOKEN, meant to hold a read-only token forpolicyengine/policyengine-uk-data-private.HUGGING_FACE_TOKEN; only where the deploy gets the value changes.sync-modal-secret.shnow refuses to write the Modal secret whenHUGGING_FACE_TOKENis empty, and its error namesHF_RUNTIME_READ_TOKEN. That way a deploy cannot ship a runtime without data access.backend/tests/test_modal_app.pypins the new wiring and checks that no workflow reads the org secret, in dotted or bracket form. It also runs the sync script with the token missing and empty, and checks that the script exits non-zero, namesHF_RUNTIME_READ_TOKEN, and never calls Modal.Effect today
None at runtime.
deploy.ymlis disabled, and the preview deploy job isif: false, so neither runs.HF_RUNTIME_READ_TOKENis not set yet. If either deploy is switched back on before it is, the secret sync stops with that message. In production, that happens before the migration and the deploy run. A re-enabled preview job stops its stale backend preview first (pr-beta-deploy.yml, "Stop stale backend preview"), so that preview would be down until the secret is set. The guard only checks that a value is present: a wrong token would still get through. The Modal secrets already written (productionpolicyengine-uk-chat-secretsand any preview secrets) still hold the value they were last synced with. They stop working when that token is revoked, and are replaced on the next deploy after this lands.Verification
pytest backend/tests/test_modal_app.py: 28 passed (minimal Python 3.13 environment with pytest and PyYAML). With the guard commented out, both new guard tests fail.3fed478. It noted that the guard test checked only the text, which the new behavioural tests cover, and that the half-deployed wording was overstated, which is now corrected.actionlinton both workflows is clean, andbash -npasses on the sync script.🤖 Generated with Claude Code