Skip to content

Refresh airflow_development automatically after merges to main - #315

Merged
noel merged 1 commit into
mainfrom
infra/airflow-dev-auto-refresh
Nov 24, 2026
Merged

noel merged 1 commit into
mainfrom
infra/airflow-dev-auto-refresh

Conversation

@noel

@noel noel commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Keeps airflow_development in sync with main automatically, instead of relying on someone running airflow_dev.py refresh by hand.

orchestrate/utils/airflow_dev.py

.github/workflows/30_deploy_changes_to_production.yml

  • Adds orchestrate/** to the push paths.
  • New changes job: the dbt build job only runs when transform/, automate/ or .github/workflows/ changed (or on a manual run). Pushes that only change orchestrate/ skip the dbt deployment.
  • New refresh_airflow_development job: runs airflow_dev.py refresh after build, so it includes the version-bump commit. It also runs when build is skipped or fails, because main has moved either way. Uses contents: write and a concurrency group so refreshes don't overlap.

Docs

  • docs/airflow_development_branch.md: new "Keeping it up to date" and "When a refresh removes your branch" sections, and updated limitations.
  • Diagram: the refresh card now says it runs in CI after merges to main.

Before merging

  • airflow_development must allow force pushes from GitHub Actions (GITHUB_TOKEN). If branch protection blocks it, the refresh job fails and the branch stays where it was.

Behavior to be aware of

  • A deployed branch that conflicts with the new main (or with a branch deployed before it) is removed from airflow_development; the job still succeeds and shows a warning.
  • Feature branches that are deleted when they merge into a release/* branch are dropped from airflow_development at the next refresh, before the release reaches main. Workaround: add release/<name>.

Test plan

  • is_merged() tested on a throwaway repo (squash-merged branch detected, unmerged branch not) and on the deployed feature/adf-example-dag
  • Workflow YAML parses; script compiles
  • First merge to main after this: confirm the refresh job runs and airflow_dev.py status shows airflow_development on the latest main

🤖 Generated with Claude Code

- airflow_dev.py: detect squash-merged branches as merged (refresh and
  status only checked commit ancestry, which never matches a squash merge),
  and emit GitHub warnings for branches removed by a conflicting rebuild
- 30_ workflow: add orchestrate/ to the triggers, add a changes job so
  orchestrate-only pushes skip the dbt deployment, and add a job that runs
  airflow_dev.py refresh after the deployment
- docs: describe the automatic refresh, what happens on conflicts, and the
  new limitations; update the diagram

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noel
noel merged commit 4c2c81c into main Nov 24, 2026
1 check passed
@noel
noel deleted the infra/airflow-dev-auto-refresh branch November 24, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant