Skip to content

feat: update promotion scripts to accommodate Airflow v1 and v2 (for Airflow 3 upgrade) - #454

Open
botanical wants to merge 36 commits into
mainfrom
feat/airflow3-flag
Open

botanical wants to merge 36 commits into
mainfrom
feat/airflow3-flag

Conversation

@botanical

@botanical botanical commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

https://github.com/NASA-IMPACT/veda-architecture/issues/849

What Changed

  • I added scripts/airflow_api.py that triggers that DAGs according to the version it identifies based on env var settings
  • I updated the promotion scripts so that it would check the Airflow versions on Staging and Production (defaulting to use v2/ Airflow 3)
  • Notably, this refactor handles both Airflow 2 and Airflow 3 and allows staging and prod instances to be on different versions are we're staggering our rollout

@botanical
botanical requested a review from smohiudd as a code owner September 11, 2026 22:03

@anayeaye anayeaye left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These changes look good--was the main update just to the airflow base url?

Comment thread scripts/airflow_api.py Outdated
Comment thread scripts/promote_collection.py
Comment thread scripts/promote_collection.py Outdated
Comment thread scripts/airflow_api.py
Comment thread scripts/airflow_api.py Outdated
Comment thread scripts/promote_dataset.py Outdated
@botanical
botanical requested a review from a team September 18, 2026 21:16
else
echo "$collection_id failed to publish ❌"
exit 1
fi

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can delete this file once this PR is reviewed!

Comment thread scripts/promote_collection.py Outdated
Comment thread scripts/promote_dataset.py Outdated
Comment thread scripts/promote_dataset.py Outdated
Comment thread scripts/promote_dataset.py Outdated
Comment on lines +96 to +97
status_code = _extract_http_status_code(str(e))
print(json.dumps({"statusCode": status_code, "error": str(e)}))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should this raise?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't want it to raise necessarily because I don't want it to prematurely abort before it reports on the results of the files

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe I'm confused then, should we catching a different exception? AirflowAPIError reads as if the trigger_dag_run request failed and the dag never started

@jjfrench
jjfrench requested a review from a team September 21, 2026 21:30
Comment thread docs/README.md Outdated
Comment thread docs/README.md Outdated
Comment thread docs/README.md
@jjfrench
jjfrench requested a review from a team September 22, 2026 14:38
Comment thread docs/README.md Outdated
Comment thread scripts/airflow_api.py
botanical and others added 2 commits September 22, 2026 10:09
Co-authored-by: Jamison French <50224594+jjfrench@users.noreply.github.com>
Comment thread docs/README.md

@anayeaye anayeaye left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, I just realized that we have one more task to handle new dataset/collection publication and it looks like the existing promote_ scripts could be generalized as publish_ scripts to support both publication and promotion.

I approve of these changes if we want to make a second PR to handle both new dataset and collection publication and promotion

@anayeaye

Copy link
Copy Markdown
Contributor

EDIT: I see that we are already using the promote_ scripts for new dataset publication. The language is confusing but if the functionality is working I guess we are OK. Maybe eventually we can touch up the readme to clarify that in this context promote does not only mean promote from staging to prod it also just means publish. Regardless, I am glad we don't have another PR to open :)

This branch was successfully deployed

1 active (outdated) deployment
staging — 5087977e Deployed Sep 22, 2026 by botanical via test-promotion-script #27
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.

5 participants