Skip to content

Conversation

@dgoodwin
Copy link
Contributor

@dgoodwin dgoodwin commented Nov 28, 2025

Goal is to help maintain consistency in openshift e2e testing, prevent problems that will cause prs to get reverted or trouble for CI systems, and ultimately land features smoother.

Enforces a number of conventions that have a history of tripping people up and recommends solutions, mostly around test naming.

This is just a start, hoping to expand on this as we see problems in CI.

It pulls in Bryce's dev guide early to get the context of how we land features and attempt to use that when reviewing.

Works on both local git branch, as well as a PR URL.

A potential next step would be to examine all test results coming out of a PR to see if a modified/added test failed anywhere, or potentially, caused something else to fail around the time the test ran.

Sample output:

Test Review Summary - PR #30539

Overview

  • PR: [WIP] STOR-2638: add test for MutableCSINodeAllocatableCount feature
  • Author: @Phaow
  • Base: main → Head: dev
  • Files Changed: 2 test files
  • New Tests: 2

Violations Found

❌ Component Mapping (2 violations)

Both tests missing [Jira:"component"] tag - required for failure routing

✅ Parallel Safety (0 violations)

Tests correctly marked [Serial] - they scale down operators and modify cluster resources

✅ Naming Conventions (0 violations)

No dynamic content or deprecated conventions found

Action Items

  1. Add component tag to both tests:

    [Jira:"Storage"]
  2. Verify feature has ≥5 tests total (OpenShift requirement, currently 2)

  3. Confirm correct Jira component using:

    /component-health:list-components 4.18

Test Names

  1. [sig-storage][OCPFeature:MutableCSINodeAllocatableCount][Serial][Driver: ebs.csi.aws.com] should automatically update CSINode allocatable count when instance attached ENI count changes
  2. [sig-storage][OCPFeature:MutableCSINodeAllocatableCount][Serial][Driver: ebs.csi.aws.com] should immediately update CSINode allocatable count when ResourceExhausted errors occur

References

Summary by CodeRabbit

  • New Features
    • Added /ci:pr-test-analysis [base-branch-or-pr-url] command to review Ginkgo test code changes for naming, component tagging, topology and parallel-safety guidance, with examples and usage modes.
  • Bug Fixes / Documentation
    • Simplified the /openshift:bootstrap-om command signature display by removing an unnecessary empty-string argument.

✏️ Tip: You can customize this high-level summary in your review settings.

@openshift-ci openshift-ci bot requested review from bryan-cox and stbenjam November 28, 2025 17:34
@openshift-ci
Copy link

openshift-ci bot commented Nov 28, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgoodwin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

Walkthrough

Adds documentation for a new /ci:pr-test-analysis [base-branch-or-pr-url] command and updates an Openshift plugin command signature display; changes are documentation-only and introduce command metadata, README content, and a full command guide describing static analysis rules for Ginkgo tests.

Changes

Cohort / File(s) Change Summary
Plugin manifest & registry
PLUGINS.md, docs/data.json
Registers new /ci:pr-test-analysis [base-branch-or-pr-url] command in plugin metadata and updates argument_hint for /openshift:bootstrap-om (removed explicit "" argument).
CI plugin documentation
plugins/ci/README.md, plugins/ci/commands/pr-test-analysis.md
Adds README entry and a comprehensive command guide for pr-test-analysis detailing purpose, validation checks (component tags, test-name stability, parallel safety, topology risks), usage modes, examples, and reporting format.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus review on:
    • docs/data.json — ensure command metadata fields (argument_hint, description, synopsis) are correctly formatted and escaped.
    • PLUGINS.md — verify command listing/signature update is consistent with registry.
    • plugins/ci/commands/pr-test-analysis.md and README — confirm accuracy of validation rules, examples, and prerequisites; check for clarity and any mismatches with repository conventions.

Pre-merge checks and finishing touches

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
No Real People Names In Style References ❓ Inconclusive Unable to examine pull request files without access to repository or file content. No pull request details provided. Provide the pull request URL, repository path, or file contents to perform the analysis for real people's names used as style references or documentation.
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a command for reviewing e2e test PRs and enforcing conventions, which aligns with the primary objectives and all file changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
No Assumed Git Remote Names ✅ Passed PR modifications are documentation and configuration updates only; no code hardcodes git remote names like 'origin' or 'upstream'.
Git Push Safety Rules ✅ Passed The pull request adds documentation and metadata for a new /ci:pr-test-analysis command but does not introduce any git push operations. All modified files are documentation or configuration files.
No Untrusted Mcp Servers ✅ Passed Pull request introduces documentation for a CI command analyzing test code changes in OpenShift repositories with no new untrusted MCP server installations.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 095f869 and 7c5ecbd.

