Skip to content

fix: regenerate openapi assembly fasta#835

Open
diegomayorga-dept wants to merge 2 commits into
developmentfrom
fix/egv-202-regenerate-openapi-assembly-fasta
Open

fix: regenerate openapi assembly fasta#835
diegomayorga-dept wants to merge 2 commits into
developmentfrom
fix/egv-202-regenerate-openapi-assembly-fasta

Conversation

@diegomayorga-dept

Copy link
Copy Markdown
Contributor

Title*

[EGV-202] Regenerate OpenAPI spec + API types and auto-guard freshness in pre-commit and CI

Type of Change*

  • New feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Hotfix
  • Security patch
  • UI/UX improvement

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 the assembly_fasta column 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:

  1. Regenerates the spec + types from the current schemas (pnpm --filter @easy-genomics/shared-lib generate:openapigenerate:api-types), bringing the committed easy-genomics-api.yaml and generated.d.ts back in sync (adds assembly_fasta and the EGV-180 LLM fields).

  2. Prevents recurrence by automating regeneration — the root cause was that nothing forced the spec to be regenerated when a schema changed:

    • Pre-commit (auto-fix): projenrc/husky.ts now regenerates the spec + types and git adds them, so a schema change can't be committed with a stale spec.
    • CI (backstop guard): projenrc/github-actions-api-diff-check.ts adds a "Verify OpenAPI spec is up to date" step that regenerates from source and fails via git diff --exit-code if the committed copy is stale (catches --no-verify bypasses). It runs before the existing optic breaking-change diff.

