Skip to content

[Feature]: Make ambiguous oneOf violations configurable - #410

Open
visheshupadhyay wants to merge 2 commits into
getyourguide:mainfrom
visheshupadhyay:feature/configurable-ambiguous-oneof-violations
Open

visheshupadhyay wants to merge 2 commits into
getyourguide:mainfrom
visheshupadhyay:feature/configurable-ambiguous-oneof-violations

Conversation

@visheshupadhyay

Copy link
Copy Markdown

functionality for #409

@visheshupadhyay
visheshupadhyay requested a review from a team as a code owner October 20, 2026 16:37
@gyg-pr-tool
gyg-pr-tool Bot requested a review from ronaldgyg October 20, 2026 16:37
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Central TS config (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7407f524-c30b-447d-a264-547dc0ae02e4
📥 Commits

Reviewing files that changed from the base of the PR and between 6d8c3c7 and 29ddf86.

📒 Files selected for processing: 4
  • openapi-validation-api/src/main/java/com/getyourguide/openapi/validation/api/selector/DefaultTrafficSelector.java
  • openapi-validation-api/src/test/java/com/getyourguide/openapi/validation/api/selector/DefaultTrafficSelectorTest.java
  • openapi-validation-core/src/main/java/com/getyourguide/openapi/validation/core/exclusions/InternalViolationExclusions.java
  • openapi-validation-core/src/test/java/com/getyourguide/openapi/validation/core/exclusions/InternalViolationExclusionsTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
🔇 Additional comments: 3
openapi-validation-core/src/main/java/com/getyourguide/openapi/validation/core/exclusions/InternalViolationExclusions.java: 1

11-23: LGTM!

Also applies to: 31-31

openapi-validation-core/src/test/java/com/getyourguide/openapi/validation/core/exclusions/InternalViolationExclusionsTest.java: 1

61-80: LGTM!

openapi-validation-api/src/main/java/com/getyourguide/openapi/validation/api/selector/DefaultTrafficSelector.java: 1

48-48: LGTM!

📝 Summary

Risk Score: Normal - Addressing the comments needed

This change makes ambiguous oneOf violation handling configurable through InternalViolationExclusions. Existing behavior remains unchanged by default. Callers can disable exclusion with the new boolean constructor parameter.

The sample-rate selector now uses fractional random values. This produces accurate selection rates for non-reciprocal values such as 0.3 and 0.8.

New tests cover configurable ambiguous oneOf violations and sample-rate accuracy. No production outage risk is indicated by the supplied changes.

The selector now uses a random double to apply fractional sample rates. InternalViolationExclusions now allows callers to configure whether ambiguous oneOf violations are excluded. Tests cover multiple sample rates and both exclusion settings.

Suggested labels: coderabbit-risk:high

Priority: ⬇️ Low

Change: Feature

Merge Risk: ⚪ Minimal · up to 29ddf

No actionable issue remains from the reviewed changes; the PR is ready to merge after normal checks.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant