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

   # TS SDK: reject a Dag whose order-only edges form a cycle
   
   - **Depends on the PR for `feature/ts-sdk/task-groups` getting merged 
first** (only the last commit is new here).
   - **Diff for early review**: 
https://github.com/jason810496/airflow/compare/feature/ts-sdk/task-groups...feature/ts-sdk/dag-cycle-detection
   - **next**: `feature/ts-sdk/serialize-native-dag`
   
   ## Why
   
   A cycle through wiring is unrepresentable, but `before` and `after` join two 
references that already exist, so they can form one.
   
   ## How
   
   - Search the combined graph. A cycle can run through one wired edge and one 
order-only edge, so searching either alone would miss it.
   - A group endpoint stands for every task the group holds, nested groups 
included.
   - Iterative depth-first rather than recursive: a generated Dag file can 
reach a few thousand chained tasks, which would overflow the stack.
   
   ## What
   
   - `src/sdk/cycle.ts`, returning the tasks on the cycle so the error names 
them.
   - The check runs when the Dag is read, after the every-task-is-called check 
so the simpler fault is reported first.
   
   ---
   
   ##### 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