fix: regenerate openapi assembly fasta#835
Open
diegomayorga-dept wants to merge 2 commits into
Open
Conversation
API Schema Diff |
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.
Title*
[EGV-202] Regenerate OpenAPI spec + API types and auto-guard freshness in pre-commit and CI
Type of Change*
Description
The committed OpenAPI spec (
packages/shared-lib/src/app/openapi/easy-genomics-api.yaml) and its generated types (generated.d.ts) had drifted from the Zod source schemas. Two already-merged features changed schemas without regenerating the spec: EGV-202 added theassembly_fastacolumn role, and EGV-180 added the BYOK LLM fields (HealthOmicsLlmProvider,SeqeraLlmProvider, API-key fields, etc.). The published API contract therefore did not match the code.This PR does two things:
Regenerates the spec + types from the current schemas (
pnpm --filter @easy-genomics/shared-lib generate:openapi→generate:api-types), bringing the committedeasy-genomics-api.yamlandgenerated.d.tsback in sync (addsassembly_fastaand the EGV-180 LLM fields).Prevents recurrence by automating regeneration — the root cause was that nothing forced the spec to be regenerated when a schema changed:
projenrc/husky.tsnow regenerates the spec + types andgit adds them, so a schema change can't be committed with a stale spec.projenrc/github-actions-api-diff-check.tsadds a "Verify OpenAPI spec is up to date" step that regenerates from source and fails viagit diff --exit-codeif the committed copy is stale (catches--no-verifybypasses). It runs before the existing optic breaking-change diff.Both hook and workflow are projen-managed — the changes are in the
projenrc/*.tssources;.husky/pre-commitand.github/workflows/api-diff-check.ymlare the regenerated outputs.Follow-up to the merged EGV-202 (PR #829), which added the role but omitted the regen.
Testing*
openapi-guard.test.ts+data-collection-sample-sheet.test.ts— 20/20 pass; the route-manifest check passes against the regenerated spec.api-diff-checkworkflow itself — it runs on this PR.Impact
optic,openapi-typescript,tsxalready present) and no new network calls.Additional Information
projenrc/*.ts, thenpnpm exec projenregenerates.husky/pre-commitand.github/workflows/api-diff-check.yml. Editing the generated files directly gets overwritten.generate:openapiemits two pre-existing warnings (Could not resolve type 'ListSampleFilesResponse' / 'ListSequenceCollectionSamplesResponse') unrelated to this change.shared-libschema files to reduce commit latency; kept unconditional here for simplicity and reliability.Checklist*