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(metrics-operator): provide more information for dynatrace api error #2885

Closed
wants to merge 26 commits into from

Conversation

Vickysomtee
Copy link
Contributor

@Vickysomtee Vickysomtee commented Jan 26, 2024

Description

This PR adds more information to the dynatrace api error response

Fixes #2790

How to test

Please describe how to run the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also provide information about any automatic tests that you added.

  • Manual Test A
  • Unit Test B
  • Integration Test C

Checklist

  • My PR fulfills the Definition of Done of the corresponding issue and not more (or parts if the issue is separated
    into multiple PRs)
  • I used descriptive commit messages to help reviewers understand my thought process
  • I signed off all my commits according to the Developer Certificate of Origin (DCO)
    see Contribution Guide
  • My PR title is formatted according to the semantic PR conventions described in
    the Contribution Guide
  • My code follows the style guidelines of this project (golangci-lint passes, YAMLLint passes)
  • I regenerated the auto-generated docs for Helm and the CRD documentation (if applicable)
  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation (if needed)
  • My changes result in all-green PR checks (first-time contributors need to ask a maintainer to approve their test runs)
  • New and existing unit and integration tests pass locally with my changes

@Vickysomtee Vickysomtee changed the title Patch fix: provide more information for dynatrace api error Jan 26, 2024
Copy link

codecov bot commented Jan 26, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 85.32%. Comparing base (e048679) to head (131675f).

❗ Current head 131675f differs from pull request most recent head b34e7ab. Consider uploading reports for the commit b34e7ab to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2885      +/-   ##
==========================================
- Coverage   85.36%   85.32%   -0.05%     
==========================================
  Files         167      167              
  Lines        7412     7412              
==========================================
- Hits         6327     6324       -3     
- Misses        798      800       +2     
- Partials      287      288       +1     
Files Coverage Δ
...ollers/common/providers/dynatrace/client/client.go 72.72% <60.00%> (ø)

... and 1 file with indirect coverage changes

Flag Coverage Δ
certificate-operator 69.23% <ø> (ø)
component-tests 58.53% <ø> (-0.25%) ⬇️
lifecycle-operator 83.46% <ø> (ø)
metrics-operator 88.32% <60.00%> (ø)
scheduler 34.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@Vickysomtee Vickysomtee marked this pull request as ready for review January 27, 2024 23:26
@Vickysomtee Vickysomtee requested a review from a team as a code owner January 27, 2024 23:26
@mowies mowies changed the title fix: provide more information for dynatrace api error fix(metrics-operator): provide more information for dynatrace api error Jan 29, 2024
@Vickysomtee Vickysomtee requested a review from odubajDT February 1, 2024 11:05
@RealAnna
Copy link
Contributor

RealAnna commented Feb 5, 2024

Hey @Vickysomtee the ticket requests a Chainsaw test using mockserver, you can copy the implementation of this test but change it for a failing http response to show what would be printed by the operator.

The idea is that the mockserver configuration can return a bad http code, and the result of the operator for example a keptn metric should be the error message you added.

@Vickysomtee
Copy link
Contributor Author

Hey @Vickysomtee the ticket requests a Kuttl test using mockserver, you can copy the implementation of this test but change it for a failing http response to show what would be printed by the operator.

The idea is that the mockserver configuration can return a bad http code, and the result of the operator for example a keptn metric should be the error message you added.

@RealAnna can you check the link in your comment? It links to a folder. Did you intend to link to a folder or a file

Also, just to note, I didn't introduce new error message. I only added statusCode

@RealAnna
Copy link
Contributor

RealAnna commented Feb 6, 2024

Hey @Vickysomtee indeed, I had in mind you changed also the printed message but apparently not... Anyhow line 106, 111 and 127 could use coverage by unit test. For the chainsaw test this is indeed a folder with multiple files, some file declare what the test wll install on the test environment and the other assert the expected result. YOu can have a look at how it works here

@bacherfl
Copy link
Member

Hi @Vickysomtee, any news on this one? feel free to reach out if you have any questions

@Vickysomtee
Copy link
Contributor Author

Hi @Vickysomtee, any news on this one? feel free to reach out if you have any questions

@bacherfl I had a very tight schedule this past weeks. I am settled now, and I will round up this issue ASAP.

@Vickysomtee Vickysomtee marked this pull request as draft February 20, 2024 22:01
@Vickysomtee
Copy link
Contributor Author

Yes the mock should match what I pasted here 👍

@RealAnna Done!

@Vickysomtee Vickysomtee requested a review from RealAnna April 29, 2024 11:22
@Vickysomtee
Copy link
Contributor Author

Hello @RealAnna can you help review again?

Signed-off-by: vickysomtee <[email protected]>
Copy link

sonarqubecloud bot commented May 7, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

name: podtatometric
labels:
app: podtato-head
status:
Copy link
Contributor

Choose a reason for hiding this comment

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

you are getting an empty status in the test result. I would say that's not expected. It should either return the value or error. Can you please adapt it accordingly?

@odubajDT
Copy link
Contributor

odubajDT commented Aug 5, 2024

closing due to inactivity

@odubajDT odubajDT closed this Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynatrace provider: improve troubleshooting capabilities
4 participants