-
Notifications
You must be signed in to change notification settings - Fork 223
feat: openapi typescript client #2885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Marshevskyy
wants to merge
137
commits into
main
Choose a base branch
from
feat/ts-client-gen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
137 commits
Select commit
Hold shift + click to select a range
850706f
feat(openapi-typescript): generate-client — typed, zero-dependency Op…
Marshevskyy 6aeb52b
docs(cli): update text formatting
JLekawa 2e5ae8d
Apply suggestions from code review
JLekawa ae5cebe
docs(cli): fix Markdoc errors, fix formatting
JLekawa 3f38466
docs(realm): fix redirect error
JLekawa 1adbf1e
docs(cli): fix redirect error
JLekawa 0d974de
fix(openapi-typescript): point examples at the spec server + add test…
Marshevskyy 7efcb23
Merge origin/main into feat/ts-client-gen
Marshevskyy e53e0b1
docs(generate-client): strip trailing spaces to satisfy markdownlint …
Marshevskyy 95adc1e
ci(docs): use vale filter_mode nofilter to survive large-PR diffs
Marshevskyy 5afa6a5
test(generate-client): commit consumer api.ts so flat typecheck finds it
Marshevskyy adc413e
fix: formatting
Marshevskyy f44e269
fix: align root react/react-dom with main (19.x) to fix build-docs sn…
Marshevskyy 212bb7f
ci(docs): use reviewdog local reporter for vale so large PRs don't 406
Marshevskyy 34594a7
Update docs/@v2/commands/generate-client.md
Marshevskyy f0c810b
fix(openapi-typescript): explicit .js extensions in example imports; …
Marshevskyy 041040e
chore: revert vale reporter change; drop branch-added coverage thresh…
Marshevskyy 776d818
docs(openapi-typescript): add a Node (msw/node) variant to the mock e…
Marshevskyy 0340e2d
chore: drop trailing comma in vitest.config.ts (oxfmt es5 normalization)
Marshevskyy 8dad18b
fix(openapi-typescript): SSE — flush final frame and finish on clean …
Marshevskyy dab6d50
fix(openapi-typescript): empty generators list falls back to the defa…
Marshevskyy aab5c4a
fix(cli): generate-client only loads a config file when --config-file…
Marshevskyy b97f6ba
Merge remote-tracking branch 'origin/main' into feat/ts-client-gen
Marshevskyy 840c33a
fix: formatting
Marshevskyy f7dec25
fix(openapi-typescript): drain a retried response body before the nex…
Marshevskyy 6532520
fix(openapi-typescript): regenerate programmatic example with the bod…
Marshevskyy 914d1c6
fix(openapi-typescript): SSE reconnects on a transport failure openin…
Marshevskyy 28a9c05
test(openapi-typescript): move examples drift test under generate-cli…
Marshevskyy 3a0754b
refactor(openapi-typescript): drop *.config.ts config-file support an…
Marshevskyy 69393cf
refactor!: rename @redocly/openapi-typescript → @redocly/client-gener…
Marshevskyy ba801b4
Merge remote-tracking branch 'origin/main' into feat/ts-client-gen
Marshevskyy 977e19d
fix(client-generator): serialize request body after the onRequest chain
Marshevskyy 448a592
feat(client-generator): operation context on requests + baked publish…
Marshevskyy b4930f2
fix: formatting
Marshevskyy 18fe9c3
fix(client-generator): resolve CodeQL alerts (ReDoS, URL/stack-trace,…
Marshevskyy ee13cb5
docs(client-generator): fix --setup section link fragment (MD051)
Marshevskyy 4b7b44a
docs(client-generator): use imperative --setup heading (Vale HeaderGe…
Marshevskyy 7dbd311
fix(client-generator): accept relative base-url; resolve CLI --setup …
Marshevskyy b55d394
fix(client-generator): serialize multipart body after the onRequest c…
Marshevskyy 9946803
fix(client-generator): resolve generateClient setup path from cwd, li…
Marshevskyy 18705f9
fix: formatting
Marshevskyy 58573fd
refactor(client-generator): move examples under tests/e2e/generate-cl…
Marshevskyy abff0c3
docs(client-generator): simplify and restructure the command reference
Marshevskyy 7b87b6c
refactor(client-generator): rename the input positional/field to api
Marshevskyy 2b87a3f
feat(core): register client + clientOutput in the redocly.yaml config…
Marshevskyy 3596d12
refactor(client-generator): rename baseUrl to serverUrl
Marshevskyy 9379791
feat(cli): generate-client reads the client config block; three invoc…
Marshevskyy 37b5949
test(client-generator): move examples + e2e to the new client config …
Marshevskyy 2159ba5
refactor(client-generator): rename setBaseUrl to setServerUrl
Marshevskyy 794649e
docs(client-generator): document the client config model + serverUrl
Marshevskyy 4d55775
refactor(core): type client + clientOutput on the resolved config
Marshevskyy 582b3e4
chore: drop the body-serialization changeset
Marshevskyy 953206c
refactor(cli): use openapi-core pluralize for the generate-client sum…
Marshevskyy 829839e
refactor(cli): drop explanatory comments in the generators coerce
Marshevskyy 5deef0d
refactor(client-generator): rename ir/ to intermediate-representation/
Marshevskyy 5728f00
fix(client-generator): correct stale/misplaced comments and a dead __…
Marshevskyy f8faebf
chore: stop blanket-ignoring e2e yaml in oxfmt
Marshevskyy 7197b02
style: run oxfmt across the client-generator branch
Marshevskyy 4743b58
test(client-generator): compile generated clients under nodenext, not…
Marshevskyy 6ea02b4
refactor(client-generator): expose everything from the single package…
Marshevskyy e1d9098
test(client-generator): use outdent for inline specs and consumer scr…
Marshevskyy 447b4e9
docs: add generate-client to the v2 sidebar
Marshevskyy da30a43
docs: split generate-client into command, client-usage, and config pages
Marshevskyy fe64930
docs: keep generate-client as a single command page
Marshevskyy 25d8f18
docs: drop the extra generate-client sidebar entries
Marshevskyy 6f46549
docs: client usage as a guide, client config under configuration/refe…
Marshevskyy 4158cdc
fix(client-generator): address cursor-bot findings (serverUrl, dup ou…
Marshevskyy 6f21aa5
docs(client-generator): note retry resend + use()/configure middlewar…
Marshevskyy 3f0323c
Update README.md
Marshevskyy 59990e9
docs(client-generator): new ard for msw vs mock server
Marshevskyy d6f7e80
feat(client-generator): runtime module + descriptor client (--runtime…
Marshevskyy b5dda87
Merge remote-tracking branch 'origin/main' into feat/ts-client-gen
Marshevskyy 273c7a7
docs: wrap overlong line in the generated-client guide (markdownlint …
Marshevskyy 303bd1c
fix: align @redocly/client-generator's openapi-core dependency with t…
Marshevskyy 93d7ee1
fix(generate-client): restrict serverUrl to http(s)/root-relative; re…
Marshevskyy b472709
feat(client-generator): auto-pagination — declared, statically verifi…
Marshevskyy eb526f7
feat(client-generator): nested-facade example + output-path interpola…
Marshevskyy 1bd0464
fix: versions
Marshevskyy be55f66
Merge remote-tracking branch 'origin/main' into feat/ts-client-gen
Marshevskyy 489ed53
fix: stop oxfmt reformatting generated pagination-consumer artifacts
Marshevskyy 504696d
fix(respect): wait for json-server readiness in the local-json-server…
Marshevskyy 3f09b2b
fix(client-generator): result-mode pagination must not throw on succe…
Marshevskyy 214b867
Merge remote-tracking branch 'origin/main' into feat/ts-client-gen
Marshevskyy bf5f82b
ci: cap e2e parallelism to keep the runner within memory
Marshevskyy 5a424ec
test(client-generator): refresh base/sse consumer fixtures for the pa…
Marshevskyy fc32f83
fix: change ci runner to gh hosted
Marshevskyy 2989dc8
fix(client-generator): deep-merge pagination when layering client con…
Marshevskyy be92b1e
ci: split e2e into two sharded jobs
Marshevskyy 0ef1ba1
docs(client-generator): fix README generateClient import and list the…
Marshevskyy 45887e6
fix: vitest thresholds
Marshevskyy a9eb026
fix(client-generator): address PR review comments
Marshevskyy f649e42
feat(client-generator): repeatable --generator flag; resolve per-alia…
Marshevskyy 47a44fe
fix(client-generator): update stale golden + assertions for the revie…
Marshevskyy 4f9bde4
test(client-generator): regenerate inline consumer fixtures for the r…
Marshevskyy 698d123
fix(client-generator): encode cookie auth, coerce string pagination o…
Marshevskyy 895908a
docs(changeset): shorten the client-generator changeset to what's added
Marshevskyy 71fbff9
fix(cli): resolve generate-client apis via getFallbackApisOrExit like…
Marshevskyy 7d0fc4c
chore(cli): restore the original build banner comment
Marshevskyy 1015231
refactor(cli): move generate-client comments into docs and yargs desc…
Marshevskyy 5152c2b
refactor(cli): return each serverUrl validation case explicitly
Marshevskyy 51550d8
refactor(cli): read the effective client block via config.forAlias
Marshevskyy c589573
fix(client-generator): UTF-8-safe basic auth encoding and Headers-ins…
Marshevskyy d66f14c
refactor(core): remove needless client config comments
Marshevskyy 3cbe9b8
fix(cli): opt apis into generate-client fan-out via clientOutput too
Marshevskyy 8c5a54b
fix(client-generator): put the types condition first in package exports
Marshevskyy 41a96e7
Merge remote-tracking branch 'origin/main' into feat/ts-client-gen
Marshevskyy f9904f3
fix(core): layer a per-api client block over the top-level one field …
Marshevskyy 1c6fe7e
fix(client-generator): fail closed on oversized SSE frames instead of…
Marshevskyy a381825
fix(client-generator): skip the optional-auth marker when resolving o…
Marshevskyy e25b149
fix(core): keep the pagination block additive when layering per-api c…
Marshevskyy 36c569f
fix(client-generator): let CommonJS projects require() the package ru…
Marshevskyy 0896157
Merge remote-tracking branch 'origin/main' into feat/ts-client-gen
Marshevskyy 1a16633
fix(client-generator): apply the first configured security alternativ…
Marshevskyy f5776cf
fix(client-generator): cancel the abandoned body when onResponse repl…
Marshevskyy 3aea0d0
feat(client-generator): zod runtime validation — operationSchemas map…
Marshevskyy 7958fbb
fix(client-generator): declaration-safe operationSchemas and omit on …
Marshevskyy 3bef857
Update docs/@v2/configuration/reference/client.md
Marshevskyy cebc122
Update docs/@v2/configuration/reference/client.md
Marshevskyy 1b7ce53
Update docs/@v2/configuration/reference/client.md
Marshevskyy 8bca18f
test(cli): prove shared generator defaults survive per-api client ove…
Marshevskyy fae2394
refactor(client-generator): match apiKey scheme kinds exactly
Marshevskyy 238612b
test(client-generator): share the example spec, gitignore generated c…
Marshevskyy de9b41f
test(client-generator): extract shared e2e helpers and stop committin…
Marshevskyy 26455fa
test(client-generator): drop redundant unit tests and runtime-embeddi…
Marshevskyy 3874370
refactor(client-generator): dedupe emitter helpers, inline the writer…
Marshevskyy 1970eb7
fix(cli): validate the --setup flag like the config setup and complet…
Marshevskyy 617f1a1
docs(cli): use semantic line breaks in the generate-client guide and …
Marshevskyy 94a7339
test(cli): drive the redocly-config e2e suite with a minimal inline s…
Marshevskyy ed231e1
docs(client-generator): fold the customization example into configure…
Marshevskyy 38f807b
test(client-generator): make fixture arguments explicit and dedupe th…
Marshevskyy c6266bc
Potential fix for pull request finding 'CodeQL / Workflow does not co…
Marshevskyy 0f71a56
fix(client-generator): resolve server-URL variables, match pagination…
Marshevskyy a8deb80
fix(client-generator): snapshot release
Marshevskyy d4c6f3b
fix(client-generator): snapshot release p2
Marshevskyy c1e7ce0
chore(examples): reference the published client-generator snapshot in…
Marshevskyy 75b1cd6
fix(client-generator): publish the CLI snapshot before client-generator
Marshevskyy f11d5af
test(cli): per-api runtime-only block inherits shared generators and …
Marshevskyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| '@redocly/client-generator': minor | ||
| '@redocly/openapi-core': minor | ||
| '@redocly/cli': minor | ||
| --- | ||
|
|
||
| Added an experimental `generate-client` command that generates a typed, zero-dependency TypeScript client from an OpenAPI description — with auth, retries, middleware, typed SSE streaming, auto-pagination, and multipart support. | ||
| The `--generator` option emits companion modules from the same description: `zod`, `tanstack-query`, `swr`, `transformers`, and `mock`. | ||
| See the [`generate-client` command reference](https://redocly.com/docs/cli/commands/generate-client) and the [Use the generated client](https://redocly.com/docs/cli/guides/use-generated-client) guide. |
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
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
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
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
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
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
|
vadyvas marked this conversation as resolved.
vadyvas marked this conversation as resolved.
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| --- | ||
| slug: | ||
| - /docs/cli/commands/generate-client | ||
| --- | ||
|
|
||
| # `generate-client` | ||
|
|
||
| {% admonition type="warning" name="Experimental" %} | ||
| `generate-client` is **experimental**: its flags, generated output, configuration schema, and custom-generator API may change in any minor release until it's stable. | ||
| We'd love your feedback while we stabilize it. | ||
| {% /admonition %} | ||
|
|
||
| Generate a typed TypeScript client from an OpenAPI 3.x description. | ||
| Swagger 2.0 descriptions are also accepted — normalized to the 3.x shape before generation. | ||
|
|
||
| The generated client has **zero runtime dependencies** by default — it uses only web-standard APIs (`fetch`, `AbortController`, `URLSearchParams`, …), so it runs in browsers, Node, Bun, Deno, and edge runtimes. | ||
| By default it emits a single self-contained file with inline types and one async function per operation; opt in to a versioned, npm-updatable runtime instead with [`--runtime package`](#runtime-distribution). | ||
|
|
||
| This page covers running the command; for the generated client's runtime API (auth, error handling, middleware, retries, and the add-on generators) see [Use the generated client](../guides/use-generated-client.md). | ||
|
|
||
| ## Usage | ||
|
|
||
| ```sh | ||
| redocly generate-client # every api with a `client` block or `clientOutput` | ||
| redocly generate-client cafe # a single `apis:` alias from redocly.yaml | ||
| redocly generate-client openapi.yaml -o dist/client.ts # a file path or URL | ||
| ``` | ||
|
|
||
| With no argument, a client is generated for every api that declares a `client` block or a `clientOutput` under `apis:` (see [`client` configuration](../configuration/reference/client.md)). | ||
| Otherwise `<api>` is a file path, a URL, or an [`apis:` alias](../configuration/index.md), resolved the same way as in other commands such as `bundle` and `lint`: an alias — or a path matching an api's `root` — uses that api's `client` block and `clientOutput`, while an unmatched path/URL uses the top-level `client` defaults. | ||
|
|
||
| ## Options | ||
|
|
||
| | Option | Type | Description | | ||
| | ------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | `api` | `string` | OpenAPI description file path, URL, or an `apis:` alias. Omit it to generate for every api that has a `client` block or `clientOutput`. | | ||
| | `--output`, `-o` | `string` | Output path (must end in `.ts`); the entry file in multi-file modes. Defaults to the api's `clientOutput`, else `<name>.client.ts` in the config dir. Not allowed when generating for multiple apis. | | ||
| | `--output-mode` | `string` | File layout: `single` (default) or `split`. See [Output modes](#output-modes). | | ||
| | `--runtime` | `string` | `inline` (default, self-contained file — zero runtime dependencies) or `package` (imports the runtime from `@redocly/client-generator`; engine fixes arrive via `npm update`). See [Runtime distribution](#runtime-distribution). | | ||
| | `--generator` | `string[]` | Generator to run — a built-in name or a custom generator's path/package; repeat the flag to run several (default `sdk`). See [Generators](../guides/use-generated-client.md#generators). | | ||
| | `--args-style` | `string` | Operation inputs: `flat` (default, positional) or `grouped` (a single `vars` object). See [Argument style](../guides/use-generated-client.md#argument-style). | | ||
| | `--enum-style` | `string` | Named string enums: `const-object` (default, `as const` object + union) or `union` (union only). | | ||
| | `--error-mode` | `string` | `throw` (default, throws `ApiError`) or `result` (returns `{ data, error, response }`). See [Error handling](../guides/use-generated-client.md#error-handling). | | ||
| | `--date-type` | `string` | `date`/`date-time` fields as `string` (default) or `Date` (pair with the `transformers` generator). | | ||
| | `--query-framework` | `string` | TanStack Query adapter: `react` (default), `vue`, `svelte`, or `solid`. | | ||
| | `--mock-data` | `string` | `mock` generator data: `baked` (default, deterministic literals) or `faker` (`@faker-js/faker` calls). | | ||
| | `--mock-seed` | `number` | Seed for `faker`-mode mocks, for reproducible data. Ignored in `baked` mode. | | ||
| | `--server-url` | `string` | Override the server URL inlined into the runtime. Defaults to `servers[0].url`. Accepts absolute (`https://api.example.com`) or relative (`/v1`). | | ||
| | `--setup` | `string` | Path to a publisher setup module baked into the client. See [Publisher defaults](../guides/use-generated-client.md#publisher-defaults). | | ||
| | `--config` | `string` | Path to the `redocly.yaml` (the `client` config and `apis:` live there). Defaults to the one in the working directory. | | ||
|
|
||
| ## Configuration | ||
|
vadyvas marked this conversation as resolved.
|
||
|
|
||
| Instead of passing flags every time, keep the settings in `redocly.yaml` under a top-level `client` block and per-API `apis.<name>.client` / `clientOutput`. | ||
| CLI flags take precedence over the configuration. | ||
| A per-API `client` block overrides the top-level `client` field by field; unspecified fields fall back to the top-level defaults. | ||
| See [`client` configuration](../configuration/reference/client.md) for the full reference. | ||
|
|
||
| Auto-pagination has **no CLI flag**: it's declared as structured configuration — [`client.pagination`](../configuration/reference/client.md#pagination) in `redocly.yaml`, or the equivalent `x-pagination` operation extension in the spec — and paginated operations gain typed `.pages()`/`.items()` async iterators. | ||
| See [Pagination in the usage guide](../guides/use-generated-client.md#pagination). | ||
|
|
||
| ## Output modes | ||
|
|
||
| `--output-mode` controls how the client is split across files: | ||
|
|
||
| - `single` (default) — one file (self-contained with the default `inline` runtime). | ||
| - `split` — two files: the schema types and type guards move to a sibling `<name>.schemas.ts`, and the entry file (everything else) re-exports them — so your imports are the same as in `single`. | ||
|
|
||
| `--output` names the entry file; the `.schemas.ts` sibling derives from its name and directory. Both modes work with both [runtimes](#runtime-distribution). | ||
|
|
||
| ## Runtime distribution | ||
|
|
||
| `--runtime` controls where the client's engine (request building, auth, retries, middleware, SSE) lives: | ||
|
|
||
| - `inline` (default) — the same runtime source is embedded in the generated output (only the parts your API needs): self-contained, zero runtime dependencies. | ||
| - `package` — the generated file imports the runtime from `@redocly/client-generator` and contains only the types, pure-data operation descriptors, and thin call wrappers: | ||
|
|
||
| ```ts | ||
| import { | ||
| createClient, | ||
| type OperationDescriptor, | ||
| type RequestOptions, | ||
| } from '@redocly/client-generator'; | ||
|
|
||
| export const OPERATIONS = { | ||
| getOrderById: { | ||
| id: 'getOrderById', | ||
| method: 'GET', | ||
| path: '/orders/{orderId}', | ||
| tags: ['Orders'], | ||
| params: [ | ||
| /* … */ | ||
| ], | ||
| }, | ||
| // … | ||
| } as const satisfies Record<string, OperationDescriptor>; | ||
|
|
||
| export const client = createClient<Ops>(OPERATIONS, { serverUrl: 'https://api.example.com' }); | ||
| export const { configure, use } = client; | ||
| export const getOrderById = (orderId: string, init: RequestOptions = {}) => | ||
| client.getOrderById({ orderId }, init); | ||
| ``` | ||
|
|
||
| Choose `package` when you want engine fixes and improvements to arrive via `npm update @redocly/client-generator` — no regeneration, no diff in the generated file. | ||
| The trade: the consuming app must have `@redocly/client-generator` installed as a regular dependency. | ||
| Your application code is identical in both modes (same exports, same call shapes). | ||
|
|
||
| The `satisfies Record<string, OperationDescriptor>` line doubles as a **build-time version-skew guard**: an incompatible generated-file/runtime pair fails the consumer's `tsc` instead of misbehaving at runtime. | ||
|
|
||
| In both modes the generated module exports **both call styles** — the `client` instance (grouped-args methods) and the free-function operations (`--args-style` shapes those). | ||
| Both runtimes work with both [output modes](#output-modes) and every generator. | ||
|
|
||
| ## Resources | ||
|
|
||
| - [Use the generated client](../guides/use-generated-client.md) — the runtime API and the add-on generators. | ||
| - [`client` configuration](../configuration/reference/client.md) — the `redocly.yaml` `client` block. | ||
| - [Lint command](./lint.md) to validate your API description before generating a client. | ||
| - [Bundle command](./bundle.md) to combine a multi-file description into a single input file. | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this change? The e2e job isn't a required check in the repo's settings, and it would be possible to merge a PR even with the job failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had canceled GH job without any reason. I tried to do deep research, this is a summary:
Tets started failing after we added more tests, there is no specific test impacting this. Only number of tests...
AI made some research:
What I ruled out with live in-job instrumentation (every metric healthy at the moment of cancel): RAM (~14 GB free), disk (~90 GB free), CPU/load, processes (~190), threads (~480), file descriptors (~2 500 of 65 536), sockets/TIME-WAIT, inodes (18 M free), kernel OOM (none). Also ruled out: parallel contention (serial --maxWorkers=1 still cancels, just later), network, log volume, and any single test (all pass locally and individually).
The decisive piece — from the runner's own _diag logs: the job token renews successfully every 60 s and console uploads succeed (1/1) right up to the cancel. So the runner stays healthy and connected; GitHub's service is deliberately cancelling a healthy job. The exact service-side reason isn't observable from inside — when the service cancels, it tears the step down and stops accepting console output, so streamed diag lines can't upload. That last mile needs GitHub support or org runner-group admin visibility