Skip to content

CLOUDP-319781: Added http RoundTripper that logs payload diffs for Atlas API endpoints #2525

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

Merged
merged 6 commits into from
Jul 21, 2025

Conversation

igor-karpukhin
Copy link
Collaborator

Summary

Added http RoundTripper that logs payload diffs for Atlas API endpoints

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you checked for release_note changes?
  • Have you signed our CLA?

@igor-karpukhin igor-karpukhin added the cloud-tests Run expensive Cloud Tests: Integration & E2E label Jul 16, 2025

func (t *TransportWithDiff) RoundTrip(req *http.Request) (*http.Response, error) {
if req.Method == http.MethodPut || req.Method == http.MethodPatch {
diffString, err := t.tryCalculateDiff(req,
Copy link
Collaborator

Choose a reason for hiding this comment

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

:nit: why try...?

Suggested change
diffString, err := t.tryCalculateDiff(req,
diffString, err := t.calculateDiff(req,

"Do or do not, there is no try"

}

func (t *TransportWithDiff) tryCalculateDiff(req *http.Request, cleanupFuncs ...cleanupFunc) (string, error) {
var bodyCopy []byte
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: would have split this into further functions, but ok.

@s-urbaniak s-urbaniak merged commit e256843 into main Jul 21, 2025
143 of 192 checks passed
@s-urbaniak s-urbaniak deleted the CLOUDP-319781/log-payload-diffs branch July 21, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud-tests Run expensive Cloud Tests: Integration & E2E
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants