fix(cleanup): resolve four bunyip review findings (BUNYIP-400) #392
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-400-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Four small, independent issues surfaced by a codebase and cross-app review of bunyip, grouped into one cleanup PR (BUNYIP-400).
Why
bunyip-api/src/handlers/download.rsdiscarded the audit-log-write Result on both download paths, unlikecrates/bunyip-oci/src/handlers/oci_auth.rswhich logs a warn! on the identical failure.bunyip-api/src/handlers/webhook.rscast Stripe's i64 centsas i32, which silently wraps above ~$21.47M..env.exampledocumented the pre-cutover SSO topology (mokosh-server as IdP), which is wrong now that bunyip-api is the sole OpenID Provider.Changes
if let Err(audit_err) = AuditLogRepository::create(...).await { tracing::warn!(error = ?audit_err, "..."); }, matching the oci_auth.rs reference pattern, so a failed audit write is observable instead of swallowed.as i32casts (checkout price lock, checkout amount_total fallback, invoice amount_paid, invoice amount_due) are now checkedi32::try_from; an out-of-range value is logged withtracing::error!and the affected write is skipped (checkout price lock) or falls back to 0 rather than wrapping. Bounded fix per the issue; the fuller fix (widen the cents columns to BIGINT and carry i64 end to end) is deferred as out of scope for a cleanup PR..env.examplebunyip-as-OP: theBUNYIP_OIDC_ISSUERdefault now points athttps://${USER}-bunyip-api.a8n.runand the surrounding comments describe bunyip-api as the OpenID Provider (bunyip-web is a relying party, mokosh-server is a Resource Server only), grounded inbunyip-web/src/config.rs(issuer defaults to the api URL) andcompose.dev-sso.yml. The stale/config.json+ entrypoint.sh +msp-api.<host>mechanism text and the "register in the mokosh-server repo" instruction were corrected (client registration isjust register-dev-clientsagainst bunyip-api).bunyip-api/migrations/20260724000010_drop_stale_mokosh_server_oidc_client.sqldeletes the mokosh-server confidential client row (b0000000-0000-4000-8000-000000000001) registered in20260502000048and flagged for removal in20260603000010. The DELETE is idempotent (no-op on an absent row) and does not touch the real mokosh-apps / drillmark seeds.Tests
scripts/check-migration-versions.sh): passed (unique and strictly increasing; new stamp20260724000010sits after the prior max20260721000030).ghcr.io/niceguyit/rust-builder-glibc:v1.0.1-rust1.94-trixie,SQLX_OFFLINE=true):cargo fmt --all --checkclean,cargo clippy --workspace --all-targets -- -D warningsclean,cargo test --workspace --all-targetsgreen (493 tests passed, 0 failed). No live Postgres required.