Skip to content

Comments

Deprecate --force-upgrade-to-af3#1963

Merged
neel-astro merged 5 commits intomainfrom
deprecate_force-upgrade-to-af3
Oct 19, 2025
Merged

Deprecate --force-upgrade-to-af3#1963
neel-astro merged 5 commits intomainfrom
deprecate_force-upgrade-to-af3

Conversation

@bmanan7
Copy link
Contributor

@bmanan7 bmanan7 commented Oct 17, 2025

Description

Allow Airflow 2 --> 3 upgrades without requiring --force-upgrade-to-af3. The flag now logs a deprecation warning when used, and the relevant runtime-version checks/tests were updated accordingly.

🎟 Issue(s)

Related #34813

🧪 Functional Testing

  • . Build and run astro deploy against an AF2 (≥12.0.0) deployment to confirm AF3 upgrade succeeds with and without the flag.
 Users/manan.bhatt/all_repos/astro-cli/astro deploy cmeuqsvkb0XX             
Authenticated to Astro 

Building image...
✔ Project image has been updated
Testing image...
Checking your DAGs for errors…
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
5a6ac5b9f7145e9c895e2e148c3cf15b5760846f0f22a6c59bc6223b04337206
Successfully copied 7.17kB to astro-pytest:/usr/local/airflow/
Successfully copied 8.7kB to astro-pytest:/usr/local/airflow/
Astro Runtime Version: 3.1-2
============================= test session starts ==============================
platform linux -- Python 3.12.11, pytest-8.4.2, pluggy-1.6.0
rootdir: /
configfile: pyproject.toml
plugins: anyio-4.11.0
collected 1 item

.astro/test_dag_integrity_default.py .                                   [100%]

=============================== warnings summary ===============================
../lib/python3.12/site-packages/_pytest/cacheprovider.py:475
  /usr/local/lib/python3.12/site-packages/_pytest/cacheprovider.py:475: PytestCacheWarning: could not create cache path /.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/pytest-cache-files-egspygl7'
    config.cache.set("cache/nodeids", sorted(self.cached_nodeids))
.
.
aca836066730: Pushed 
deploy-2025-10-19T05-57-54: digest: sha256:da9ba4297497095b26615080e7d963453b6ecc63ae23850bf1756dffa542d226 size: 7400
Deployed DAG bundle:  2025-10-19T06:00:42.5264524Z
Deployed Image Tag:  deploy-2025-10-19T05-57-54
Successfully pushed image to Astronomer registry. Navigate to the Astronomer UI for confirmation that your deploy was successful. To deploy dags only run astro deploy --dags.

 Access your Deployment:

 Deployment View: https://cloud.astronomer.io/clilt7vco00aXXX/deployments/cmeuqsvkb0lpbXXX
 Airflow UI: https://org-astronomer-cre.astronomer.run/dhhr8nd2?orgId=org_oIfBdEu4XXX


With flag:

/Users/manan.bhatt/all_repos/astro-cli/astro deploy cmeuqsvkbXXX --force-upgrade-to-af3 
Flag --force-upgrade-to-af3 has been deprecated, This flag is no longer required for Airflow 2 to Airflow 3 upgrades. Support will be removed in a future release.
Authenticated to Astro 

Building image...
✔ Project image has been updated
Testing image...
Checking your DAGs for errors…
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
56c337aaa06f9bb82d19304f9f2632f12534659daa4a61672f9afd0a17560af3
Successfully copied 7.17kB to astro-pytest:/usr/local/airflow/
Successfully copied 8.7kB to astro-pytest:/usr/local/airflow/
Astro Runtime Version: 3.1-2
.
.
.
a836066730: Layer already exists 
deploy-2025-10-19T06-06-33: digest: sha256:da9ba4297497095b26615080e7d963453b6ecc63ae23850bf1756dffa542d226 size: 7400
Deployed DAG bundle:  2025-10-19T06:08:05.0865624Z
Deployed Image Tag:  deploy-2025-10-19T06-06-33
Successfully pushed image to Astronomer registry. Navigate to the Astronomer UI for confirmation that your deploy was successful. To deploy dags only run astro deploy --dags.

 Access your Deployment:

 Deployment View: https://cloud.astronomer.io/clilt7vco00a6XXXX/deployments/cmeuqsvkb0lpb01XXXX
 Airflow UI: https://org-astronomer-cre.astronomer.run/dhhr8nd2
  • Verified CLI prints the deprecation warning when the flag is supplied and only allows Astro Runtime >=12.0.0.
 /Users/manan.bhatt/all_repos/astro-cli/astro deploy cmdfbpp97XX --force-upgrade-to-af3
Flag --force-upgrade-to-af3 has been deprecated, This flag is no longer required for Airflow 2 to Airflow 3 upgrades. Support will be removed in a future release.
Authenticated to Astro 

Building image...
✔ Project image has been updated
Can only upgrade deployment from Airflow 2 to Airflow 3 with deployment at Astro Runtime 12.0.0 or higher
Canceling deploy...

  • make test output:
[make_test.txt](https://github.com/user-attachments/files/22988935/make_test.txt)

📸 Screenshots

Add screenshots to illustrate the validity of these changes.

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • [] Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

@bmanan7 bmanan7 marked this pull request as ready for review October 17, 2025 15:49
Copy link
Contributor

@neel-astro neel-astro left a comment

Choose a reason for hiding this comment

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

left minor nits around messaging/cleanup, but otherwise changes LGTM

Comment on lines 793 to 794
if forceUpgradeToAF3 {
fmt.Println("Warning: --force-upgrade-to-af3 is deprecated and no longer required. Support will be removed in a future release.")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we can drop this, since we have marked the flag as deprecated, and that standard warning message would show up whenever users try to use the flag.

Copy link
Contributor

Choose a reason for hiding this comment

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

This also means that we can drop the argument forceUpgradeToAF3 from all these methods till cmd/cloud/deploy.go upstream

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the code to address this and revalidated the changes. Updated the functional test case in the PR description.

@neel-astro neel-astro merged commit 4622469 into main Oct 19, 2025
5 of 6 checks passed
@neel-astro neel-astro deleted the deprecate_force-upgrade-to-af3 branch October 19, 2025 07:47
@bmanan7 bmanan7 self-assigned this Oct 23, 2025
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.

2 participants