Skip to content

[v3-3-test] Add API endpoint for backfill dag run entries - #70127

Merged
pierrejeambrun merged 1 commit into
apache:v3-3-testfrom
astronomer:backport-67381
Jul 20, 2026
Merged

[v3-3-test] Add API endpoint for backfill dag run entries#70127
pierrejeambrun merged 1 commit into
apache:v3-3-testfrom
astronomer:backport-67381

Conversation

@pierrejeambrun

Copy link
Copy Markdown
Member

Backport of #67381 to v3-3-test.

Cherry-picked from 6f88f29.

One conflict, in the generated ui/openapi-gen/requests/services.gen.ts import type { ... } line: main had added the new ListBackfillDagRuns* imports alongside other symbols (GetDagRunStateCountsUi*, GetCalendarDeadlines*) that do not exist on v3-3-test. Resolved by keeping the v3-3-test import list and adding only ListBackfillDagRunsData / ListBackfillDagRunsResponse (the endpoint's own types, which types.gen.ts exports here), dropping the unrelated main-only symbols. All other generated files auto-merged.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

* Add GET /backfills/{backfill_id}/dag_runs endpoint

Adds a new public API endpoint that returns the BackfillDagRun entries
for a given backfill with joined DagRun state. Users can see what
happened in a backfill: which dates ran, their states (queued, running,
success, failed), and which slots were skipped (with reason).

- BackfillDagRunResponse / BackfillDagRunCollectionResponse models
- LEFT OUTER JOIN via joinedload includes skipped slots (null dag_run_id)
- Pagination via limit/offset, default ordering by sort_ordinal
- 404 when backfill doesn't exist
- 8 unit tests covering happy path, skipped slots, 404, pagination,
  empty backfill, and ordering contract

closes: apache#46250

* Align backfill dag run response identifiers
(cherry picked from commit 6f88f29)
@boring-cyborg boring-cyborg Bot added area:airflow-ctl area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Jul 20, 2026
@pierrejeambrun
pierrejeambrun merged commit 2b68a62 into apache:v3-3-test Jul 20, 2026
116 checks passed
@pierrejeambrun
pierrejeambrun deleted the backport-67381 branch July 20, 2026 14:42
@github-actions github-actions Bot added this to the Airflow 3.3.1 milestone Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.3.1 based on: merged to version branch
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

@vatsrahul1001 vatsrahul1001 added the type:new-feature Changelog: New Features label Jul 27, 2026
@vatsrahul1001

Copy link
Copy Markdown
Contributor

Moving milestone to 3.4.0 as its more suitable for minor as its a new feature

bbovenzi pushed a commit that referenced this pull request Aug 3, 2026
vatsrahul1001 added a commit that referenced this pull request Aug 4, 2026
The #70127/#69719 reverts (now on v3-3-test) removed BackfillDagRunResponse,
BackfillDagRunCollectionResponse and bundle_version from the API spec. Regenerated
generated.py from the current spec with datamodel-code-generator>=0.71.0 so it reflects
the reverts in the new-tool format. mypy airflow-ctl clean; no tests reference the removed models.
vatsrahul1001 added a commit that referenced this pull request Aug 4, 2026
…toolchain (#70670) (#70976)

* Raise the datamodel-code-generator floor for the codegen toolchain (#70670)

(cherry picked from commit b301429)

Manual backport: datamodel-code-generator floor bumped 0.33.0 -> >=0.71.0 and
models REGENERATED against v3-3-test's own spec (not copied from main). Test
constructions in test_operations.py updated for the now-required nullable fields.
test_task_command.py is main-only; main's divergent test_operations.py tail
(ctl task-instance ops not on this branch) intentionally not backported.

* Fix ConnectionResponse construction to use schema alias in airflow-ctl test

The regenerated model exposes the field as `schema_` with `Field(alias="schema")`
and no `populate_by_name`, so pydantic requires the alias `schema=` at construction.
Matches main's fix (#70670): construct with `schema=` plus `# type: ignore[call-arg]`.

* Serialize connection mock responses by alias in airflow-ctl tests

ConnectionResponse.schema_ has Field(alias=schema) and no populate_by_name, so the
source validates responses by the schema alias. The mock handlers dumped the model
by field name, breaking the round-trip. Dump connection_response / connections_response
mocks with by_alias=True (matches main #70670).

* Regenerate airflow-ctl datamodels after merging v3-3-test

The #70127/#69719 reverts (now on v3-3-test) removed BackfillDagRunResponse,
BackfillDagRunCollectionResponse and bundle_version from the API spec. Regenerated
generated.py from the current spec with datamodel-code-generator>=0.71.0 so it reflects
the reverts in the new-tool format. mypy airflow-ctl clean; no tests reference the removed models.
@vatsrahul1001 vatsrahul1001 removed this from the Airflow 3.4.0 milestone Aug 4, 2026
vatsrahul1001 pushed a commit that referenced this pull request Aug 5, 2026
* Add GET /backfills/{backfill_id}/dag_runs endpoint

Adds a new public API endpoint that returns the BackfillDagRun entries
for a given backfill with joined DagRun state. Users can see what
happened in a backfill: which dates ran, their states (queued, running,
success, failed), and which slots were skipped (with reason).

- BackfillDagRunResponse / BackfillDagRunCollectionResponse models
- LEFT OUTER JOIN via joinedload includes skipped slots (null dag_run_id)
- Pagination via limit/offset, default ordering by sort_ordinal
- 404 when backfill doesn't exist
- 8 unit tests covering happy path, skipped slots, 404, pagination,
  empty backfill, and ordering contract

closes: #46250

* Align backfill dag run response identifiers
(cherry picked from commit 6f88f29)

Co-authored-by: Shivam Rastogi <6463385+shivaam@users.noreply.github.com>
vatsrahul1001 added a commit that referenced this pull request Aug 5, 2026
vatsrahul1001 added a commit that referenced this pull request Aug 5, 2026
…toolchain (#70670) (#70976)

* Raise the datamodel-code-generator floor for the codegen toolchain (#70670)

(cherry picked from commit b301429)

Manual backport: datamodel-code-generator floor bumped 0.33.0 -> >=0.71.0 and
models REGENERATED against v3-3-test's own spec (not copied from main). Test
constructions in test_operations.py updated for the now-required nullable fields.
test_task_command.py is main-only; main's divergent test_operations.py tail
(ctl task-instance ops not on this branch) intentionally not backported.

* Fix ConnectionResponse construction to use schema alias in airflow-ctl test

The regenerated model exposes the field as `schema_` with `Field(alias="schema")`
and no `populate_by_name`, so pydantic requires the alias `schema=` at construction.
Matches main's fix (#70670): construct with `schema=` plus `# type: ignore[call-arg]`.

* Serialize connection mock responses by alias in airflow-ctl tests

ConnectionResponse.schema_ has Field(alias=schema) and no populate_by_name, so the
source validates responses by the schema alias. The mock handlers dumped the model
by field name, breaking the round-trip. Dump connection_response / connections_response
mocks with by_alias=True (matches main #70670).

* Regenerate airflow-ctl datamodels after merging v3-3-test

The #70127/#69719 reverts (now on v3-3-test) removed BackfillDagRunResponse,
BackfillDagRunCollectionResponse and bundle_version from the API spec. Regenerated
generated.py from the current spec with datamodel-code-generator>=0.71.0 so it reflects
the reverts in the new-tool format. mypy airflow-ctl clean; no tests reference the removed models.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:airflow-ctl area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. type:new-feature Changelog: New Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants