openshift-mcp-server: Auto-ff daily - #83135
Conversation
|
Skipping CI for Draft Pull Request. |
3696cd3 to
7c615b6
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 2uasimojo 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 |
WalkthroughAdds a CI fast-forward command, registers its step and workflow, and schedules a daily job to update the ChangesMCP server fast-forward automation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ScheduledJob
participant CIWorkflow
participant FastforwardStep
participant GitRepository
ScheduledJob->>CIWorkflow: run daily at 06:00 UTC
CIWorkflow->>FastforwardStep: invoke fast-forward workflow
FastforwardStep->>GitRepository: clone source or destination branch
FastforwardStep->>GitRepository: fast-forward destination with --ff-only
FastforwardStep->>GitRepository: push release-0.4
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: claude
7c615b6 to
050c2ad
Compare
|
[REHEARSALNOTIFIER]
Prior to this PR being merged, you will need to either run and acknowledge or opt to skip these rehearsals. Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
|
[REHEARSALNOTIFIER]
Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
1 similar comment
|
[REHEARSALNOTIFIER]
Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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.
Inline comments:
In
`@ci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-commands.sh`:
- Around line 30-36: Update the destination-branch clone handling in the
fast-forward command script so only a confirmed missing $DESTINATION_BRANCH
enters the fallback clone and branch-creation path. Preserve and propagate
authentication, network, repository, and server errors instead of treating them
as absent branches; use the existing git/logging flow and symbols without
changing successful clone behavior.
- Around line 16-25: Update the fast-forward script’s startup validation to
check both SOURCE_BRANCH and DESTINATION_BRANCH before the settings log, using
${SOURCE_BRANCH:-} so an unset or empty source is rejected safely under set -u.
Preserve the existing error-and-exit behavior, then allow logging and subsequent
git clone operations only after both branch values are valid.
In
`@ci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-workflow.yaml`:
- Around line 3-5: Update the workflow’s steps declaration to include empty pre
and post phases alongside the existing test phase, preserving the
openshift-mcp-server-fastforward test reference. Then run make
validate-step-registry to verify the step registry.
🪄 Autofix
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: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: b753127d-7919-4dc0-9a94-015ed402f3e1
⛔ Files ignored due to path filters (1)
ci-operator/jobs/openshift/openshift-mcp-server/openshift-openshift-mcp-server-main-periodics.yamlis excluded by!ci-operator/jobs/**
📒 Files selected for processing (7)
ci-operator/config/openshift/openshift-mcp-server/openshift-openshift-mcp-server-main.yamlci-operator/step-registry/openshift/mcp-server/fastforward/OWNERSci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-commands.shci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-ref.metadata.jsonci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-ref.yamlci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-workflow.metadata.jsonci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-workflow.yaml
| log "INFO Fast-forward settings" | ||
| log " REPO_OWNER = $REPO_OWNER" | ||
| log " REPO_NAME = $REPO_NAME" | ||
| log " SOURCE_BRANCH = $SOURCE_BRANCH" | ||
| log " DESTINATION_BRANCH = $DESTINATION_BRANCH" | ||
|
|
||
| if [[ -z "$DESTINATION_BRANCH" ]]; then | ||
| log "ERROR DESTINATION_BRANCH may not be empty" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Validate SOURCE_BRANCH before logging and cloning.
The reference supplies main by default, but an override can be empty. The script checks only DESTINATION_BRANCH; an empty source reaches both git clone -b calls, and an unset source exits at the settings log because set -u runs before validation. Move both branch checks before the settings log and reject ${SOURCE_BRANCH:-}.
The analogous ci-operator/step-registry/windows/ci/fastforward/windows-ci-fastforward-commands.sh:114-122 validates both branch variables.
Proposed validation order
-log "INFO Fast-forward settings"
-log " REPO_OWNER = $REPO_OWNER"
-log " REPO_NAME = $REPO_NAME"
-log " SOURCE_BRANCH = $SOURCE_BRANCH"
-log " DESTINATION_BRANCH = $DESTINATION_BRANCH"
-
-if [[ -z "$DESTINATION_BRANCH" ]]; then
+if [[ -z "${SOURCE_BRANCH:-}" ]]; then
+ log "ERROR SOURCE_BRANCH may not be empty"
+ exit 1
+fi
+if [[ -z "${DESTINATION_BRANCH:-}" ]]; then
log "ERROR DESTINATION_BRANCH may not be empty"
exit 1
fi
+
+log "INFO Fast-forward settings"
+log " REPO_OWNER = $REPO_OWNER"
+log " REPO_NAME = $REPO_NAME"
+log " SOURCE_BRANCH = $SOURCE_BRANCH"
+log " DESTINATION_BRANCH = $DESTINATION_BRANCH"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| log "INFO Fast-forward settings" | |
| log " REPO_OWNER = $REPO_OWNER" | |
| log " REPO_NAME = $REPO_NAME" | |
| log " SOURCE_BRANCH = $SOURCE_BRANCH" | |
| log " DESTINATION_BRANCH = $DESTINATION_BRANCH" | |
| if [[ -z "$DESTINATION_BRANCH" ]]; then | |
| log "ERROR DESTINATION_BRANCH may not be empty" | |
| exit 1 | |
| fi | |
| if [[ -z "${SOURCE_BRANCH:-}" ]]; then | |
| log "ERROR SOURCE_BRANCH may not be empty" | |
| exit 1 | |
| fi | |
| if [[ -z "${DESTINATION_BRANCH:-}" ]]; then | |
| log "ERROR DESTINATION_BRANCH may not be empty" | |
| exit 1 | |
| fi | |
| log "INFO Fast-forward settings" | |
| log " REPO_OWNER = $REPO_OWNER" | |
| log " REPO_NAME = $REPO_NAME" | |
| log " SOURCE_BRANCH = $SOURCE_BRANCH" | |
| log " DESTINATION_BRANCH = $DESTINATION_BRANCH" |
🤖 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
`@ci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-commands.sh`
around lines 16 - 25, Update the fast-forward script’s startup validation to
check both SOURCE_BRANCH and DESTINATION_BRANCH before the settings log, using
${SOURCE_BRANCH:-} so an unset or empty source is rejected safely under set -u.
Preserve the existing error-and-exit behavior, then allow logging and subsequent
git clone operations only after both branch values are valid.
| log "INFO Cloning $DESTINATION_BRANCH" | ||
| if ! git clone -b "$DESTINATION_BRANCH" "$repo_url" 2>&1 | tee -a "$log_file"; then | ||
| log "INFO $DESTINATION_BRANCH does not exist, creating from $SOURCE_BRANCH" | ||
| if ! git clone -b "$SOURCE_BRANCH" "$repo_url" 2>&1 | tee -a "$log_file"; then | ||
| log "ERROR Could not clone $SOURCE_BRANCH" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Do not treat every destination clone failure as a missing branch.
The condition also catches authentication, network, repository, and server failures. The script then retries from the source branch and may attempt an unnecessary branch creation and push. Distinguish a missing destination branch from other clone failures before entering the creation path.
🤖 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
`@ci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-commands.sh`
around lines 30 - 36, Update the destination-branch clone handling in the
fast-forward command script so only a confirmed missing $DESTINATION_BRANCH
enters the fallback clone and branch-creation path. Preserve and propagate
authentication, network, repository, and server errors instead of treating them
as absent branches; use the existing git/logging flow and symbols without
changing successful clone behavior.
| steps: | ||
| test: | ||
| - ref: openshift-mcp-server-fastforward |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
file='ci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-workflow.yaml'
printf '%s\n' '--- workflow ---'
cat -n "$file"
printf '%s\n' '--- related workflow phase declarations ---'
rg -n -U 'phases:|^[[:space:]]+(pre|test|post):' \
ci-operator/step-registry/openshift/mcp-server \
ci-operator/step-registry/openshift -g '*-workflow.yaml' | head -200
printf '%s\n' '--- workflow validation references ---'
rg -n 'validate-step-registry|workflow.*pre|workflow.*post|^[[:space:]]*pre:|^[[:space:]]*post:' \
Makefile ci-operator/step-registry hack 2>/dev/null | head -240
printf '%s\n' '--- referenced step ---'
rg -n -U 'name: openshift-mcp-server-fastforward|openshift-mcp-server-fastforward' \
ci-operator/step-registry | head -120
printf '%s\n' '--- file status ---'
git status --short -- "$file"
git diff --stat -- "$file"Repository: openshift/release
Length of output: 50373
🏁 Script executed:
#!/bin/bash
set -eu
file='ci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-workflow.yaml'
printf '%s\n' '--- validation target ---'
sed -n '155,178p' Makefile
printf '%s\n' '--- validator implementation references ---'
rg -n -i --glob '*.go' --glob '*.sh' --glob '*.py' \
'validate-step-registry|step-registry.*valid|workflow.*phase|pre.*test.*post' . \
| head -160
printf '%s\n' '--- exact phase-shape examples ---'
for f in \
ci-operator/step-registry/telco5g/kpi-results/telco5g-kpi-results-workflow.yaml \
ci-operator/step-registry/openshift/edge-tooling/agent-eval/openshift-edge-tooling-agent-eval-workflow.yaml \
ci-operator/step-registry/openshift/agentic/trt/jira-solver/openshift-agentic-trt-jira-solver-workflow.yaml
do
if test -f "$f"; then
echo "--- $f"
cat -n "$f"
fi
done
printf '%s\n' '--- file tracking and change status ---'
git ls-files --error-unmatch "$file"
git diff --name-status -- "$file"
git diff --numstat -- "$file"
printf '%s\n' '--- referenced step definitions ---'
rg -n -C 3 '^name: openshift-mcp-server-fastforward$|^ as: openshift-mcp-server-fastforward$|ref: openshift-mcp-server-fastforward' \
ci-operator/step-registryRepository: openshift/release
Length of output: 7119
Declare the required pre, test, and post phases.
Add empty pre: [] and post: [] phases, then run make validate-step-registry.
🤖 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
`@ci-operator/step-registry/openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-workflow.yaml`
around lines 3 - 5, Update the workflow’s steps declaration to include empty pre
and post phases alongside the existing test phase, preserving the
openshift-mcp-server-fastforward test reference. Then run make
validate-step-registry to verify the step registry.
Source: Coding guidelines
Co-Authored-By: claude
Summary by CodeRabbit
This PR adds daily OpenShift CI automation for the
openshift/openshift-mcp-serverrepository.fast-forward-release-0-4job daily at 06:00 UTC.mainfrom therelease-0.4branch.