Add streams.yml alias collision validation - #3265
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Warning Review limit reached
Next review available in: 39 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository: openshift-eng/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe validator now recognizes ChangesStream validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ValidatorMain
participant StreamsValidate
participant ValidationSupport
ValidatorMain->>StreamsValidate: validate(stream_data)
StreamsValidate-->>ValidatorMain: collision errors or None
ValidatorMain->>ValidationSupport: fail_validation(error) when errors exist
ValidatorMain-->>ValidatorMain: report success and skip GitHub validation when valid
🚥 Pre-merge checks | ✅ 10 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (10 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ocp-build-data-validator/validator/streams.py`:
- Around line 38-43: The alias collision logic in the stream validation flow
must ignore repeated aliases owned by the same stream. In the block updating
alias_to_stream, compare alias_to_stream[alias] with stream_name and append to
collisions only when they differ, while preserving the existing owner mapping;
add a regression test covering duplicate aliases within one stream.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift-eng/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: f2d709ef-4355-41a0-a6bb-33f602185bbe
📒 Files selected for processing (3)
ocp-build-data-validator/tests/test_streams.pyocp-build-data-validator/validator/__main__.pyocp-build-data-validator/validator/streams.py
Detect collisions between top-level stream names and alias values in streams.yml. Two types of collisions are caught: - An alias value that matches a top-level stream name - The same alias value defined in multiple streams Follows the existing releases.py pattern for semantic validation that runs after schema validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> rh-pre-commit.version: 2.2.0 rh-pre-commit.check-secrets: ENABLED
The previous check incorrectly flagged duplicate aliases within the same stream as cross-stream collisions. Now only aliases shared between different streams are reported as errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> rh-pre-commit.version: 2.2.0 rh-pre-commit.check-secrets: ENABLED
ea036f9 to
1057a29
Compare
|
@redhat-chai-bot: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Adds semantic validation to the ocp-build-data-validator that flags collisions between top-level stream names and resolved alias values in streams.yml.
What it validates
Context
This was identified after a golang-builder pipeline crash caused by a stream in streams.yml listing its own name as an alias (e.g.
rhel-9-golang-1.21with aliasrhel-9-golang-1.21). Fixed in openshift-eng/ocp-build-data#12213, but this validation ensures it is caught proactively.Changes
ocp-build-data-validator/validator/streams.py— new semantic validation moduleocp-build-data-validator/tests/test_streams.py— 7 test casesocp-build-data-validator/validator/__main__.py— wire streams validation into the pipelineAI-generated. Review for accuracy.
@thegreyd requested in Slack thread
Summary by CodeRabbit
New Features
Tests