Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/auto-merge-upstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Generated for Konflux Application openshift-pipelines-core by openshift-pipelines/hack. DO NOT EDIT
name: auto-merge-upstream-openshift-pipelines/syncer-service

on:
workflow_dispatch: {}

jobs:
auto-approve-and-merge:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- id: Checkout the current repo
uses: actions/checkout@v5
- id: list-prs
run: |
echo "Listing PRs"
gh auth status
git config user.name openshift-pipelines-bot
git config user.email pipelines-extcomm@redhat.com
# Approve and merge pull-request with no reviews

pr_list=$(gh pr list \
--state open \
--label upstream \
--json number,title,statusCheckRollup \
--jq ' .[]| select((.statusCheckRollup // [])| all(.conclusion == "SUCCESS" or .conclusion == "SKIPPED"))| "\(.number)"')

echo "pr_list=$pr_list" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- id: add LGTM Label
run: |
# Approve and merge pull-request with no reviews
for p in $pr_list; do
echo "Adding lgtm label to PR $p"
gh pr edit $p --add-label "lgtm" || true
done
env:
pr_list: ${{ steps.list-prs.outputs.pr_list }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: Merging PRs
run: |
# Approve and merge pull-request with no reviews
for p in $pr_list; do
echo "Merging PR $p"
gh pr merge --rebase --delete-branch --auto $p
done
env:
pr_list: ${{ steps.list-prs.outputs.pr_list }}
GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}
72 changes: 72 additions & 0 deletions .github/workflows/update-sources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Generated for Konflux Application openshift-pipelines-core by openshift-pipelines/hack. DO NOT EDIT
name: update-sources-openshift-pipelines/syncer-service
on:
workflow_dispatch: {}

jobs:

update-sources:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout the current repo
uses: actions/checkout@v4
with:
ref: release-v1.22.x

- name: Clone openshift-pipelines/syncer-service
run: |
rm -fR upstream
git clone https://github.com/openshift-pipelines/syncer-service upstream
pushd upstream
git checkout -B release-v0.1.x origin/release-v0.1.x
popd
- name: Commit new changes
run: |

set -x

git config user.name openshift-pipelines-bot
git config user.email pipelines-extcomm@redhat.com
git checkout -b actions/update/sources-release-v1.22.x
touch head
pushd upstream
OLD_COMMIT=$(cat ../head)
NEW_COMMIT=$(git rev-parse HEAD)
echo Previous commit: ${OLD_COMMIT}
git show --stat ${OLD_COMMIT}
echo New commit: ${NEW_COMMIT}
git show --stat ${NEW_COMMIT}
git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} > /tmp/diff.txt
git rev-parse HEAD > ../head
popd
rm -rf upstream/.git
git add -f upstream head .konflux

if [[ -z $(git status --porcelain --untracked-files=no) ]]; then
echo "No change, exiting"
exit 0
fi

git commit -F- <<EOF
[bot] Update release-v1.22.x from openshift-pipelines/syncer-service to ${NEW_COMMIT}

$ git diff --stat ${NEW_COMMIT}..${OLD_COMMIT}
$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)

https://github.com/openshift-pipelines/syncer-service/compare/${NEW_COMMIT}..${OLD_COMMIT}
EOF

git push -f origin actions/update/sources-release-v1.22.x

