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(analysis): Graphite metric provider - index out of range [0] with length 0 #2751

Merged
merged 2 commits into from
May 5, 2023

Conversation

mdsjip
Copy link
Contributor

@mdsjip mdsjip commented Apr 30, 2023

Rare case, but seen in the wild: Graphite APIs returning response body with just an empty array: []
This PR allows to handle this case by checking it and returning an empty dataPoint array.

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.

… length 0

Signed-off-by: mdsjip <2284562+mdsjip@users.noreply.github.com>
@mdsjip mdsjip changed the title fix(analysis): graphite metric provider - nil pointer dereference fix(analysis): graphite metric provider - index out of range [0] with length 0 Apr 30, 2023
@codecov
Copy link

codecov bot commented Apr 30, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (04b1e30) 81.62% compared to head (8ebd8b4) 81.63%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2751   +/-   ##
=======================================
  Coverage   81.62%   81.63%           
=======================================
  Files         133      133           
  Lines       20157    20160    +3     
=======================================
+ Hits        16454    16457    +3     
  Misses       2849     2849           
  Partials      854      854           
Impacted Files Coverage Δ
metricproviders/graphite/api.go 78.82% <100.00%> (+0.77%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 30, 2023

Go Published Test Results

1 950 tests   1 950 ✔️  2m 36s ⏱️
   118 suites         0 💤
       1 files           0

Results for commit 8ebd8b4.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 30, 2023

E2E Tests Published Test Results

    4 files      4 suites   3h 29m 45s ⏱️
  96 tests   82 ✔️   5 💤   9
402 runs  364 ✔️ 20 💤 18

For more details on these failures, see this check.

Results for commit 8ebd8b4.

♻️ This comment has been updated with latest results.

@mdsjip mdsjip changed the title fix(analysis): graphite metric provider - index out of range [0] with length 0 fix(analysis): Graphite metric provider - index out of range [0] with length 0 Apr 30, 2023
@sonarcloud
Copy link

sonarcloud bot commented May 1, 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

@zachaller zachaller merged commit 1f89c16 into argoproj:master May 5, 2023
@mdsjip mdsjip deleted the graphite-npe branch May 6, 2023 12:32
@mdsjip
Copy link
Contributor Author

mdsjip commented May 27, 2023

@zachaller will these changes be included in the next release soon? 🙂

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