📒 Files selected for processing (2)
  • PLUGINS.md (2 hunks)
  • docs/data.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • PLUGINS.md
🔇 Additional comments (2)
docs/data.json (2)

637-637: LGTM - Format consistency improvement.

The change from "\"\"" to "" for the empty argument_hint improves consistency with other commands in the file that use the same pattern (e.g., lines 38, 51, 124).


235-240: The pr-test-analysis command metadata is correct and make update was properly executed.

The new pr-test-analysis command metadata in lines 235-240 is correct and aligns with the PR objectives. The git history confirms that make update was run (commit 7c5ecbd), and there are no uncommitted changes to docs/data.json, indicating the file was properly auto-generated from the plugin source and is in sync. The previous pipeline sync concern has been resolved.


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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 28, 2025
@dgoodwin dgoodwin changed the title test pr reviewer Add a command for reviewing e2e test PRs and enforcing conventions Nov 28, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
plugins/openshift/commands/test-review.md (3)

191-194: Remove redundant "only" adverb.

Lines 191-192 repeat "only" in adjacent bullet points, creating a minor style issue.

-  - Test operates only in its own namespace
+  - Test operates in its own namespace
   - Creates only namespaced resources (pods, services, deployments, etc.)

10-10: Specify language identifiers for fenced code blocks.

Multiple code blocks lack language specifiers, which prevents syntax highlighting. Add appropriate language identifiers (bash, go, markdown, etc.) to all fenced code blocks for better readability.

Examples:

  • Line 10: ```bash (instead of ```)
  • Lines 261+: ```bash for command examples
  • Line 335+: ```go for Go code violations and fixes
  • Line 433+: ```markdown for example output

Also applies to: 261-261, 266-266, 271-271, 276-276, 281-281, 433-433


431-432: Convert bare URLs to markdown links.

Bare URLs should be wrapped in markdown link syntax for better formatting and clickability in rendered documentation.

-  - See official OpenShift feature development guidelines: https://github.com/openshift/enhancements/blob/master/dev-guide/feature-zero-to-hero.md
-  - See test naming guidelines: https://github.com/openshift/origin/blob/master/test/extended/README.md
+  - See [official OpenShift feature development guidelines](https://github.com/openshift/enhancements/blob/master/dev-guide/feature-zero-to-hero.md)
+  - See [test naming guidelines](https://github.com/openshift/origin/blob/master/test/extended/README.md)
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 793889e and aabe3b5.

📒 Files selected for processing (3)
  • PLUGINS.md (1 hunks)
  • docs/data.json (1 hunks)
  • plugins/openshift/commands/test-review.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
plugins/openshift/commands/test-review.md

[style] ~192-~192: This adverb was used twice in the sentence. Consider removing one of them or replacing them with a synonym.
Context: ... only in its own namespace - Creates only namespaced resources (pods, services, d...

(ADVERB_REPETITION_PREMIUM)

🪛 markdownlint-cli2 (0.18.1)
plugins/openshift/commands/test-review.md

10-10: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


261-261: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


266-266: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


271-271: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


276-276: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


281-281: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


335-335: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4

(MD001, heading-increment)


431-431: Bare URL used

(MD034, no-bare-urls)


432-432: Bare URL used

(MD034, no-bare-urls)


433-433: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (5)
PLUGINS.md (1)

206-206: Documentation entry is well-placed and consistent.

The new command entry follows the established pattern and integrates seamlessly with existing OpenShift plugin documentation.

docs/data.json (1)

645-650: JSON command metadata is well-formed and consistent.

The new command entry follows the standard structure of other openshift plugin commands, with all required fields properly populated.

plugins/openshift/commands/test-review.md (3)

1-50: Comprehensive implementation guide with strong coverage of PR objectives.

The documentation thoroughly addresses all stated PR objectives: component mapping validation, serial test detection, PR/branch review support, integration with OpenShift guidelines (zero-to-hero), and detection of deprecated conventions (Owner, LEVEL0). The 9-step implementation plan provides clear procedural guidance, and the validation rules with examples are well-explained.


24-229: Implementation plan is thorough and practical.

The step-by-step breakdown covers change detection, test identification, validation logic, and reporting clearly. The approach to handling PR mode vs. branch mode is sensible, and the validation rules for component tags, naming violations, and parallel safety are comprehensive and aligned with OpenShift testing practices.


258-433: Examples and expected output effectively demonstrate command behavior.

The example scenarios (from simple auto-detection to detailed PR analysis) and the sample report with violations clearly show how the command surfaces issues. The violation examples with code snippets and suggested fixes provide practical guidance for developers.


1. **Load OpenShift Testing Guidelines**:
- Fetch the latest guidelines for landing a feature in OpenShift from the enhancements repository
- Use `curl` to download: `https://raw.githubusercontent.com/openshift/enhancements/refs/heads/master/dev-guide/feature-zero-to-hero.md`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - Add a timeout recommendation (e.g., curl --connect-timeout 5 --max-time 10)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this could be a simple (in line?) bash script the command uses.

