Skip to content

Conversation

@jiajliu
Copy link

@jiajliu jiajliu commented Oct 30, 2025

What this PR does / why we need it:

Adds /prow-job:bump-release-version command to support the auto creation of ci-operator config files for new
OpenShift release versions. When preparing for test jobs for a new release (e.g., moving from 4.21 to 4.22), this command:

  • Intelligently updates all version references in ci-operator config files
  • Generates new randomized cron schedules while preserving test frequencies (f7, f14, f28, f60)
  • Creates properly named output files without modifying originals
  • Supports batch processing of multiple config files

Which issue(s) this PR fixes:

N/A

Special notes for your reviewer:

This eliminates the manual, error-prone process of copying and editing several config files when bumping
release versions, ensuring consistency in version references and proper distribution of test schedules.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.

@openshift-ci openshift-ci bot requested review from bryan-cox and enxebre October 30, 2025 09:29
@jiajliu jiajliu force-pushed the bump branch 2 times, most recently from 3f93af9 to fa35ecd Compare October 30, 2025 09:34
@jiajliu jiajliu closed this Nov 6, 2025
@jiajliu jiajliu reopened this Nov 6, 2025
@openshift-ci
Copy link

openshift-ci bot commented Nov 6, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jiajliu
Once this PR has been reviewed and has the lgtm label, please assign enxebre for approval. For more information see the Code Review Process.

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

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

1 similar comment
@openshift-ci
Copy link

openshift-ci bot commented Nov 6, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jiajliu
Once this PR has been reviewed and has the lgtm label, please assign enxebre for approval. For more information see the Code Review Process.

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

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

coderabbitai bot commented Nov 6, 2025

Walkthrough

Adds a new /prow-job:bump-release-version command to the Prow Job plugin, registers it in docs/data.json, and provides a detailed command document describing input parsing, version detection, file generation (including cron frequency preservation), verification, and output behavior.

Changes

Cohort / File(s) Summary
Plugin README update
PLUGINS.md
Documents the new /prow-job:bump-release-version command in the Prow Job plugin README.
Command metadata
docs/data.json
Registers bump-release-version under the prow-job plugin's commands array with description, synopsis, and empty argument_hint.
Command documentation
plugins/prow-job/commands/bump-release-version.md
Adds a new, comprehensive command doc covering name, synopsis, detailed description, usage examples, implementation phases (input parsing/validation, version detection, file generation with cron preservation, verification, summary), arguments, notes, review guidance, and post-generation steps.

Sequence Diagram(s)

sequenceDiagram
  participant User as User (comment)
  participant Bot as Prow Job Plugin
  participant Parser as Input Parser
  participant Detector as Version Detector
  participant Generator as File Generator
  participant Verifier as Verifier
  participant FS as Filesystem

  User->>Bot: /prow-job:bump-release-version <files> [--bump=N]
  Bot->>Parser: parse args & validate files
  Parser-->>Bot: parsed config list, bump value
  Bot->>Detector: detect current MAJOR.MINOR in filenames/YAML
  Detector-->>Bot: target versions per file
  Bot->>Generator: produce updated content (replace versions, adjust cron frequency)
  Generator->>FS: write new file(s) with bumped version names
  Generator-->>Verifier: provide original vs new content
  Verifier-->>Bot: report verification results
  Bot-->>User: summary report (files created, replacements, verification)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Documentation and metadata additions only; no runtime code changes.
  • Review focus:
    • Consistency between PLUGINS.md, docs/data.json, and plugins/prow-job/commands/bump-release-version.md.
    • Accuracy of command synopsis, examples, and described behaviors (cron-preservation, filename naming, verification steps).
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@jiajliu jiajliu changed the title add bump-release-version command for prow jobs update [prow-job]add bump-release-version command for updating prow jobs Nov 6, 2025
Copy link

@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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between a50fc18 and cfb65bc.

📒 Files selected for processing (3)
  • PLUGINS.md (1 hunks)
  • docs/data.json (1 hunks)
  • plugins/prow-job/commands/bump-release-version.md (1 hunks)
🔇 Additional comments (3)
docs/data.json (1)

279-284: Verify metadata consistency: argument_hint vs. synopsis.

The argument_hint field (line 283) is empty, while the synopsis (line 282) includes detailed argument specification. Looking at similar commands (e.g., analyze-resource), populated argument_hint entries typically correspond to empty or minimal synopsis fields. Clarify the intended pattern: should this be "argument_hint": "<config-file>[,<config-file>...] [--bump=N]" instead?

plugins/prow-job/commands/bump-release-version.md (2)

73-97: Clarify cron schedule randomization algorithm and edge cases.

The cron schedule generation logic (lines 81-85) describes "randomizing" days while preserving count, but the examples (lines 87-97) show structured, evenly-spaced patterns rather than true randomization. Additionally, the algorithm for selecting new day values is not fully specified:

  • How are new day offsets chosen to maintain distribution?
  • What happens with odd day counts (e.g., 3 instead of 2 or 4)?
  • How are irregular patterns (non-uniform intervals) handled?

The examples assume regular spacing, but real-world cron patterns may vary.


36-102: Comprehensive implementation documentation with strong specification clarity.

The five-phase implementation breakdown (Phase 1–5) provides excellent detail for users and developers. Version detection (Phase 2) is well-specified, file transformation (Phase 3, lines 99–102) is straightforward, and the verification/reporting phases are helpful. The examples in the summary (Phase 5, lines 119–139) are particularly useful for understanding expected behavior.

No blocking issues; the cron schedule randomization logic (flagged above) warrants clarification but does not prevent understanding the overall approach.

Copy link

@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: 1

🧹 Nitpick comments (1)
plugins/prow-job/commands/bump-release-version.md (1)

36-139: Document error handling and edge cases.

The implementation guide is well-structured but would benefit from explicit documentation of error scenarios and edge cases:

  • What happens if a config file cannot be found or is unreadable?
  • What if the version cannot be detected from the file (all four sources missing or conflicting)?
  • How does the command handle files where version detection finds conflicting values across sources?
  • Should the command validate that bumped versions are "realistic" (e.g., not bumping 4.99 to 4.100)?

Consider adding an "Error Handling" section before or after the Implementation phases to document these scenarios and the expected behavior.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 6aaf002 and f74f7b2.

📒 Files selected for processing (3)
  • PLUGINS.md (1 hunks)
  • docs/data.json (1 hunks)
  • plugins/prow-job/commands/bump-release-version.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • PLUGINS.md
  • docs/data.json
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
plugins/prow-job/commands/bump-release-version.md

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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)

🔇 Additional comments (2)
plugins/prow-job/commands/bump-release-version.md (2)

73-86: Cron frequency preservation logic is well-documented.

The specification of how cron schedules are preserved while randomizing timing (randomize MINUTE/HOUR, preserve MONTH pattern and DOW, randomize DAY with same count) is clear and thorough. The examples effectively illustrate the frequency preservation across different patterns (f7, f14, f28, f60).


1-3: Documentation structure and implementation phases are clear.

The YAML frontmatter, section organization, and five-phase implementation breakdown provide clear guidance for both users and developers. The version detection sources (filename pattern, base_images, releases, zz_generated_metadata) and target version calculation logic are well-documented with concrete examples.

Also applies to: 38-64

Comment on lines +9 to +11
```
/prow-job:bump-release-version <config-file>[,<config-file>...] [--bump=N]
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add language specifiers to all fenced code blocks.

Markdown best practices require specifying a language identifier for all fenced code blocks to enable syntax highlighting. The blocks at these lines are missing language specifiers:

  • Lines 9-11, 20-22, 26-28, 32-34: Use ```bash or ```shell
  • Lines 88-97: Use ```text (for example output) or ```bash
  • Lines 118-139: Use ```text (for example output)

Apply this diff to fix the code block at line 9 as an example:

-```
+```bash
 /prow-job:bump-release-version <config-file>[,<config-file>...] [--bump=N]
-```
+```

Repeat this pattern for the remaining code blocks.

Also applies to: 20-22, 26-28, 32-34, 88-97, 118-139

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

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

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In plugins/prow-job/commands/bump-release-version.md around lines 9-11, 20-22,
26-28, 32-34, 88-97 and 118-139, several fenced code blocks are missing language
specifiers; update each opening fence to include the appropriate language (use
```bash or ```shell for command examples at lines 9-11, 20-22, 26-28, 32-34, use
```text or ```bash for example output at 88-97, and use ```text for example
output at 118-139), following the provided diff pattern (replace ``` with
```bash or ```text as appropriate) so every fenced block has a language
identifier.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant