Skip to content

Comments

Block unsupported Airflow 3 commands#1822

Merged
jeremybeard merged 3 commits intomainfrom
block-af3-deployment-cmds
Apr 2, 2025
Merged

Block unsupported Airflow 3 commands#1822
jeremybeard merged 3 commits intomainfrom
block-af3-deployment-cmds

Conversation

@jeremybeard
Copy link
Contributor

Description

This change blocks astro deployment commands that are not yet supported for Airflow 3 deployments.

These are the commands that match:

  • astro deployment [create|update|logs]
  • astro deployment [variable|airflow-variable|connection|pool|worker-queue] *

🧪 Functional Testing

  • Unit tested added/updated
  • Manually checked each impacted command against Airflow 2 and Airflow 3 deployments

📸 Screenshots

Screenshot 2025-03-31 at 3 11 38 PM

📋 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

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 a minor question, otherwise LGTM

}

// Check if the provided runtime version is for Airflow 3
if err := airflowversions.ValidateNoAirflow3Support(runtimeVersion); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I haven't tried it, but what if no runtime version is specified in the command? will that cause the command to default to AF 3 version and then get blocked here on day 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right, the user will need to specify the runtime version for the command to work. I've updated the error to help with that:

Screenshot 2025-04-01 at 9 00 31 AM

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, but the runtime version flag is not a required flag, so if users won't pass it, then would our defaulting logic in cmd/cloud/deployment.go pick the AF 3 runtime version from post day 0: https://github.com/astronomer/astro-cli/blob/main/cmd/cloud/deployment.go#L701-L708?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we are defaulting to Airflow 3 across the CLI when that is released. I only set the flag in the screenshot because it isn't released yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

in this case, if a user does not set the flag in their command, the defaulting logic would pick AF 3, and then this piece of code would error out, which isn't ideal since CLI is picking the default for the users. I think we might have to use AF 2 default for deployment create logic, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed offline, agreed that this command should exclude Airflow 3 from the default runtime version, so I've pushed a commit for that.

@jeremybeard jeremybeard enabled auto-merge (squash) April 1, 2025 13:01
@jeremybeard jeremybeard disabled auto-merge April 1, 2025 13:26
@jeremybeard jeremybeard requested a review from lzdanski as a code owner April 1, 2025 16:19
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.

LGTM ❤️

@jeremybeard jeremybeard merged commit 1317e28 into main Apr 2, 2025
3 of 4 checks passed
@jeremybeard jeremybeard deleted the block-af3-deployment-cmds branch April 2, 2025 12:01
neel-astro pushed a commit that referenced this pull request Apr 3, 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