Repository navigation
Drop the Dag inventory from Lang-SDK bundle metadata - #74139
Draft
Conversation
airflow-go-pack no longer runs the bundle binary to read a manifest. The manifest has no Dag inventory, so the packer needs only the SDK block: the supervisor schema version is its own go-sdk's, and the SDK version is read from the binary's build information, which Go keeps in a stripped binary and for any target platform. A binary built against another go-sdk than the packer is refused with both versions in the error, in build mode too, so a flag after -- such as -modfile cannot change the module graph unnoticed. When go-sdk is the main module of both builds, as inside the SDK module, the two are accepted, because Go stamps the main module's version from version control. A cross-built binary packs without a host build, and the --airflow-metadata flag, the Dag and task id checks and the Dag count in the output are gone. A bundle packed earlier, with its dags mapping, still prints with inspect.
Nothing reads the manifest from the bundle binary any more, so the binary speaks only the coordinator protocol. The --airflow-metadata and --format flags, DumpAirflowMetadata and the code that collected the Dag and task ids for them are gone, and the manifest type loses its Dag inventory. A bundle that defines a flag named airflow-metadata or format of its own is no longer refused, since Serve reserves only comm and logs.
airflow-ts-pack still runs the built bundle, for the schema version, the source path of each Dag declared in TypeScript and finalizing those Dags, and it still checks the task handlers the bundle reports: that it serves something, a Dag with no tasks and ids the server would reject. It no longer embeds the handlers in the bundle's metadata, since nothing reads them from the artifact. A bundle packed earlier, with task_handlers in its metadata, still reads, and the golden bundle is kept in both forms for the Python reader.
The airflow-metadata JSON Schema no longer requires or describes a dags mapping, and its description says what the manifest is for now. The executable bundle spec drops the field and its example, says the packer writes the manifest, and says a bundle packed earlier may still carry dags, which consumers ignore. The TypeScript bundle spec shows the fields the encoder writes, entrypoint_path and dag_source_paths, in place of a source field the encoder does not write, and says a task_handlers mapping from an older packer is ignored. The spec version stays 1.0, since an older manifest still validates. A new test validates the manifest without dags, the spec's own example and an older manifest with dags against the schema, and the executable coordinator tests read a bundle with and without the inventory.
The Go page and the Go README describe a packer that never runs the binary: it reads the go-sdk version from the binary's build information, refuses a binary built against another go-sdk version, and packs a binary built for any platform with --executable, so the cross-platform text no longer has the user capture a manifest with --airflow-metadata. The Go, TypeScript and Language SDK pages, the contributor guide for a new Language SDK, the Justfile and the e2e docstring no longer say the manifest holds the Dag and task ids, and the TypeScript README says the packer checks the handlers a bundle reports but does not embed them. go-sdk ADRs 0001 to 0005 get a note that the introspection flag is retired. The TypeScript page and README no longer document a --source pack option, which the CLI rejects.
The Bundle.serve documentation said what is left out of a bundle is not part of it and its tasks are marked removed at runtime. That is true only of a task that still reaches the bundle: a stub task whose handler is left out fails the import of its Python Dag file, since the Dag processor finds no handler for it.
The Consequences now say what the code does. The Go packer runs nothing: it takes the schema version from its own go-sdk and the SDK version from the binary's build information, refuses a binary built against another go-sdk, packs a cross-built binary without a host build, and the bundle binary has no --airflow-metadata flag. The TypeScript packer still runs the bundle but embeds no task_handlers, and dag_source_paths is the one place a Dag id remains in its metadata, for display. A bundle packed earlier may carry dags or task_handlers, which readers ignore, and Java never had an inventory. The status stays Proposed.
jason810496
added this pull request to stack #73978
October 3, 2026 07:56
This was referenced Oct 3, 2026
This was referenced Oct 3, 2026
jason810496
removed this pull request from stack #73978
October 6, 2026 02:27
1 task done
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stack (bottom to top): #73970, #73971, #73972, #73973, #73974, #73975, #73976, #73977, #74030, #74031, #74032, #74033, #74067, #74135, #74136, #74137, #74138, #74139, #74140, #74141
Why
Nothing reads the Dag and task ids that a bundle's metadata lists any more. The Dag processor asks the artifact which task handlers it registers, and the worker runs the file a stub task is bound to (ADR-0014). This PR removes the inventory and what existed only to produce it: the Go packer no longer runs the bundle binary with
--airflow-metadata, and the TypeScript packer no longer embeds the handlers it checks. Spec version1.0stays, since older manifests still validate.What changes
The Go packer never runs the binary it packs, so a binary built for any platform packs on any host, with no manifest to capture first:
The manifest it writes has no
dagsmapping, and the packer refuses a binary built against another go-sdk than its own:supervisor_schema_versioncomes from the packer's own go-sdk, and the SDK version from the binary's build information, which Go keeps in a stripped binary and for any target platform. The two go-sdk builds are accepted without a comparison when go-sdk is the main module of both, as inside the SDK module, because Go stamps the main module's version from version control. Otherwise the version and the replacement must be equal, in build mode too, so a flag after--such as-modfilecannot change the module graph unnoticed. A binary that does not link go-sdk is refused. The code that ran the binary and decoded its output, the host build for--goosand--goarch, the Dag and task id warnings, the--airflow-metadataflag and the Dag count in the output line are gone.--airflow-metadata,--formatandDumpAirflowMetadataare removed, so the binary speaks only the coordinator protocol.--command--logsare the only namesServereserves, so a bundle may define flags namedairflow-metadataorformatof its own. The manifest type loses its Dag inventory.airflow-ts-packstill runs the bundle with--airflow-metadata, for the schema version, the source file of each Dag declared in TypeScript and finalizing those Dags. It still checks the handlers the bundle reports (it serves something, a Dag with no tasks, ids the server would reject) but no longer embeds them: the metadata line hasairflow_bundle_metadata_version,sdk,entrypoint_pathanddag_source_paths.airflow-metadata.schema.jsonno longer requires or describesdags. The executable bundle spec drops the field and its example, says the packer writes the manifest, and says consumers ignore adagsmapping from an older packer. The TypeScript spec shows the fields the encoder writes in place of asourcefield it does not write, and says an oldertask_handlersmapping is ignored.dags(Go) ortask_handlers(TypeScript), and every reader accepts it. The TypeScript golden bundle is kept in both forms for the Python reader.--airflow-metadatais retired. ADR-0014 keeps the status Proposed and its Consequences describe what the code does. TheBundle.servedocumentation says a stub task whose handler is left out fails the import of its Python Dag file, and a task that still reaches the bundle without its handler is marked removed.--sourcepack option that the CLI rejects withUnknown option --source, and the metadata sample of the TypeScript spec showed asourcefield the encoder does not write. Both are corrected. The spec's container, layout header, source section and reader steps still describe a single source region, which ADR-0015 replaced with one region per Dag file. That is left to a follow-up.What the next PRs can rely on
Wrote bundle <path> (sdk=go/<version>), andgo tool airflow-go-pack inspect <bundle>prints a manifest withoutdags. Packing in a module that replaces go-sdk with a local path, such askubernetes-tests/lang_sdk/go_example, records the version(devel).//# airflowMetadata=line has notask_handlers.airflow-ts-packstill runs the bundle and prints its pack-time warnings to stderr.How to test
Ran:
go vetandgo test ./...ingo-sdk: 13 packages pass, 32 tests in the packer's package. They include a real two-module test: a module that replaces go-sdk with a local path packs with its owngo tooland is accepted, a binary built against another go-sdk version is refused with both versions in the error, so is a binary built inside go-sdk when the packer replaces it, and so is a build with-modfilepointing at another go.mod. With an empty Go build cache the packer's package tests take 9 seconds.ts-sdk:pnpm install --frozen-lockfile, typecheck, lint, format check and build pass, andpnpm testpasses 611 tests.coordinators/: 314 passed. airflow-coredag_processing/: 798 passed, 19 skipped (10 real probe tests, which needAIRFLOW_LANG_SDK_REAL_PROBE_TESTS=1, and 9 that need FabAuthManager, a system test module or a Postgres or MySQL backend).task_handlers.kubernetes-tests/lang_sdk/go_examplepacks withgo tool airflow-go-pack, also with--goos linux --goarch amd64, andinspectshows nodags. The packed bundle exits withunknown flag: --airflow-metadatawhen run with the removed flag.check-go-example-mod-tidy,check-go-sdk-generated-driftandgenerate-supervisor-schemas-snapshotpass and change nothing.prek run --from-ref <parent> --stage pre-commitpassed.mypy-airflow-core,mypy-task-sdkandmypy-airflow-e2e-testspassed with--all-files.dagsand the TypeScript metadata has notask_handlers.The tests of each behavior change fail without it, checked by reverting the code of its commit: 13 of the Go packer's 32 tests fail against the old packer (one of them with its 4 subtests, and the 3 version tests do not compile without the new check), the 3 bundle binary flag tests fail against the old flags, the 6 TypeScript encoder and pack tests and the Python fixture test fail against the old encoder, and the 4 schema tests fail against the old schema and spec. The tests that read an older bundle, with
dagsortask_handlersin its manifest (inspect, the executable and Node coordinators, the Node bundle reader), pass before and after: they guard what the PR keeps.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5.5) following the guidelines