OSIS-156: log empty bucket list at DEBUG, classify on AmazonS3Exception 404#167
Conversation
|
LGTM — the 404 classification is correct: the only AmazonS3Exception source in getBucketList is listBuckets(), so the instanceof+statusCode check accurately identifies the "no buckets" case. The isAdminPolicyError (403) path doesn't interfere. Tests cover both the expected-empty (404 → DEBUG, no trace) and genuine-fault (500 → ERROR with trace) paths with proper logger cleanup. The S3ServiceException → AmazonS3Exception change in the existing test aligns it with what the S3 client actually throws. Review by Claude Code |
75dbb37 to
63751d1
Compare
|
dump.rdb — Accidental Redis database dump committed to the repo. This file must be removed before merge. It may contain encrypted S3 credentials from the The core OSIS change (log-level reclassification in
No other issues found. Review by Claude Code |
|
LGTM — the change correctly classifies an expected 404 |
63751d1 to
30a8a56
Compare
|
no code change pushed, just rebased to main and force pushed. |
…D after rebase A rebase onto main re-expanded the wildcard imports (29 -> 34, over PMD's ExcessiveImports limit of 30) and renamed s3Exception back to ex (ShortVariable), silently reverting the PMD fix that had already passed CI. Restore both.
|
reverted to wild card imports, no such change in the code behaviour. |
Intent: why does this change exist?
getBucketList returns an empty page when a tenant has no buckets, but the catch logged every case at ERROR with a stack trace, so the normal "no buckets yet" case looked like a failure and muddied diagnosis.
System impact: what's affected, including downstream?
Logging classification inside getBucketList only. The empty PageOfOsisBucketMeta return contract is unchanged.
Preserved behavior: what explicitly stays the same?
The empty-list contract is unchanged, and genuine faults (Vault, S3, network, auth) still log at ERROR with their stack trace exactly as before. Only the expected empty case is reclassified.
Intended change: what's different after this PR?
An expected empty list (an AmazonS3Exception with a 404 status, the type AmazonS3.listBuckets actually throws) is logged at DEBUG with a concise message and no stack trace. Tests pin DEBUG and no-trace for the empty case, and ERROR with a trace for a genuine fault.
Verification: how do we know this worked, or how would we know if it didn't?
Ran the full osis-core test module including the JaCoCo gate: green. The tests fail if the empty case logs at ERROR or WARN or carries a trace, or if a genuine fault stops logging at ERROR.