OCPERT-349: Add job command for running Stage testing prow job#969
OCPERT-349: Add job command for running Stage testing prow job#969tomasdavidorg wants to merge 3 commits into
Conversation
|
@tomasdavidorg: This pull request references OCPERT-349 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds two new CLI docs and implements stage-testing support: payload URL validation, minor-release extraction, Gangway job submission (with timeout), response handling, job ID extraction, and polling for results; exposes ChangesDocumentation updates
Stage-testing and Gangway integration
Sequence DiagramsequenceDiagram
participant User as CLI User
participant CLI as Click command
participant Jobs as Jobs.run_stage_testing
participant Gangway as Gangway API
participant Results as get_job_results (poll)
User->>CLI: invoke run_stage_testing --payload-url
CLI->>Jobs: run_stage_testing(payload_url)
Jobs->>Jobs: validate payload, extract minor release, build job name
Jobs->>Gangway: POST /jobs (RELEASE_IMAGE_LATEST, timeout=30s)
Gangway-->>Jobs: 200 + { id }
Jobs->>Results: get_job_results(job_id, poll=true)
Results->>Gangway: poll job status
Gangway-->>Results: final job status/result
Results-->>Jobs: return job result dict
Jobs-->>CLI: print/return final result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 12✅ Passed checks (12 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
[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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@prow/job/job.py`:
- Around line 440-444: The Gangway POST call at job_run_res =
self._get_session().post(...) has no timeout and can hang; add a timeout kwarg
to the post call (for example timeout=self.request_timeout or timeout=10) so the
request will fail fast on network stalls, and if you choose a configurable value
add a request_timeout attribute (or a constant) to the class and use that in the
call; update the post invocation in job_run_res to include
timeout=<configured_value>.
In `@prow/README.md`:
- Around line 93-97: The README wording "shipment MR" is inconsistent with the
CLI option; update the README example and description for the
run_image_consistency_check command to refer to the merge request ID and the
actual flag name used by the CLI (--mr-id / -m), e.g., change "shipment MR" to
"merge request ID (MR) via -m/--mr-id" and ensure the sample invocation and
explanatory text match the option implemented in the job
run_image_consistency_check command and the CLI option --mr-id in
prow/job/job.py.
🪄 Autofix (Beta)
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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 71d18871-07d9-4be6-929c-f57cd920fc02
📒 Files selected for processing (2)
prow/README.mdprow/job/job.py
|
/retest |
|
@LuboTerifaj please take a look |
|
@tomasdavidorg: This pull request references OCPERT-349 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. 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. |
|
@tomasdavidorg: all tests passed! 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. |
| return re.match(pattern, payload_url) is not None | ||
|
|
||
|
|
||
| def _get_minor_release_from_payload_url(self, payload_url): |
There was a problem hiding this comment.
Nice to have a return type for this method
def _get_minor_release_from_payload_url(self, payload_url: str) -> str:
| Returns: | ||
| A dictionary containing the job info. | ||
| """ | ||
|
|
There was a problem hiding this comment.
Looks like unrelated whitespace change
|
|
||
| if not self._is_valid_payload_url(payload_url): | ||
| raise Exception(f"Invalid payload URL: {payload_url}") | ||
|
|
There was a problem hiding this comment.
As we are adding check for payload_url I think we can also validate mr_id . May be in separate PR.
|
@tomasdavidorg Overall changes looks good to me except some minor changes commented above. WDYT about adding unit test for the new functionalities introduced in this PR? I will update here the status of prow job once it completes. Thank you ! |
|
The job |
https://redhat.atlassian.net/browse/OCPERT-349
Summary by CodeRabbit
New Features
run_stage_testingcommand to submit stage-testing jobs using a release payload URL parameter.run_image_consistency_checkcommand to validate image consistency with a payload URL and optional merge request ID.Documentation