-
Notifications
You must be signed in to change notification settings - Fork 2.3k
openshift-mcp-server: Auto-ff daily #83135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| periodics: | ||
| - agent: kubernetes | ||
| cluster: build01 | ||
| cron: 0 6 * * * | ||
| decorate: true | ||
| decoration_config: | ||
| sparse_checkout_files: | ||
| - .ci-operator.yaml | ||
| - Dockerfile.ci | ||
| extra_refs: | ||
| - base_ref: main | ||
| org: openshift | ||
| repo: openshift-mcp-server | ||
| sparse_checkout_files: | ||
| - .ci-operator.yaml | ||
| - Dockerfile.ci | ||
| labels: | ||
| ci.openshift.io/generator: prowgen | ||
| pj-rehearse.openshift.io/can-be-rehearsed: "true" | ||
| name: periodic-ci-openshift-openshift-mcp-server-main-fast-forward-release-0-4 | ||
| spec: | ||
| containers: | ||
| - args: | ||
| - --gcs-upload-secret=/secrets/gcs/service-account.json | ||
| - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson | ||
| - --lease-server-credentials-file=/etc/boskos/credentials | ||
| - --report-credentials-file=/etc/report/credentials | ||
| - --target=fast-forward-release-0-4 | ||
| command: | ||
| - ci-operator | ||
| env: | ||
| - name: HTTP_SERVER_IP | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: status.podIP | ||
| image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest | ||
| imagePullPolicy: Always | ||
| name: "" | ||
| ports: | ||
| - containerPort: 8080 | ||
| name: http | ||
| resources: | ||
| requests: | ||
| cpu: 10m | ||
| volumeMounts: | ||
| - mountPath: /etc/boskos | ||
| name: boskos | ||
| readOnly: true | ||
| - mountPath: /secrets/gcs | ||
| name: gcs-credentials | ||
| readOnly: true | ||
| - mountPath: /secrets/manifest-tool | ||
| name: manifest-tool-local-pusher | ||
| readOnly: true | ||
| - mountPath: /etc/pull-secret | ||
| name: pull-secret | ||
| readOnly: true | ||
| - mountPath: /etc/report | ||
| name: result-aggregator | ||
| readOnly: true | ||
| serviceAccountName: ci-operator | ||
| volumes: | ||
| - name: boskos | ||
| secret: | ||
| items: | ||
| - key: credentials | ||
| path: credentials | ||
| secretName: boskos-credentials | ||
| - name: manifest-tool-local-pusher | ||
| secret: | ||
| secretName: manifest-tool-local-pusher | ||
| - name: pull-secret | ||
| secret: | ||
| secretName: registry-pull-credentials | ||
| - name: result-aggregator | ||
| secret: | ||
| secretName: result-aggregator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| reviewers: | ||
| - 2uasimojo | ||
| - bentito | ||
| - cajieh | ||
| - Cali0707 | ||
| - dlom | ||
| - grokspawn | ||
| - manusa | ||
| - matzew | ||
| - Kaustubh-pande | ||
| approvers: | ||
| - Cali0707 | ||
| - manusa | ||
| - matzew | ||
| - Kaustubh-pande | ||
| component: "openshift-mcp-server" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| tmp_dir=$(mktemp -d -t ff-XXXXX) | ||
| cd "$tmp_dir" || exit 1 | ||
| export HOME="$tmp_dir" | ||
|
|
||
| log_file="${ARTIFACT_DIR}/fastforward.log" | ||
| log() { | ||
| local ts | ||
| ts=$(date --iso-8601=seconds) | ||
| echo "$ts" "$@" | tee -a "$log_file" | ||
| } | ||
|
|
||
| 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 | ||
|
|
||
| token=$(cat /etc/github/oauth) | ||
| repo_url="https://openshift-merge-robot:${token}@github.com/${REPO_OWNER}/${REPO_NAME}.git" | ||
|
|
||
| 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 | ||
|
Comment on lines
+30
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 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 |
||
| cd "$REPO_NAME" || exit 1 | ||
| git checkout -b "$DESTINATION_BRANCH" | ||
| git push -u origin "$DESTINATION_BRANCH" 2>&1 | tee -a "$log_file" | ||
| log "INFO Created and pushed $DESTINATION_BRANCH" | ||
| exit 0 | ||
| fi | ||
|
|
||
| cd "$REPO_NAME" || exit 1 | ||
|
|
||
| log "INFO Pulling $SOURCE_BRANCH into $DESTINATION_BRANCH (ff-only)" | ||
| if ! git pull --ff-only origin "$SOURCE_BRANCH" 2>&1 | tee -a "$log_file"; then | ||
| log "ERROR Could not fast-forward from $SOURCE_BRANCH" | ||
| exit 1 | ||
| fi | ||
|
|
||
| log "INFO Pushing to origin/$DESTINATION_BRANCH" | ||
| if ! git push 2>&1 | tee -a "$log_file"; then | ||
| log "ERROR Could not push to $DESTINATION_BRANCH" | ||
| exit 1 | ||
| fi | ||
|
|
||
| log "INFO Fast-forward complete" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "path": "openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "Cali0707", | ||
| "manusa", | ||
| "matzew", | ||
| "Kaustubh-pande" | ||
| ], | ||
| "reviewers": [ | ||
| "Cali0707", | ||
| "manusa", | ||
| "matzew", | ||
| "Kaustubh-pande" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| ref: | ||
| as: openshift-mcp-server-fastforward | ||
| from_image: | ||
| name: cli | ||
| namespace: ocp | ||
| tag: latest | ||
| commands: openshift-mcp-server-fastforward-commands.sh | ||
| resources: | ||
| requests: | ||
| cpu: 100m | ||
| memory: 100Mi | ||
| credentials: | ||
| - namespace: ci | ||
| name: github-credentials-openshift-merge-robot | ||
| mount_path: /etc/github | ||
| env: | ||
| - name: SOURCE_BRANCH | ||
| default: "main" | ||
| documentation: |- | ||
| The branch to fast-forward FROM. | ||
| - name: DESTINATION_BRANCH | ||
| default: "" | ||
| documentation: |- | ||
| The branch to fast-forward TO. Required. | ||
| documentation: |- | ||
| Fast-forwards a source branch to a destination branch in the | ||
| openshift/openshift-mcp-server GitHub repo using openshift-merge-robot | ||
| credentials. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "path": "openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-workflow.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "Cali0707", | ||
| "manusa", | ||
| "matzew", | ||
| "Kaustubh-pande" | ||
| ], | ||
| "reviewers": [ | ||
| "Cali0707", | ||
| "manusa", | ||
| "matzew", | ||
| "Kaustubh-pande" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| workflow: | ||
| as: openshift-mcp-server-fastforward | ||
| steps: | ||
| test: | ||
| - ref: openshift-mcp-server-fastforward | ||
|
Comment on lines
+3
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 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 Add empty 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| documentation: |- | ||
| Fast-forwards a source branch to a destination branch in the | ||
| openshift/openshift-mcp-server GitHub repo. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Validate
SOURCE_BRANCHbefore logging and cloning.The reference supplies
mainby default, but an override can be empty. The script checks onlyDESTINATION_BRANCH; an empty source reaches bothgit clone -bcalls, and an unset source exits at the settings log becauseset -uruns 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-122validates both branch variables.Proposed validation order
📝 Committable suggestion
🤖 Prompt for AI Agents