Skip to content
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

fix dag deploy updating on accident #1523

Merged
merged 6 commits into from
Feb 2, 2024
Merged

fix dag deploy updating on accident #1523

merged 6 commits into from
Feb 2, 2024

Conversation

sunkickr
Copy link
Contributor

@sunkickr sunkickr commented Feb 1, 2024

Description

When running the command astro deployment update dag deploy is always turned off. This is because the case for dag deploy not changing didn't exist.

Added an assert to the update test to test for this bug.

Related #XXX

🧪 Functional Testing

List the functional testing steps to confirm this feature or fix.

📸 Screenshots

screenshot of updating the description of both a deployment with dag deploy enabled and disabled. Showing that in both cases dag deploy stays the same:
Screenshot 2024-02-02 at 11 46 31 AM

📋 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

codecov bot commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c82086a) 85.90% compared to head (a0ebd2d) 85.89%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1523      +/-   ##
==========================================
- Coverage   85.90%   85.89%   -0.02%     
==========================================
  Files         112      112              
  Lines       14847    14848       +1     
==========================================
- Hits        12755    12754       -1     
- Misses       1254     1256       +2     
  Partials      838      838              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -69,6 +69,7 @@ var (
tickNum = 10
timeoutNum = 180
dedicatedDeploymentRequest = astroplatformcore.UpdateDedicatedDeploymentRequest{}
dagDeployEnabled bool
Copy link
Contributor

Choose a reason for hiding this comment

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

what was the reasoning behind putting it up here, it seems to fit the style of code the way we had it before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need it exist outside of the function so we can assert that it is the right value in the test

@@ -768,6 +767,10 @@ func Update(deploymentID, name, ws, description, deploymentName, dagDeploy, exec
dagDeployEnabled = false
}

if dagDeploy == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if dagDeploy == "" {
else if dagDeploy == "" {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@kushalmalani
Copy link
Contributor

Can you add some screenshots for this. This bug fix is critical

@@ -1288,6 +1288,7 @@ func TestUpdate(t *testing.T) { //nolint
// success with hybrid type
err := Update("", "", ws, "", "", "", CeleryExecutor, "", "", "", "", "", "", "", 0, 0, workerQueueRequest, hybridQueueList, newEnvironmentVariables, true, mockCoreClient, mockPlatformCoreClient)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a comment up here w.r.t to what are we updating?

Eventually would want to get rid of that huge list of arguments and have defined input type, but we can do that later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added comments

@sunkickr sunkickr merged commit 0d2e17f into main Feb 2, 2024
4 of 5 checks passed
@sunkickr sunkickr deleted the fix-update-dag-deploy branch February 2, 2024 17:31
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.

None yet

3 participants