refactor(oci): consume dunite-oci shared limiter API and typed blob-cache errors (PSA-35) #38

Merged
nrupard merged 1 commit from refactor/psa-35-dunite-oci-consumer into main 2026-06-02 19:58:59 +02:00
Owner

What

Consumer-side update for the dunite-oci API changes merged in dunite PR #4 (PSA-35). Mechanical changes only; registry behavior improves where errors were previously flattened.

  • PullCounter: the trait is now dunite-core's UsageCounter (no current()); the repository's trait impl drops it, the inherent current() method stays for tests/diagnostics.
  • get_blob handler: maps typed BlobCacheError via dunite-oci's From<&BlobCacheError> for OciError (spec classification lives next to the types); the handler keeps only Bunyip's logging and audit policy. Forgejo transport failures now return 502 with an upstream-cause log, filesystem failures return 500 with the real cause; previously everything non-404 was a generic 502 with a flattened string (the BUNYIP-31 finding).
  • Operator diagnostic: the 401/403 "Forgejo rejected service credentials" message is now one shared helper for the manifest and blob paths.
  • Cargo.lock: dunite crates bumped to dunite main 269ee30.

Verification

Run in the rust-builder container with the pinned 1.93.0 toolchain:

  • cargo test -p bunyip-oci --lib: 7 passed, 0 failed
  • cargo check -p bunyip-api --all-targets: clean
  • cargo test --workspace --lib: all green
  • cargo fmt -p bunyip-oci --check: clean
  • cargo clippy -p bunyip-oci --no-deps: no new violations; the 4 pre-existing ones (untouched files/lines) plus the bunyip-domain violations are tracked in BUNYIP-36

Note on CI

The repo's check workflow currently fails on main (pre-existing fmt/clippy violations, BUNYIP-36), so the check on this PR will be red for the same pre-existing reasons, not because of this change.

## What Consumer-side update for the dunite-oci API changes merged in [dunite PR #4](https://dev.a8n.run/psa-systems/dunite/pulls/4) (PSA-35). Mechanical changes only; registry behavior improves where errors were previously flattened. - **PullCounter**: the trait is now dunite-core's `UsageCounter` (no `current()`); the repository's trait impl drops it, the inherent `current()` method stays for tests/diagnostics. - **get_blob handler**: maps typed `BlobCacheError` via dunite-oci's `From<&BlobCacheError> for OciError` (spec classification lives next to the types); the handler keeps only Bunyip's logging and audit policy. Forgejo transport failures now return 502 with an upstream-cause log, filesystem failures return 500 with the real cause; previously everything non-404 was a generic 502 with a flattened string (the BUNYIP-31 finding). - **Operator diagnostic**: the 401/403 "Forgejo rejected service credentials" message is now one shared helper for the manifest and blob paths. - **Cargo.lock**: dunite crates bumped to dunite main `269ee30`. ## Verification Run in the rust-builder container with the pinned 1.93.0 toolchain: - `cargo test -p bunyip-oci --lib`: 7 passed, 0 failed - `cargo check -p bunyip-api --all-targets`: clean - `cargo test --workspace --lib`: all green - `cargo fmt -p bunyip-oci --check`: clean - `cargo clippy -p bunyip-oci --no-deps`: no new violations; the 4 pre-existing ones (untouched files/lines) plus the bunyip-domain violations are tracked in BUNYIP-36 ## Note on CI The repo's check workflow currently fails on main (pre-existing fmt/clippy violations, BUNYIP-36), so the check on this PR will be red for the same pre-existing reasons, not because of this change.
refactor(oci): consume dunite-oci's shared limiter API and typed blob-cache errors (PSA-35)
Some checks failed
Check / fmt / clippy / build / test (pull_request) Failing after 25s
Create release / Create release from merged PR (pull_request) Has been skipped
d8771c0767
Consumer-side update for the dunite-oci API changes merged in dunite PR #4 (PSA-35):

- PullCounter is now dunite-core's UsageCounter re-exported by dunite-oci, so the trait no longer has current(); the OciPullDailyCountRepository trait impl drops it and keeps current() as an inherent method for tests and diagnostics.
- BlobCache::get_or_fetch returns typed BlobCacheError instead of AppError. The get_blob handler now uses dunite-oci's From<&BlobCacheError> for OciError for the spec-mandated status classification (BlobUnknown / Upstream / Internal) and keeps only Bunyip's logging and audit policy. Forgejo transport failures and filesystem errors are now distinguishable in logs (the BUNYIP-31 finding).
- The 401/403 "Forgejo rejected service credentials" operator diagnostic is extracted into log_forgejo_credential_rejection(), shared by the manifest and blob paths so the guidance cannot drift between them.
- Cargo.lock: dunite crates bumped to dunite main 269ee30 (the PSA-35 merge).

Verified in the rust-builder container with the pinned 1.93.0 toolchain: bunyip-oci tests pass, bunyip-api compiles, workspace lib tests pass, fmt clean, no new clippy violations (the pre-existing workspace violations are tracked in BUNYIP-36).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nrupard deleted branch refactor/psa-35-dunite-oci-consumer 2026-06-02 19:58:59 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
psa-systems/bunyip!38
No description provided.