Both hook and workflow are projen-managed — the changes are in the projenrc/*.ts sources; .husky/pre-commit and .github/workflows/api-diff-check.yml are the regenerated outputs.

Follow-up to the merged EGV-202 (PR #829), which added the role but omitted the regen.

Testing*

  • Ran openapi-guard.test.ts + data-collection-sample-sheet.test.ts20/20 pass; the route-manifest check passes against the regenerated spec.
  • The new pre-commit hook was exercised end-to-end committing this PR: generators ran, the spec was already fresh (nothing re-staged), and the existing back-end suite (491 tests) passed.
  • CI guard validated locally: regenerating produces no diff against the committed spec, and re-running the generator is deterministic (repeated runs produce identical output), so the guard won't false-positive.
  • Not yet verified in GitHub Actions: the api-diff-check workflow itself — it runs on this PR.

Impact

  • Repo tooling / CI + generated artifacts only. No runtime/app behaviour change — Lambda handlers validate against the Zod schemas directly, which are unchanged; this only updates the generated spec/types to match them.
  • Pre-commit is slightly slower: it now runs the two generators in addition to the back-end tests it already ran.
  • No new dependencies (optic, openapi-typescript, tsx already present) and no new network calls.

Additional Information

  • The generated files must be edited via projen: change projenrc/*.ts, then pnpm exec projen regenerates .husky/pre-commit and .github/workflows/api-diff-check.yml. Editing the generated files directly gets overwritten.
  • generate:openapi emits two pre-existing warnings (Could not resolve type 'ListSampleFilesResponse' / 'ListSequenceCollectionSamplesResponse') unrelated to this change.
  • Optional future optimisation: gate the pre-commit regen on staged shared-lib schema files to reduce commit latency; kept unconditional here for simplicity and reliability.

Checklist*

  • No new errors or warnings have been introduced. (the two generator warnings above are pre-existing)
  • All tests pass successfully and new tests added as necessary. (existing tests pass — 20/20 unit + 491 back-end via hook; no new unit test added, the CI freshness step is itself the regression guard)
  • Documentation has been updated accordingly. (N/A — no user-facing docs affected)
  • Code adheres to the coding and style guidelines of the project.
  • Code has been commented in particularly hard-to-understand areas. (rationale comments added in the hook and CI step)

@diegomayorga-dept diegomayorga-dept changed the title Fix/egv 202 regenerate openapi assembly fasta Fix: EGV-202 regenerate openapi assembly fasta Jul 9, 2026
@diegomayorga-dept diegomayorga-dept changed the title Fix: EGV-202 regenerate openapi assembly fasta fix: regenerate openapi assembly fasta Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

API Schema Diff

x Easy Genomics API /tmp/api-base.yaml
Preview docs:  https://useoptic.com/docs/cloud-get-started
Operations: 16 operations changed
x  Checks: 39/43 passed 

✔ PUT /easy-genomics/user/update-user-request/{id}: 
  - request: 
    - body application/json: 
      - property /schema/properties/AnalyticsConsent: added
  - response 200: 
    - body application/json: 
      - property /schema/properties/AnalyticsConsent: added
✔ GET /easy-genomics/user/list-user-self: 
  - response 200: 
    - body application/json: 
      - property /schema/properties/AnalyticsConsent: added
✔ GET /easy-genomics/user/list-all-users: 
  - response 200: 
    - body application/json: 
      - property /schema/properties/AnalyticsConsent: added
✔ PUT /easy-genomics/laboratory/update-laboratory/{id}: 
  - request: 
    - body application/json: 
      - property /schema/properties/HealthOmicsLlmProvider: added
      - property /schema/properties/HealthOmicsLlmModelId: added
      - property /schema/properties/SeqeraLlmProvider: added
      - property /schema/properties/SeqeraLlmModelId: added
      - property /schema/properties/HealthOmicsLogEnrichmentEnabled: added
      - property /schema/properties/HealthOmicsLlmApiKey: added
      - property /schema/properties/SeqeraLlmApiKey: added
  - response 200: 
    - body application/json: 
      - property /schema/properties/HealthOmicsLlmProvider: added
      - property /schema/properties/HealthOmicsLlmModelId: added
      - property /schema/properties/SeqeraLlmProvider: added
      - property /schema/properties/SeqeraLlmModelId: added
      - property /schema/properties/HealthOmicsLogEnrichmentEnabled: added
      - property /schema/properties/HasHealthOmicsLlmApiKey: added
      - property /schema/properties/HasSeqeraLlmApiKey: added
✔ PUT /easy-genomics/laboratory/run/update-laboratory-run/{id}: 
  - response 200: 
    - body application/json: 
      - property /schema/properties/FailureReason: added
      - property /schema/properties/FailureStatusMessage: added
      - property /schema/properties/FailureErrorReport: added
      - property /schema/properties/FailureOwner: added
      - property /schema/properties/FailureSummary: added
      - property /schema/properties/FailureAction: added
      - property /schema/properties/FailureClassifiedBy: added
✔ GET /easy-genomics/laboratory/run/read-laboratory-run/{id}: 
  - response 200: 
    - body application/json: 
      - property /schema/properties/FailureReason: added
      - property /schema/properties/FailureStatusMessage: added
      - property /schema/properties/FailureErrorReport: added
      - property /schema/properties/FailureOwner: added
      - property /schema/properties/FailureSummary: added
      - property /schema/properties/FailureAction: added
      - property /schema/properties/FailureClassifiedBy: added
✔ GET /easy-genomics/laboratory/run/list-laboratory-runs: 
  - response 200: 
    - body application/json: 
      - property /schema/properties/FailureReason: added
      - property /schema/properties/FailureStatusMessage: added
      - property /schema/properties/FailureErrorReport: added
      - property /schema/properties/FailureOwner: added
      - property /schema/properties/FailureSummary: added
      - property /schema/properties/FailureAction: added
      - property /schema/properties/FailureClassifiedBy: added
✔ POST /easy-genomics/laboratory/run/create-laboratory-run: 
  - response 200: 
    - body application/json: 
      - property /schema/properties/FailureReason: added
      - property /schema/properties/FailureStatusMessage: added
      - property /schema/properties/FailureErrorReport: added
      - property /schema/properties/FailureOwner: added
      - property /schema/properties/FailureSummary: added
      - property /schema/properties/FailureAction: added
      - property /schema/properties/FailureClassifiedBy: added
✔ POST /easy-genomics/laboratory/request-laboratory: 
  - response 200: 
    - body application/json: 
      - property /schema/properties/HealthOmicsLlmProvider: added
      - property /schema/properties/HealthOmicsLlmModelId: added
      - property /schema/properties/SeqeraLlmProvider: added
      - property /schema/properties/SeqeraLlmModelId: added
      - property /schema/properties/HealthOmicsLogEnrichmentEnabled: added
      - property /schema/properties/HasHealthOmicsLlmApiKey: added
      - property /schema/properties/HasSeqeraLlmApiKey: added
✔ GET /easy-genomics/laboratory/read-laboratory/{id}: 
  - response 200: 
    - body application/json: 
      - property /schema/properties/HealthOmicsLlmProvider: added
      - property /schema/properties/HealthOmicsLlmModelId: added
      - property /schema/properties/SeqeraLlmProvider: added
      - property /schema/properties/SeqeraLlmModelId: added
      - property /schema/properties/HealthOmicsLogEnrichmentEnabled: added
      - property /schema/properties/HasHealthOmicsLlmApiKey: added
      - property /schema/properties/HasSeqeraLlmApiKey: added
✔ GET /easy-genomics/laboratory/list-laboratories: 
  - response 200: 
    - body application/json: 
      - property /schema/properties/HealthOmicsLlmProvider: added
      - property /schema/properties/HealthOmicsLlmModelId: added
      - property /schema/properties/SeqeraLlmProvider: added
      - property /schema/properties/SeqeraLlmModelId: added
      - property /schema/properties/HealthOmicsLogEnrichmentEnabled: added
      - property /schema/properties/HasHealthOmicsLlmApiKey: added
      - property /schema/properties/HasSeqeraLlmApiKey: added
✔ POST /easy-genomics/laboratory/create-laboratory: 
  - request: 
    - body application/json: 
      - property /schema/properties/HealthOmicsLlmProvider: added
      - property /schema/properties/HealthOmicsLlmModelId: added
      - property /schema/properties/SeqeraLlmProvider: added
      - property /schema/properties/SeqeraLlmModelId: added
      - property /schema/properties/HealthOmicsLogEnrichmentEnabled: added
      - property /schema/properties/HealthOmicsLlmApiKey: added
      - property /schema/properties/SeqeraLlmApiKey: added
  - response 200: 
    - body application/json: 
      - property /schema/properties/HealthOmicsLlmProvider: added
      - property /schema/properties/HealthOmicsLlmModelId: added
      - property /schema/properties/SeqeraLlmProvider: added
      - property /schema/properties/SeqeraLlmModelId: added
      - property /schema/properties/HealthOmicsLogEnrichmentEnabled: added
      - property /schema/properties/HasHealthOmicsLlmApiKey: added
      - property /schema/properties/HasSeqeraLlmApiKey: added
x PUT /easy-genomics/data-collections/update-sequence-collection-schema/{id}: 
  - request: 
    - body application/json: 
      - property /schema/properties/Columns/items/properties/role: changed
  - response 200: 
    - body application/json: 
      - property /schema/properties/Columns/items/properties/role: changed
      
        x [request and response property enums] cannot add enum option 'assembly_fasta' from 'role' property. This is a breaking change.
        at https://github.com/dept/easy-genomics/tree/a54af56741cc5a242ad3a7d3540b4aecf74ed25d/packages/shared-lib/src/app/openapi/easy-genomics-api.yaml#L519
        
x GET /easy-genomics/data-collections/list-sequence-collections: 
  - response 200: 
    - body application/json: 
      - property /schema/properties/SequenceCollections/items/properties/Columns/items/properties/role: changed
      
        x [request and response property enums] cannot add enum option 'assembly_fasta' from 'role' property. This is a breaking change.
        at https://github.com/dept/easy-genomics/tree/a54af56741cc5a242ad3a7d3540b4aecf74ed25d/packages/shared-lib/src/app/openapi/easy-genomics-api.yaml#L519
        
x POST /easy-genomics/data-collections/edit-sequence-collection: 
  - request: 
    - body application/json: 
      - property /schema/properties/Columns/items/properties/role: changed
  - response 200: 
    - body application/json: 
      - property /schema/properties/Columns/items/properties/role: changed
      
        x [request and response property enums] cannot add enum option 'assembly_fasta' from 'role' property. This is a breaking change.
        at https://github.com/dept/easy-genomics/tree/a54af56741cc5a242ad3a7d3540b4aecf74ed25d/packages/shared-lib/src/app/openapi/easy-genomics-api.yaml#L519
        
x POST /easy-genomics/data-collections/create-sequence-collection: 
  - request: 
    - body application/json: 
      - property /schema/properties/Columns/items/properties/role: changed
  - response 200: 
    - body application/json: 
      - property /schema/properties/Columns/items/properties/role: changed
      
        x [request and response property enums] cannot add enum option 'assembly_fasta' from 'role' property. This is a breaking change.
        at https://github.com/dept/easy-genomics/tree/a54af56741cc5a242ad3a7d3540b4aecf74ed25d/packages/shared-lib/src/app/openapi/easy-genomics-api.yaml#L519
        

@diegomayorga-dept diegomayorga-dept added the breaking-change PR contains intentional breaking API changes (bypasses api-diff-check) label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change PR contains intentional breaking API changes (bypasses api-diff-check)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant