jason810496 opened a new pull request, #73436:
URL: https://github.com/apache/airflow/pull/73436

   # TS SDK: generate Dag and task options from the serialization schema
   
   - **Depends on the PR for `feature/ts-sdk/native-dag-authoring-syntax` 
getting merged first** (only the last commit is new here).
   - **Diff for early review**: 
https://github.com/jason810496/airflow/compare/feature/ts-sdk/native-dag-authoring-syntax...feature/ts-sdk/dag-schema-codegen
   - **next**: `feature/ts-sdk/default-task-id-at-pack-time`
   
   ## Why
   
   `DagSpec` and `TaskSpec` were `Record<string, never>`, so `new Dag("d", { 
schedule: "@daily" })` was a compile error by design. A native Dag has to carry 
the options Python would otherwise own.
   
   ## How
   
   - Generate both from the Dag serialization schema, vendored into 
`ts-sdk/schema/dag-schema.json` and kept in sync with `airflow-core` by a prek 
hook.
   - Task fields are derived: every scalar property of the `operator` 
definition becomes one unless it is serializer-owned or carries a documented 
exclusion, so a new schema key shows up in the regenerated diff instead of 
going missing.
   - Dag fields come from a curated allowlist, matching the Go SDK, because the 
`dag` definition mixes authoring options with bundle bookkeeping.
   
   ## What
   
   - `scripts/generate-dag-schema.mjs` and the committed 
`src/generated/dag-schema-fields.ts`.
   - Two prek hooks: one syncs the vendored schema, one fails when the 
generated file drifts.
   - A test in `airflow-core` pins `SERIALIZATION_VERSION` against 
`DagSerialization.SERIALIZER_VERSION`.
   - `TaskOptions` collapses into `TaskSpec`: with wiring on the factory call, 
the trailing argument is the spec itself.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes, with help of Claude Code Opus 5 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
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]

Reply via email to