-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add --description flag to astro deploy command #1713
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left minor suggestion and question
@@ -170,6 +170,10 @@ func buildPushDockerImage(houstonClient houston.ClientInterface, c *config.Conte | |||
|
|||
imageHandler := imageHandlerInit(imageName) | |||
|
|||
if description != "" { | |||
deployLabels = append(deployLabels, "io.astronomer.deploy.revision.description="+description) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: silly question, how does this description pop up in the UI when it's a DAG-only deploy because CLI is only setting it on the image, and I am not sure we do an image deploy when the --dags
flag is passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, should we extend this flag to --dag-only command too? @Simpcyclassy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a silly question at all. That is what this PR #1716 is for. It would send the description to dag server which creates a revision on houston
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we looking to release both the changes together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we setting io.astronomer.deploy.revision.description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we are setting the description through the api request in the image
@@ -170,6 +170,10 @@ func buildPushDockerImage(houstonClient houston.ClientInterface, c *config.Conte | |||
|
|||
imageHandler := imageHandlerInit(imageName) | |||
|
|||
if description != "" { | |||
deployLabels = append(deployLabels, "io.astronomer.deploy.revision.description="+description) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, should we extend this flag to --dag-only command too? @Simpcyclassy
Changes addressed @neel-astro @rujhan-arora-astronomer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a second pass, left some minor comments to squash, LGTM otherwise :)
cmd/software/deploy.go
Outdated
@@ -104,8 +106,12 @@ func deployAirflow(cmd *cobra.Command, args []string) error { | |||
if isDagOnlyDeploy { | |||
return DagsOnlyDeploy(houstonClient, appConfig, ws, deploymentID, config.WorkingPath, nil, true) | |||
} | |||
|
|||
if description == "" { | |||
description = utils.GetDefaultDeployDescription(cmd, args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description = utils.GetDefaultDeployDescription(cmd, args) | |
description = utils.GetDefaultDeployDescription(isDagOnlyDeploy) |
nit: we could simply send the isDagOnlyDeploy
instead of re-parsing/reading the value for the dags
flag. Then in the GetDefaultDeployDescription
function check if isDagOnlyDeploy != nil && *isDagOnlyDeploy == true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also simply do if isDagOnlyDeploy
right?
@@ -170,6 +170,10 @@ func buildPushDockerImage(houstonClient houston.ClientInterface, c *config.Conte | |||
|
|||
imageHandler := imageHandlerInit(imageName) | |||
|
|||
if description != "" { | |||
deployLabels = append(deployLabels, "io.astronomer.deploy.revision.description="+description) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we looking to release both the changes together?
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Description
This PR introduces functionality to support custom deployment revision descriptions during the
astro deploy
CLI command. It adds a mechanism to capture and assign meaningful descriptions for deployment revisions, enhancing traceability and clarity in the deployment process.Changes Implemented:
Description Flag Handling:
--description
flag to theastro deploy
command, allowing users to specify a custom description for the deployment revision.GetDefaultDeployDescription
method, which dynamically assigns a description based on the deploy command used (e.g., DAGs-only -astro deploy --dags
OR full image deploy -astro deploy
).Label Integration:
io.astronomer.deploy.revision.description
) to thedeployLabels
slice, allowing the deployment system to track the description as part of the Docker image metadata.Benefits:
Improved Traceability:
Default Descriptions:
Example Usage:
Custom Description:
Result:
Fix issue with triggerer pods
DAGs-Only Deploy (Default Description):
Result:
Deployed via <astro deploy --dags>
Why This Change?
This update allows developers and deployment teams to provide additional context for each deployment revision, helping them better manage, track, and audit their deployment histories. By introducing both custom and default descriptions, it provides a flexible and structured way to document the purpose of each deployment.
🎟 Issue(s)
Related astronomer/issues#6437
🧪 Functional Testing
📸 Screenshots
📋 Checklist
make test
before taking out of draftmake lint
before taking out of draft