Skip to content

OADP-8508: Fix schedule create examples showing velero instead of oc oadp - #243

Merged
openshift-merge-bot[bot] merged 1 commit into
migtools:oadp-devfrom
NicholasYancey:fix-schedule-create-example
Jul 29, 2026
Merged

OADP-8508: Fix schedule create examples showing velero instead of oc oadp#243
openshift-merge-bot[bot] merged 1 commit into
migtools:oadp-devfrom
NicholasYancey:fix-schedule-create-example

Conversation

@NicholasYancey

@NicholasYancey NicholasYancey commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Why the changes were made

oc oadp schedule create --help showed examples using velero create schedule NAME instead of oc oadp schedule create NAME. This is because Velero's upstream schedule create command hardcodes its examples in verb-first order (velero create schedule), while every other command uses resource-first order (velero backup create), which is the only pattern the CLI's velero to oadp cli replacement logic recognized. Users who copied the broken example got command not found: velero.
Fixes OADP-8508.

How to test the changes made

go build -o kubectl-oadp .
./kubectl-oadp schedule create --help

Summary by CodeRabbit

  • Bug Fixes

    • Improved conversion of verb-first Velero commands, such as velero create schedule, into the correct OADP command format.
    • Ensured schedule examples—including @every notation—are consistently updated.
  • Tests

    • Added coverage for verb-first schedule command conversion.

@NicholasYancey NicholasYancey self-assigned this Jul 29, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 29, 2026

Copy link
Copy Markdown

@NicholasYancey: This pull request references OADP-8508 which is a valid jira issue.

Details

In response to this:

Why the changes were made

oc oadp schedule create --help showed examples using velero create schedule NAME instead of oc oadp schedule create NAME. This is because Velero's upstream schedule create command hardcodes its examples in verb-first order (velero create schedule), while every other command uses resource-first order (velero backup create), which is the only pattern the CLI's velero to oadp cli replacement logic recognized. Users who copied the broken example got command not found: velero.
Fixes OADP-8508.

How to test the changes made

go build -o kubectl-oadp .
./kubectl-oadp schedule create --help

Instructions 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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds normalization for verb-first Velero create examples and verifies schedule command conversion through a unit test.

Changes

Velero command normalization

Layer / File(s) Summary
Command normalization and validation
cmd/root.go, cmd/root_test.go
Adds matching for velero create <resource>, normalizes it to oc oadp <resource> create, and tests schedule examples including @every notation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: joeavaikath

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing schedule create examples to use oc oadp instead of velero.
Description check ✅ Passed The description includes both required sections and explains the fix plus basic test steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@openshift-ci-robot

openshift-ci-robot commented Jul 29, 2026

Copy link
Copy Markdown

@NicholasYancey: This pull request references OADP-8508 which is a valid jira issue.

Details

In response to this:

Why the changes were made

oc oadp schedule create --help showed examples using velero create schedule NAME instead of oc oadp schedule create NAME. This is because Velero's upstream schedule create command hardcodes its examples in verb-first order (velero create schedule), while every other command uses resource-first order (velero backup create), which is the only pattern the CLI's velero to oadp cli replacement logic recognized. Users who copied the broken example got command not found: velero.
Fixes OADP-8508.

How to test the changes made

go build -o kubectl-oadp .
./kubectl-oadp schedule create --help

Summary by CodeRabbit

  • Bug Fixes

  • Improved conversion of verb-first Velero commands, such as velero create schedule, into the correct OADP command format.

  • Ensured schedule examples—including @every notation—are consistently updated.

  • Tests

  • Added coverage for verb-first schedule command conversion.

Instructions 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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
cmd/root_test.go (1)

224-250: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the complete rewritten example.

The current assertions can pass even if the replacement drops or reorders the --schedule arguments. Compare cmd.Example with the full expected string to protect the entire help example.

🤖 Prompt for 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.

In `@cmd/root_test.go` around lines 224 - 250, Update
TestReplaceVeleroWithOADP_ScheduleCreateVerbFirst to compare cmd.Example against
the complete expected rewritten example, including both oc oadp schedule create
NAME commands and their original --schedule arguments. Replace the
substring/count assertions with an exact string assertion so dropped or
reordered arguments are detected.
🤖 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.

Nitpick comments:
In `@cmd/root_test.go`:
- Around line 224-250: Update TestReplaceVeleroWithOADP_ScheduleCreateVerbFirst
to compare cmd.Example against the complete expected rewritten example,
including both oc oadp schedule create NAME commands and their original
--schedule arguments. Replace the substring/count assertions with an exact
string assertion so dropped or reordered arguments are detected.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1ff16638-d35b-4ca1-a907-f8755a115440

📥 Commits

Reviewing files that changed from the base of the PR and between 0db1341 and aea1aec.

📒 Files selected for processing (2)
  • cmd/root.go
  • cmd/root_test.go

@shubham-pampattiwar shubham-pampattiwar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Joeavaikath, NicholasYancey, shubham-pampattiwar

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:
  • OWNERS [Joeavaikath,shubham-pampattiwar]

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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 45f99f3 into migtools:oadp-dev Jul 29, 2026
13 checks passed
@NicholasYancey

Copy link
Copy Markdown
Contributor Author

/cherry-pick oadp-1.3

@NicholasYancey
NicholasYancey deleted the fix-schedule-create-example branch July 29, 2026 19:45
@openshift-cherrypick-robot

Copy link
Copy Markdown

@NicholasYancey: new pull request created: #244

Details

In response to this:

/cherry-pick oadp-1.3

Instructions 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.

@NicholasYancey

Copy link
Copy Markdown
Contributor Author

/cherry-pick oadp-1.6

@NicholasYancey

Copy link
Copy Markdown
Contributor Author

/cherry-pick oadp-1.5

@NicholasYancey

Copy link
Copy Markdown
Contributor Author

/cherry-pick oadp-1.4

@openshift-cherrypick-robot

Copy link
Copy Markdown

@NicholasYancey: new pull request created: #245

Details

In response to this:

/cherry-pick oadp-1.6

Instructions 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.

@openshift-cherrypick-robot

Copy link
Copy Markdown

@NicholasYancey: new pull request created: #246

Details

In response to this:

/cherry-pick oadp-1.5

Instructions 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.

@openshift-cherrypick-robot

Copy link
Copy Markdown

@NicholasYancey: new pull request created: #247

Details

In response to this:

/cherry-pick oadp-1.4

Instructions 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.

kaovilai added a commit to kaovilai/github-bot-command-palette that referenced this pull request Jul 31, 2026
migtools/oadp-cli#243 shows the openshift-cherrypick-robot flow:
commenting "/cherry-pick <branch>" makes the robot open a cherry-pick
PR per target branch.

- config-manager.js: new "Cherry-pick..." command in the universal Prow
  profile using the job-picker UI with a new 'branches' job source;
  multi-selecting branches posts one "/cherry-pick <branch>" line per
  branch in a single comment (the cherrypicker plugin matches every
  line). Schema v9 so built-in profiles refresh.
- background.js: getRepoBranches handler fetches up to 300 branches
  from the GitHub API, sorting long-lived release branches (no "/")
  before bot/feature branches like dependabot/* and copilot/*.
- background.js: extractPlugins now also reads the external_plugins
  section of _pluginconfig.yaml — cherrypick, needs-rebase, refresh
  etc. are external plugins and were invisible to plugin filtering,
  which would have marked the new button as disabled.
- content.js: branch picker wiring with per-repo cache; falls back to a
  free-form input popover when the branch list cannot be fetched.
- settings.html: expose the 'branches' job source in the command editor.

Verified against live data: extractPlugins detects cherrypick for
migtools/oadp-cli, and the branch picker lists oadp-1.3..1.6/oadp-dev
ahead of bot branches. 177/177 tests pass.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Tiger Kaovilai <[email protected]>
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.

5 participants