Will avoid the set of problems where claude decides to do something slightly differently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From an AI code review plugin -

  File: plugins/openshift/commands/test-review.md

  Issue: There is functional overlap with existing commands:
  - openshift:review-test-cases - Reviews test cases for quality and best practices
  - openshift:expand-test-case - Expands test ideas into comprehensive scenarios

  The new test-review command focuses on naming/structure violations specifically, which is distinct, but the naming could cause confusion.

  Recommendation: Consider:
  1. Adding a "See Also" section referencing related commands
  2. Clarifying the distinction in the Description section

@theobarberbany
Copy link
Contributor

This looks great :D

I've been working on a framework for evals for CC commands like this, starting with the o/api review command, I think the same pattern could be used here to try to spot regressions / quality issues early.


1. **Load OpenShift Testing Guidelines**:
- Fetch the latest guidelines for landing a feature in OpenShift from the enhancements repository
- Use `curl` to download: `https://raw.githubusercontent.com/openshift/enhancements/refs/heads/master/dev-guide/feature-zero-to-hero.md`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doc seems more high level and I'm not sure how you would evaluate many of these things against a single origin PR. It has no knowledge of how many existing tests there are for a feature, or how often they run.

https://github.com/openshift/enhancements/blob/master/dev-guide/test-conventions.md seems more germane

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does look better, I'll switch it.

docs/data.json Outdated
Comment on lines 646 to 648
"argument_hint": "[base-branch-or-pr-url]",
"description": "Review Ginkgo test code changes in current branch or PR for naming violations and best practices",
"name": "test-review",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a PR the right argument? What if I wanted to review an existing test that had already merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post merge review of tests wasn't really an intended target, I thought it would be useful while working locally, and on posted PRs (which I think actually should be the main one once it's analyzing test results coming out of a PR). However you should be able to point it to a PR where tests merged I think.

- Run `git grep -r "\[sig-<name>\]" test/` or `git grep -r "\[bz-<name>\]" test/`
- If tag exists in other tests, it's valid
- If tag is unique to this test, flag as potential made-up tag
- Examples: `[sig-network]`, `[bz-storage]`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd avoid mentioning the bugzilla prefix, we should be working on getting rid of this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do though, it will start to flag edits to those tests I think, and then we need to get it renamed in the other repo. I'll try to clarify that it's ok in old tests, but not in new.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 3, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 19, 2025
@dgoodwin
Copy link
Contributor Author

Command isn't done but I've expanded more. Eventually I want it studying your test results looking for problems you may have caused with a PR, and reocommending intelligent additional test jobs to run if the pr looks like it might break microshift/hypershift/etc.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
plugins/ci/commands/pr-test-analysis.md (2)

218-218: Consider removing the repeated "only" for clarity.

The sentence "Test operates only in its own namespace - Creates only namespaced resources" uses "only" twice. Consider: "Test operates exclusively in its own namespace - Creates only namespaced resources" or "Test operates only in its own namespace - Creates namespaced resources".


1-659: Consider adding a "See Also" section.

Per previous review feedback, adding a "See Also" section would help clarify the relationship with related commands and avoid confusion:

## See Also

Related commands for test development and review:
- `/openshift:review-test-cases` - Review test cases for completeness, quality, and best practices
- `/openshift:expand-test-case` - Expand test ideas into comprehensive test scenarios
- `/openshift:new-e2e-test` - Write and validate new OpenShift E2E tests using Ginkgo

This command (`ci:pr-test-analysis`) focuses specifically on validating test code changes in PRs and branches against OpenShift naming conventions, component tagging requirements, and parallel execution safety standards.

This would address the functional overlap concern raised in the previous review.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between aabe3b5 and 095f869.

📒 Files selected for processing (4)
  • PLUGINS.md (1 hunks)
  • docs/data.json (1 hunks)
  • plugins/ci/README.md (1 hunks)
  • plugins/ci/commands/pr-test-analysis.md (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Lint Plugins
docs/data.json

[error] 1-1: CLAUDELINT: docs/data.json is out of sync with plugin metadata. Run 'make update' to update.

PLUGINS.md

[error] 1-1: CLAUDELINT: PLUGINS.md is out of sync with plugin metadata. Run 'make update' to update.

🪛 LanguageTool
plugins/ci/commands/pr-test-analysis.md

[style] ~218-~218: This adverb was used twice in the sentence. Consider removing one of them or replacing them with a synonym.
Context: ... only in its own namespace - Creates only namespaced resources (pods, services, d...

(ADVERB_REPETITION_PREMIUM)

🪛 markdownlint-cli2 (0.18.1)
plugins/ci/commands/pr-test-analysis.md

10-10: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


273-273: Unordered list indentation
Expected: 0; Actual: 3

(MD007, ul-indent)


274-274: Unordered list indentation
Expected: 0; Actual: 3

(MD007, ul-indent)


275-275: Unordered list indentation
Expected: 0; Actual: 3

(MD007, ul-indent)


276-276: Unordered list indentation
Expected: 0; Actual: 3

(MD007, ul-indent)


277-277: Unordered list indentation
Expected: 0; Actual: 3

(MD007, ul-indent)


278-278: Unordered list indentation
Expected: 0; Actual: 3

(MD007, ul-indent)


279-279: Unordered list indentation
Expected: 0; Actual: 3

(MD007, ul-indent)


280-280: Unordered list indentation
Expected: 0; Actual: 3

(MD007, ul-indent)


281-281: Unordered list indentation
Expected: 2; Actual: 5

(MD007, ul-indent)


282-282: Unordered list indentation
Expected: 2; Actual: 5

(MD007, ul-indent)


282-282: Bare URL used

(MD034, no-bare-urls)


283-283: Unordered list indentation
Expected: 2; Actual: 5

(MD007, ul-indent)


284-284: Unordered list indentation
Expected: 2; Actual: 5

(MD007, ul-indent)


285-285: Unordered list indentation
Expected: 2; Actual: 5

(MD007, ul-indent)


286-286: Unordered list indentation
Expected: 2; Actual: 5

(MD007, ul-indent)


287-287: Unordered list indentation
Expected: 2; Actual: 5

(MD007, ul-indent)


288-288: Unordered list indentation
Expected: 4; Actual: 7

(MD007, ul-indent)


289-289: Unordered list indentation
Expected: 4; Actual: 7

(MD007, ul-indent)


290-290: Unordered list indentation
Expected: 4; Actual: 7

(MD007, ul-indent)


330-330: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


335-335: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


340-340: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


345-345: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


350-350: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


427-427: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


555-555: Bare URL used

(MD034, no-bare-urls)


556-556: Bare URL used

(MD034, no-bare-urls)


579-579: Bare URL used

(MD034, no-bare-urls)


580-580: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (5)
plugins/ci/README.md (1)

9-48: LGTM!

The documentation is clear, comprehensive, and well-organized. The distinction between NEW and MODIFIED test requirements is well-explained, and the examples cover the main usage scenarios effectively.

plugins/ci/commands/pr-test-analysis.md (4)

1-28: Clear and well-structured command description.

The description effectively outlines the four main validation types and clearly distinguishes between requirements for NEW tests versus MODIFIED tests. The scope (Ginkgo tests in OpenShift repos) is appropriate.


292-326: LGTM!

The report format is well-structured with clear, logical sections that make it easy to review findings by category.


327-580: Excellent comprehensive examples.

The example invocations cover all major use cases, and the detailed sample output effectively demonstrates the report format and how violations are presented with suggested fixes.


582-659: Comprehensive documentation with clear prerequisites and notes.

The Arguments, Prerequisites, and Notes sections are thorough and address important edge cases. The explanation of NEW vs MODIFIED test detection and the clarification about fmt.Sprintf usage with string literals are particularly helpful.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants