feat: refresh MPS cache from signed webhook#1961
Open
guillaumegay13 wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1961 +/- ##
=======================================
Coverage 99.24% 99.24%
=======================================
Files 169 169
Lines 15333 15333
Branches 5991 5991
=======================================
Hits 15218 15218
Misses 113 113
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
596c51e to
7a2673c
Compare
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
X-Hub-Signature-256usingMODEL_PARAMETERS_WEBHOOK_SECRETbefore refreshing the MPS cacheValidation
npm test --workspace=packages/backend -- src/routing/__tests__/model-parameters-webhook.controller.spec.ts src/config/app.config.spec.ts src/routing/routing-core/__tests__/provider-param-spec.service.spec.ts --runInBandcd packages/backend && npx tsc --noEmitnpx eslint packages/backend/src/routing/model-parameters-webhook.controller.ts packages/backend/src/routing/__tests__/model-parameters-webhook.controller.spec.ts packages/backend/src/config/app.config.ts packages/backend/src/config/app.config.spec.ts packages/backend/src/main.ts packages/backend/src/routing/routing.module.tsnpx prettier --check packages/backend/src/routing/model-parameters-webhook.controller.ts packages/backend/src/routing/__tests__/model-parameters-webhook.controller.spec.ts packages/backend/src/config/app.config.ts packages/backend/src/config/app.config.spec.ts packages/backend/src/main.ts packages/backend/src/routing/routing.module.ts docs/model-parameters-schema.md .changeset/quiet-pens-shake.mdnpm run build --workspace=packages/sharednpm run build --workspace=packages/backendnpm run lint(warnings only, existing)npm run buildgit diff --checkRuntime setup
Set
MODEL_PARAMETERS_WEBHOOK_SECRETin Manifest and use the same value as the GitHub webhook secret onmnfst/modelparameters.dev. Configure the webhook URL as/api/v1/webhooks/model-parameters/githuband subscribe to Pull request events.Summary by cubic
Adds a signed GitHub webhook to refresh the Model Parameters Schema cache after PRs are merged in
mnfst/modelparameters.dev. Busts CDN cache so refreshes apply immediately; the daily 4am refresh remains as fallback.New Features
/api/v1/webhooks/model-parameters/githubverifiesX-Hub-Signature-256withMODEL_PARAMETERS_WEBHOOK_SECRET.pull_requestevents that are closed, merged, targetmain, and belong tomnfst/modelparameters.dev.?refresh=<ts>to bypass CDN; response includesmodel_countandlast_fetched_at.Migration
MODEL_PARAMETERS_WEBHOOK_SECRETin the deployment.mnfst/modelparameters.dev: URLhttps://<manifest-host>/api/v1/webhooks/model-parameters/github, content typeapplication/json, secret =MODEL_PARAMETERS_WEBHOOK_SECRET, events = Pull requests.Written for commit 7a2673c. Summary will update on new commits. Review in cubic