Skip to content

chore: sync infra OpenAPI specs#492

Open
e2b-generated-code-auto-fixer[bot] wants to merge 2 commits into
mainfrom
chore/sync-infra-specs
Open

chore: sync infra OpenAPI specs#492
e2b-generated-code-auto-fixer[bot] wants to merge 2 commits into
mainfrom
chore/sync-infra-specs

Conversation

@e2b-generated-code-auto-fixer

Copy link
Copy Markdown
Contributor

This PR syncs OpenAPI specs from e2b-dev/infra:

  • spec/openapi.infra.yaml
  • spec/openapi.dashboard-api.yaml

It also regenerates dependent TypeScript API types and applies formatting/lint autofixes.


This PR was automatically created by the sync-infra-specs workflow.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Jul 2, 2026 4:03pm

Request Review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional findings (outside current diff — PR may have been updated during review):

  • 🟡 src/core/shared/contracts/infra-api.types.ts:7-13 — The regenerated OpenAPI type files (dashboard-api.types.ts, infra-api.types.ts) use openapi-typescript's default formatting (4-space indent, double quotes, semicolons) instead of the project's biome config (2-space, single quotes, semicolons asNeeded), which is why the diff is dominated by wholesale reformatting. Root cause: .github/workflows/sync-infra-specs.yml:76 diffs src/types/*.types.ts but the generate:* scripts in package.json emit to src/core/shared/contracts/*.types.ts, so GENERATED_TYPE_FILES is always empty and the autofix step silently exits — the PR description's promise to apply 'formatting/lint autofixes' is never honored. Fix by updating the paths in the workflow to src/core/shared/contracts/infra-api.types.ts src/core/shared/contracts/dashboard-api.types.ts; otherwise every future sync PR will churn the same reformatting.

    Extended reasoning...

    What the bug is

    The two regenerated files in this PR (src/core/shared/contracts/dashboard-api.types.ts, src/core/shared/contracts/infra-api.types.ts) come out of openapi-typescript with its defaults — 4-space indent, double quotes, mandatory semicolons — while biome.json for this repo specifies indentWidth: 2, javascript.formatter.quoteStyle: "single", semicolons: "asNeeded". The pre-PR committed versions of both files followed the biome config, and the sister file src/core/shared/contracts/argus-api.types.ts (untouched by this PR) also follows biome style — so the norm is clear: these generated files are expected to be biome-formatted.

    Root cause: a path bug in the sync workflow

    .github/workflows/sync-infra-specs.yml:76 filters the diff on the wrong paths:

    GENERATED_TYPE_FILES=$(git diff --name-only -- src/types/infra-api.types.ts src/types/dashboard-api.types.ts | tr '\n' ' ')

    But package.json writes the generated files elsewhere:

    "generate:infra":         "bunx openapi-typescript ./spec/openapi.infra.yaml         -o ./src/core/shared/contracts/infra-api.types.ts",
    "generate:dashboard-api": "bunx openapi-typescript ./spec/openapi.dashboard-api.yaml -o ./src/core/shared/contracts/dashboard-api.types.ts",

    src/types/*.types.ts does not exist in this repo — the actual generated files live under src/core/shared/contracts/. The git diff --name-only -- <path> pathspec matches nothing, so GENERATED_TYPE_FILES is empty, the guard at line 78–81 fires (No generated type changes detected; skipping autofix.), and bunx biome format --write / bunx biome lint --write never run. The step exits 0, and the PR is created with the raw openapi-typescript output.

    Step-by-step proof

    1. Cron fires; workflow downloads new specs into spec/openapi.infra.yaml and spec/openapi.dashboard-api.yaml.
    2. bun run generate:infra and bun run generate:dashboard-api overwrite src/core/shared/contracts/{infra,dashboard}-api.types.ts with openapi-typescript's 4-space/double-quote/semicolon output.
    3. The autofix step runs git diff --name-only -- src/types/infra-api.types.ts src/types/dashboard-api.types.ts. Since those paths don't exist in the tree, git returns nothing.
    4. GENERATED_TYPE_FILES is empty → the [[ -z ... ]] branch prints No generated type changes detected; skipping autofix. and exit 0.
    5. peter-evans/create-pull-request commits the unformatted regenerated files along with the spec change, producing exactly the wholesale-reformatting diff visible here.

    Running bunx @biomejs/biome format --write ./src/core/shared/contracts/infra-api.types.ts locally reformats the entire file from 4-space/double-quote/semicolon to 2-space/single-quote/no-semicolon — that's the diff the PR description promises but doesn't deliver.

    Why existing code doesn't prevent it

    The autofix step is the only thing that would have normalized this, and it silently no-ops. There's no files.ignore entry in biome.json and no .biomeignore covering src/core/shared/contracts/**, so the formatter has no reason to skip these files — the step just never runs. The lint job in code-quality.yml uses --formatter-enabled=false, so it doesn't gate merge on formatting either.

    Impact

    Auto-generated files, no runtime impact — but every future scheduled sync PR will churn the same massive whitespace/quote/semicolon diff until either (a) the workflow paths are corrected or (b) a biome ignore rule is added for src/core/shared/contracts/*.types.ts. Reviewers will keep seeing 5000+ noise lines for what should be a small schema update (this PR's real change is the four hugePages* fields on NodeMetrics).

    How to fix

    Update line 76 of .github/workflows/sync-infra-specs.yml to point at the actual output paths:

    GENERATED_TYPE_FILES=$(git diff --name-only -- src/core/shared/contracts/infra-api.types.ts src/core/shared/contracts/dashboard-api.types.ts | tr '\n' ' ')

    (Optionally add src/core/shared/contracts/argus-api.types.ts too if generate:argus ever gets wired into this sync workflow.) The fix belongs in a follow-up PR since this PR does not modify the workflow file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant