Skip to content

AIP-65: Add DAG versioning support#42913

Merged
ephraimbuddy merged 49 commits intoapache:mainfrom
astronomer:versioned-dag2
Nov 5, 2024
Merged

AIP-65: Add DAG versioning support#42913
ephraimbuddy merged 49 commits intoapache:mainfrom
astronomer:versioned-dag2

Conversation

@ephraimbuddy
Copy link
Copy Markdown
Contributor

@ephraimbuddy ephraimbuddy commented Oct 10, 2024

This commit introduces versioning for DAGs.

Changes:

  • Introduced DagVersion model to handle versioning of DAGs.
  • Added version_name field to DAG for use in tracking the dagversion by users
  • Modified DAG execution logic to reference dag_version_id instead of the dag_hash to ensure DAG runs are linked to specific versions.

The table relations:
Screenshot 2024-10-25 at 09 21 19

The versioning is based on the serialized dict changing. If a dag's serialized dict changes, a new serialized dag will be registered based on the hash diference, and consequently, a new dag version and dag code. The link from dag_version to TI is because of TaskInstance clearing. It helps us retain the previous dag version the task ran with.

Closes: #42333, #42334, #42336

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:CLI area:db-migrations PRs with DB migration area:dev-tools area:Scheduler including HA (high availability) scheduler area:serialization area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues kind:documentation labels Oct 10, 2024
@ephraimbuddy ephraimbuddy force-pushed the versioned-dag2 branch 5 times, most recently from ad4f57c to dd272b0 Compare October 16, 2024 12:27
@ephraimbuddy ephraimbuddy added the legacy api Whether legacy API changes should be allowed in PR label Oct 16, 2024
@ephraimbuddy ephraimbuddy force-pushed the versioned-dag2 branch 3 times, most recently from eb13cdd to 1b81f2f Compare October 16, 2024 13:27
@ephraimbuddy ephraimbuddy marked this pull request as ready for review October 16, 2024 13:27
Copy link
Copy Markdown
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

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

Good enough

@ephraimbuddy ephraimbuddy merged commit 1116f28 into apache:main Nov 5, 2024
@ephraimbuddy ephraimbuddy deleted the versioned-dag2 branch November 5, 2024 14:19
potiuk added a commit that referenced this pull request Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIP-65: DAG history in UI area:API Airflow's REST/HTTP API area:CLI area:db-migrations PRs with DB migration area:dev-tools area:Scheduler including HA (high availability) scheduler area:serialization area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues kind:documentation legacy api Whether legacy API changes should be allowed in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calculate and track DAG version

7 participants