Skip to content

Validate Dag and task IDs in the ts-sdk task registry - #69400

Merged
guan404ming merged 2 commits into
apache:mainfrom
guan404ming:ts-chore
Jul 10, 2026
Merged

Validate Dag and task IDs in the ts-sdk task registry#69400
guan404ming merged 2 commits into
apache:mainfrom
guan404ming:ts-chore

Conversation

@guan404ming

@guan404mingguan404ming commented Jul 5, 2026

Copy link
Copy Markdown
Member

Why

The ts-sdk task registry only rejected empty IDs, so a dagId/taskId containing characters that a Python dag_id/task_id can never hold (whitespace, /, @, ...) was accepted at registration but could never match a real task at runtime, leaving a silently dead handler.

How

  • Validate dagId/taskId at registration against the Python task-SDK KEY_REGEX (Unicode word characters, dashes, dots) so invalid IDs fail fast.
  • Cover empty, whitespace-only, invalid-character, and valid Unicode IDs in tests.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
    Claude Code with Opus 4.8

  • Read the 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) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@guan404mingguan404ming changed the title Reject whitespace-only Dag and task IDs in the ts-sdk task registryValidate Dag and task IDs in the ts-sdk task registryJul 5, 2026
@guan404ming
guan404mingforce-pushed the ts-chore branch 2 times, most recently from d3869bd to 97db89fCompareJuly 5, 2026 05:14
@guan404ming
guan404ming marked this pull request as ready for review July 5, 2026 06:38

@jason810496jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

Comment threadts-sdk/src/sdk/registry.ts Outdated
@guan404ming

guan404ming commented Jul 10, 2026

Copy link
Copy Markdown
MemberAuthor

I'm going to merge this. Feel free to open issue/pr to refine this, thanks!

@guan404ming
guan404ming merged commit 5ac8c33 into apache:mainJul 10, 2026
65 checks passed
joshuabvarghese pushed a commit to joshuabvarghese/airflow that referenced this pull request Jul 16, 2026
* Validate Dag and task IDs in the ts-sdk task registry
* Validate Dag and task ID length in the ts-sdk task registry
@jason810496jason810496 moved this to Done in TS-SDKJul 20, 2026
@jason810496jason810496 added this to the TS SDK 1.0 Beta milestone Jul 20, 2026
Andrushika added a commit to Andrushika/airflow that referenced this pull request Aug 19, 2026
The throwing check from apache#69400, moved to manifest build time by
apache#71144, still fails packing outright when the client-side ID rules
drift from the server. Follow the direction settled in apache#69965: warn
at build time, let the server validate authoritatively.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants

@guan404ming@jason810496