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

update get deployment query #1365

Merged
merged 21 commits into from
Aug 25, 2023
Merged

update get deployment query #1365

merged 21 commits into from
Aug 25, 2023

Conversation

Simpcyclassy
Copy link
Member

@Simpcyclassy Simpcyclassy commented Aug 23, 2023

Description

The GetDeployment query has been updated with some breaking changes on houston.

This PR changes

  • The where argument from id to deploymentId
  • Gets the first item in the deployment query return

🎟 Issue(s)

Related #astronomer/issues/issues/5763

🧪 Functional Testing

unit testing

📸 Screenshots

Add screenshots to illustrate the validity of these changes.

Only supported on
0.30 : 0.30.8 and upwards
0.32: 0.32.3 and upwards

And 0.33.1 and upwards

@Simpcyclassy Simpcyclassy marked this pull request as draft August 23, 2023 18:20
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 comment as of now to simplify the logic. Also would love to see some screenshots of the new query working fine with both active Software versions.

@@ -551,7 +573,7 @@ func (h ClientImplementation) GetDeployment(deploymentID string) (*Deployment, e
return nil, handleAPIErr(err)
}

return &res.Data.GetDeployment, nil
return res.Data.GetDeployment, 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: Do we expect more than one deployment to be returned by Houston for a query by id? If not, then I would say it might be simpler to check the length of the response and return just the first element, that way function signature would remain the same and we won't require any further changes in the caller functions.

Or if we go by what's currently implemented then in all caller functions instead of directly fetching the first element, we would still need to add check on the length of the array first.

if len(res.Data.GetDeployment) > 0 {
        return &res.Data.GetDeployment[0], nil
}
return nil, fmt.Errorf("deployment with id %s not found", deploymentID)

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% 🎉

Comparison is base (4572a01) 86.89% compared to head (788cb7a) 86.91%.

❗ Current head 788cb7a differs from pull request most recent head c6a428c. Consider uploading reports for the commit c6a428c to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1365      +/-   ##
==========================================
+ Coverage   86.89%   86.91%   +0.01%     
==========================================
  Files         114      114              
  Lines       13882    13902      +20     
==========================================
+ Hits        12063    12083      +20     
  Misses       1085     1085              
  Partials      734      734              
Files Changed Coverage Δ
houston/types.go 85.71% <ø> (ø)
houston/deployment.go 94.87% <100.00%> (+1.05%) ⬆️

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

@Simpcyclassy Simpcyclassy marked this pull request as ready for review August 24, 2023 16:01
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

@rishkarajgi rishkarajgi merged commit 4fa1191 into main Aug 25, 2023
@rishkarajgi rishkarajgi deleted the update-get-deployment-query branch August 25, 2023 11:34
Simpcyclassy added a commit that referenced this pull request Aug 29, 2023
neel-astro pushed a commit that referenced this pull request Aug 29, 2023
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.

3 participants