if [ "$(gh pr list --base release-v1.22.x --head actions/update/sources-release-v1.22.x --json url --jq 'length')" = "0" ]; then
echo "creating PR..."
gh pr create -B release-v1.22.x -H actions/update/sources-release-v1.22.x --label=automated --label=upstream --fill
else
echo "a PR already exists, editing..."
gh pr edit --title "[bot] Update release-v1.22.x from openshift-pipelines/syncer-service to ${NEW_COMMIT}" --body "$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55 changes: 55 additions & 0 deletions .tekton/syncer-service-1-22-controller-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Generated for Konflux Application openshift-pipelines-core by openshift-pipelines/hack. DO NOT EDIT
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
pipelinesascode.tekton.dev/cancel-in-progress: "true" # Cancel in-progress pipelines
pipelinesascode.tekton.dev/pipeline: "https://raw.githubusercontent.com/openshift-pipelines/operator/refs/heads/main/.tekton/docker-build-ta.yaml"
build.appstudio.openshift.io/repo: https://github.com/openshift-pipelines/syncer-service.git?rev={{revision}}
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "release-v1.22.x" &&
("upstream/***".pathChanged() || ".konflux/patches/***".pathChanged() || ".konflux/rpms/***".pathChanged() ||
".konflux/dockerfiles/controller.Dockerfile".pathChanged() ||
".tekton/syncer-service-1-22-controller-pull-request.yaml".pathChanged())
labels:
appstudio.openshift.io/application: openshift-pipelines-core-1-22
appstudio.openshift.io/component: syncer-service-1-22-controller
pipelines.appstudio.openshift.io/type: build
name: syncer-service-1-22-controller-on-pull-request
namespace: tekton-ecosystem-tenant
spec:
params:
- name: git-url
value: '{{source_url}}'
- name: upstream-git-url
value: 'https://github.com/openshift-pipelines/syncer-service'
- name: revision
value: '{{revision}}'
- name: output-image
value: quay.io/redhat-user-workloads/tekton-ecosystem-tenant/pipelines-syncer-service-controller-rhel9:on-pr-{{revision}}
- name: image-expires-after
value: 5d
- name: dockerfile
value: .konflux/dockerfiles/controller.Dockerfile
- name: additional-tags
value:
- "on-pr-1.22.0"
- name: build-platforms
value:
- linux/x86_64
- name: prefetch-input
value: |
{"type": "rpm", "path": ".konflux/rpms"}
pipelineRef:
name: docker-build-ta
taskRunTemplate:
serviceAccountName: build-pipeline-syncer-service-1-22-controller
workspaces:
- name: git-auth
secret:
secretName: '{{ git_auth_secret }}'
status: {}
50 changes: 50 additions & 0 deletions .tekton/syncer-service-1-22-controller-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Generated for Konflux Application openshift-pipelines-core by openshift-pipelines/hack. DO NOT EDIT
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
annotations:
pipelinesascode.tekton.dev/cancel-in-progress: "true" # Cancel in-progress pipelines
pipelinesascode.tekton.dev/pipeline: "https://raw.githubusercontent.com/openshift-pipelines/operator/refs/heads/main/.tekton/docker-build-ta.yaml"
build.appstudio.openshift.io/repo: https://github.com/openshift-pipelines/syncer-service.git?rev={{revision}}
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
== "release-v1.22.x" &&
("upstream/***".pathChanged() || ".konflux/patches/***".pathChanged() || ".konflux/rpms/***".pathChanged() ||
".konflux/dockerfiles/controller.Dockerfile".pathChanged() ||
".tekton/syncer-service-1-22-controller-push.yaml".pathChanged())
creationTimestamp: null
labels:
appstudio.openshift.io/application: openshift-pipelines-core-1-22
appstudio.openshift.io/component: syncer-service-1-22-controller
pipelines.appstudio.openshift.io/type: build
name: syncer-service-1-22-controller-on-push
namespace: tekton-ecosystem-tenant
spec:
params:
- name: git-url
value: '{{source_url}}'
- name: upstream-git-url
value: 'https://github.com/openshift-pipelines/syncer-service'
- name: revision
value: '{{revision}}'
- name: output-image
value: quay.io/redhat-user-workloads/tekton-ecosystem-tenant/pipelines-syncer-service-controller-rhel9:{{revision}}
- name: dockerfile
value: .konflux/dockerfiles/controller.Dockerfile
- name: additional-tags
value:
- "1.22.0"
- name: prefetch-input
value: |
{"type": "rpm", "path": ".konflux/rpms"}
pipelineRef:
name: docker-build-ta
taskRunTemplate:
serviceAccountName: build-pipeline-syncer-service-1-22-controller
workspaces:
- name: git-auth
secret:
secretName: '{{ git_auth_secret }}'
status: {}