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

chore: updating getCanaryConfigId to be more efficient with better error handling #3070

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

zhaque44
Copy link
Contributor

@zhaque44 zhaque44 commented Oct 2, 2023

Updating getCanaryConfigId func:

Error Handling: It now handles errors more cleanly.

Resource Management: It closes the HTTP response body to prevent resource leaks.

Last but not least it simplifies things by reducing nesting and using the defer statement for cleanup.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional with a list of types and scopes found here, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed my commits with DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

@sonarcloud
Copy link

sonarcloud bot commented Oct 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2023

Go Published Test Results

2 045 tests   2 045 ✔️  2m 40s ⏱️
   118 suites         0 💤
       1 files           0

Results for commit 30b0a06.

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (5ac4a48) 81.74% compared to head (30b0a06) 81.73%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3070      +/-   ##
==========================================
- Coverage   81.74%   81.73%   -0.01%     
==========================================
  Files         134      134              
  Lines       20398    20394       -4     
==========================================
- Hits        16674    16670       -4     
  Misses       2866     2866              
  Partials      858      858              
Files Coverage Δ
metricproviders/kayenta/kayenta.go 84.07% <66.66%> (-0.40%) ⬇️

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2023

E2E Tests Published Test Results

    4 files      4 suites   3h 40m 22s ⏱️
102 tests   86 ✔️   6 💤 10
420 runs  384 ✔️ 24 💤 12

For more details on these failures, see this check.

Results for commit 30b0a06.

@zhaque44
Copy link
Contributor Author

zhaque44 commented Oct 2, 2023

@zachaller can you take a look at this PR, I think its only failing b/c it wants a test for this getCanaryConfigId func, the error handling part

@zachaller zachaller merged commit b81e404 into argoproj:master Oct 2, 2023
26 of 27 checks passed
@zhaque44 zhaque44 deleted the kayenta-updates branch October 3, 2023 00:14
phclark pushed a commit to phclark/argo-rollouts that referenced this pull request Oct 13, 2023
…ror handling (argoproj#3070)

updating getCanaryConfigId to be more efficient with better error handling

Signed-off-by: zhaque44 <[email protected]>
Signed-off-by: Philip Clark <[email protected]>
phclark pushed a commit to phclark/argo-rollouts that referenced this pull request Oct 15, 2023
…ror handling (argoproj#3070)

updating getCanaryConfigId to be more efficient with better error handling

Signed-off-by: zhaque44 <[email protected]>
Signed-off-by: Philip Clark <[email protected]>
phclark pushed a commit to phclark/argo-rollouts that referenced this pull request Oct 15, 2023
…ror handling (argoproj#3070)

updating getCanaryConfigId to be more efficient with better error handling

Signed-off-by: zhaque44 <[email protected]>
Signed-off-by: Philip Clark <[email protected]>
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