Skip to content

Conversation

@alukach
Copy link
Contributor

@alukach alukach commented May 29, 2025

What I'm changing

  1. We shouldn't log client errors (beyond the request logging middleware that we use)
  2. ObjectNotFound errors should not log Some(...)
  3. Don't log response bodies on upstream client request errors

How I did it

See code...

How to test it

See successful test output...

PR Checklist

  • This PR has no breaking changes.
  • I have updated or added new tests to cover the changes in this PR.
  • This PR affects the Source Cooperative Frontend & API,
    and I have opened issue/PR #XXX to track the change.

Related Issues

gadomski
gadomski previously approved these changes May 29, 2025
SourceRepositoryMissingPrimaryMirror,

#[error("object not found: {0:?}")]
#[error("object not found: {message}", message = .0.as_ref().unwrap_or(&"".to_string()))]
Copy link
Contributor

Choose a reason for hiding this comment

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

Could maybe use unwrap_or_default?

@alukach alukach changed the title chore(logging): cleanup logs fix(logging): only log server errors, remove unnecessary details from logs May 29, 2025
@source-coop-release source-coop-release bot added fix and removed chore labels May 29, 2025
@alukach alukach merged commit 496373c into main May 29, 2025
3 checks passed
@alukach alukach deleted the chore/only-log-errors branch May 29, 2025 18:16
alukach pushed a commit that referenced this pull request May 29, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.1.29](v0.1.28...v0.1.29)
(2025-05-29)


### Bug Fixes

* **errors:** pass through client error status codes
([#77](#77))
([fe383dd](fe383dd))
* **logging:** only log server errors, remove unnecessary details from
logs
([#75](#75))
([496373c](496373c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: source-coop-release[bot] <187876225+source-coop-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants