OADP-8508: Fix schedule create examples showing velero instead of oc oadp - #243
Conversation
|
@NicholasYancey: This pull request references OADP-8508 which is a valid jira issue. DetailsIn response to this:
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. |
📝 WalkthroughWalkthroughAdds normalization for verb-first Velero create examples and verifies schedule command conversion through a unit test. ChangesVelero command normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
@NicholasYancey: This pull request references OADP-8508 which is a valid jira issue. DetailsIn response to this:
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. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cmd/root_test.go (1)
224-250: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the complete rewritten example.
The current assertions can pass even if the replacement drops or reorders the
--schedulearguments. Comparecmd.Examplewith 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
📒 Files selected for processing (2)
cmd/root.gocmd/root_test.go
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick oadp-1.3 |
|
@NicholasYancey: new pull request created: #244 DetailsIn response to this:
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. |
|
/cherry-pick oadp-1.6 |
|
/cherry-pick oadp-1.5 |
|
/cherry-pick oadp-1.4 |
|
@NicholasYancey: new pull request created: #245 DetailsIn response to this:
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: new pull request created: #246 DetailsIn response to this:
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: new pull request created: #247 DetailsIn response to this:
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. |
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]>
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 --helpSummary by CodeRabbit
Bug Fixes
velero create schedule, into the correct OADP command format.@everynotation—are consistently updated.Tests