-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
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-latest-release | ||
| 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-latest-release | ||
| 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 @@ | ||
| ../OWNERS |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| dnf install -y git | ||
|
|
||
| HOME="$(mktemp -d -t ff-XXXXX)" | ||
| export HOME | ||
| cd | ||
|
|
||
| log_file="${ARTIFACT_DIR}/fastforward.log" | ||
| log() { | ||
| echo "$(date --iso-8601=seconds)" "$@" | tee -a "$log_file" | ||
| } | ||
|
|
||
| # git_wrapper invokes the `git` CLI with | ||
| # - creds in a way that doesn't reveal them in logs, env, or process table. | ||
| # - logging | ||
| git_wrapper() { | ||
| git -c credential.helper= -c credential.helper='!f() { echo username=openshift-merge-robot; printf password=; cat /etc/github/oauth; echo; }; f' "$@" 2>&1 | 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" | ||
|
|
||
|
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. Since DESTINATION_BRANCH can be "", and
Member
Author
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. Talked through this with the rabbit above. Since we control the invocation very tightly, I'm pretty unworried about this kind of thing. The error we would get organically isn't inscrutable enough to warrant the extra script clutter IMO: But if you feel strongly about it I'll add the extra checks.
Member
Author
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. It would be nice if the
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. Yes, the |
||
| repo_url="https://github.com/${REPO_OWNER}/${REPO_NAME}.git" | ||
|
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. After the secret works, won’t
Member
Author
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. As noted, the secret won't (and shouldn't) work in rehearsals. And the failure occurs before this script is invoked, so rehearsal-only logic wouldn't help. |
||
|
|
||
| log "INFO Cloning $DESTINATION_BRANCH" | ||
| git_wrapper clone -b "$DESTINATION_BRANCH" "$repo_url" | ||
| cd "$REPO_NAME" | ||
|
|
||
| log "INFO Pulling $SOURCE_BRANCH into $DESTINATION_BRANCH (ff-only)" | ||
| git_wrapper pull --ff-only origin "$SOURCE_BRANCH" | ||
|
|
||
| log "INFO Pushing to origin/$DESTINATION_BRANCH" | ||
| git_wrapper push | ||
|
|
||
| log "INFO Fast-forward complete" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "path": "openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "2uasimojo", | ||
| "bentito", | ||
| "cajieh", | ||
| "Cali0707", | ||
| "dlom", | ||
| "grokspawn", | ||
| "manusa", | ||
| "matzew", | ||
| "Kaustubh-pande", | ||
| "wking" | ||
| ], | ||
| "reviewers": [ | ||
| "2uasimojo", | ||
| "bentito", | ||
| "cajieh", | ||
| "Cali0707", | ||
| "dlom", | ||
| "grokspawn", | ||
| "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: | ||
|
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. This needs git and the image is
Member
Author
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. Gah, no, it doesn't. You won't believe this, but I've been lied to by an LLM. Will fix. (Though still, we won't be able to validate until merged.) |
||
| name: "5.0" | ||
| namespace: ocp | ||
| tag: cli | ||
| 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: | ||
|
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. nit: Should
Member
Author
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. I looked around and that's not being done anywhere else. (Also this file has magical semantics. I don't know this for sure, but it may error if I try to declare vars that are "owned" elsewhere.) I wouldn't actually object to hardcoding |
||
| - name: SOURCE_BRANCH | ||
| default: "main" | ||
| documentation: |- | ||
| The branch to fast-forward FROM. | ||
| - name: DESTINATION_BRANCH | ||
| default: "unset" | ||
|
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. I think there's a danger that someone oopses and doesn't set DESTINATION_BRANCH, so it's then set to "unset" (but it's never checked and someone would have to figure out that it means the string-literal "unset" rather than the logical concept. |
||
| 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,28 @@ | ||
| { | ||
| "path": "openshift/mcp-server/fastforward/openshift-mcp-server-fastforward-workflow.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "2uasimojo", | ||
| "bentito", | ||
| "cajieh", | ||
| "Cali0707", | ||
| "dlom", | ||
| "grokspawn", | ||
| "manusa", | ||
| "matzew", | ||
| "Kaustubh-pande", | ||
| "wking" | ||
| ], | ||
| "reviewers": [ | ||
| "2uasimojo", | ||
| "bentito", | ||
| "cajieh", | ||
| "Cali0707", | ||
| "dlom", | ||
| "grokspawn", | ||
| "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 | ||
| 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.
Given
github-credentials-openshift-merge-robotisn’t on the build farm, should this job be pinned toapp.ciorcore-ciinstead of build01?Uh oh!
There was an error while loading. Please reload this page.
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.
This file is generated.
IIUC the secret not existing for rehearsals is deliberate (otherwise a malicious or merely hapless actor would be able to do privileged things just by proposing and rehearsing a PR). It should be present when this runs for real.
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.
This ended up being a good callout. I'm trying to figure out how to pin the job to a cluster. (I don't think I'm allowed to change it here, because there are CI jobs that make sure that generated files aren't changed. But I've been surprised on that count in the past.)