schizophrenicmaniac opened a new pull request, #74068:
URL: https://github.com/apache/airflow/pull/74068
`pnpm codegen` in the Edge UI has been broken since
`@7nohe/openapi-react-query-codegen` 2.x stopped accepting `-c axios`, so
`openapi-gen` was last generated with 1.6.2. It is missing everything added to
`v2-edge-generated.yaml` since then (`version_data`, `ExecuteCallback`,
`TestConnection`, ...).
This switches the codegen script to `-c @hey-api/client-axios`, the same as
the simple auth manager UI, and regenerates `openapi-gen`. It also bumps the
codegen package to 3.0.2, again matching the simple auth manager. 2.2.0 types
the generated `useFetch_` hook as `Options<unknown>`, which doesn't type check.
Dependabot skips major bumps for this UI, so it wouldn't get there on its own.
The new client drops the `UiService` prefix from the hooks and takes `{
path, query, body }` instead of flat camelCase params, so the call sites are
updated. `main.tsx` and `NavTabs.tsx` now set and read the base URL through
`client`, and `ErrorAlert` reads the `AxiosError` response instead of
`ApiError.body`. The generated hooks pass `throwOnError: true`, so failed
requests still reach react-query, and the bulk actions' `Promise.allSettled`
sees them as rejections like before.
`ts_compile_lint_edge.py` now runs `pnpm codegen` when
`v2-edge-generated.yaml` changes. Before, it looked for `/openapi/` in the
path, which never matches the edge spec.
I checked this locally:
- `pnpm codegen` is reproducible.
- `pnpm test` and `pnpm build` pass.
- `tsc --p tsconfig.app.json --ignoreDeprecations 6.0` only reports the
existing `InputGroup.tsx` spread error.
I couldn't run eslint: it currently fails to start in this UI on main,
because the `ajv` override leaves `ajv/lib/refs/json-schema-draft-04.json`
missing. I haven't tried it against a running API server. No visual change is
intended.
closes: #74062
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR,
please
change below checkbox to `[X]` followed by the name of the tool, uncomment
the "Generated-by".
-->
- [ ] Yes (please specify the tool below)
<!--
-->
---
* Read the **[Pull Request
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
for more information. Note: commit author/co-author name and email in commits
become permanently public when merged.
* For fundamental code changes, an Airflow Improvement Proposal
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
is needed.
* When adding dependency, check compliance with the [ASF 3rd Party License
Policy](https://www.apache.org/legal/resolved.html#category-x).
* For significant user-facing changes create newsfragment:
`{pr_number}.significant.rst`, in
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
You can add this file in a follow-up commit after the PR is created so you
know the PR number.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]