Log configuration errors instead of silently discarding them#504
Merged
ChristianPavilonis merged 1 commit intomainfrom Mar 16, 2026
Merged
Log configuration errors instead of silently discarding them#504ChristianPavilonis merged 1 commit intomainfrom
ChristianPavilonis merged 1 commit intomainfrom
Conversation
prk-Jr
reviewed
Mar 16, 2026
Collaborator
prk-Jr
left a comment
There was a problem hiding this comment.
Summary
This change fixes the five targeted silent .ok() conversions and materially improves operator visibility for config parse / backend resolution failures. I didn't find any blocking correctness issues, but I am leaving one cross-cutting follow-up about when provider endpoint validation runs.
Non-blocking
🤔 thinking
- Lazy backend validation still defers invalid endpoint detection to live traffic:
backend_name()is only queried from the auction loop, so invalid endpoints are still invisible at startup and will emit one error per auction request instead of a single registration-time failure. Consider validatingBackendConfig::from_url(...)during provider registration and skipping registration on failure. (crates/common/src/integrations/adserver_mock.rs:372,crates/common/src/integrations/aps.rs:520,crates/common/src/integrations/prebid.rs:954,crates/common/src/auction/orchestrator.rs:238)
CI Status
- Analyze (actions): PASS
- Analyze (javascript-typescript): PASS
- Analyze (rust): PASS
- CodeQL: PASS
- cargo fmt: PASS
- cargo test: PASS
- format-docs: PASS
- format-typescript: PASS
- vitest: PASS
…and backend setup Configuration errors from integration_config() were converted to None via .ok(), making broken configs appear as 'not configured' with no operator feedback. Similarly, BackendConfig::from_url() errors in backend_name() were silently swallowed. Add log::error! calls at five sites: Prebid and NextJS build() functions now use match to log config deserialization failures, and adserver_mock, APS, and Prebid backend_name() methods now use inspect_err to log URL parsing errors before converting to Option.
a74cc40 to
fb95002
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Nonevia.ok(), making broken configs appear as "not configured" with no operator feedback.build()functions now usematchto log deserialization failures atlog::error!level before returningNone.backend_name()methods now use.inspect_err()to log URL parsing errors before converting toOption.Changes
crates/common/src/integrations/prebid.rsbuild(): replaced.ok().flatten()?withmatch+log::error!;backend_name(): added.inspect_err()before.ok()crates/common/src/integrations/nextjs/mod.rsbuild(): replaced.ok().flatten()?withmatch+log::error!crates/common/src/integrations/adserver_mock.rsbackend_name(): added.inspect_err()before.ok()crates/common/src/integrations/aps.rsbackend_name(): added.inspect_err()before.ok()Closes
Closes #408
Test plan
cargo test --workspacecargo clippy --all-targets --all-features -- -D warningscargo fmt --all -- --checkcd crates/js/lib && npx vitest runcd crates/js/lib && npm run formatcd docs && npm run formatcargo build --bin trusted-server-fastly --release --target wasm32-wasip1fastly compute serveChecklist
unwrap()in production code — useexpect("should ...")logmacros (notprintln!)