Skip to content

Commit 0491495

Browse files
openshift-pipelines-botopenshift-pipelines-bot
authored andcommitted
[bot:next] update konflux configuration
Generated by workflow [Generate konflux configurations](https://github.com/openshift-pipelines/hack/actions/runs/28498009073) Triggered by pramodbindal
1 parent e2b3633 commit 0491495

4 files changed

Lines changed: 87 additions & 62 deletions

File tree

.github/workflows/auto-merge-upstream.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
pr_list=$(gh pr list \
2626
--state open \
2727
--base next \
28-
--search 'label:upstream,label:hack -label:do-not-merge/hold' \
28+
--search 'label:upstream,hack,automated -label:do-not-merge/hold' \
2929
--json number \
3030
--jq '.[]|.number')
3131
3232
success_pr_list=$(gh pr list \
3333
--state open \
3434
--base next \
35-
--search 'label:upstream,label:hack -label:do-not-merge/hold' \
35+
--search 'label:upstream,hack,automated -label:do-not-merge/hold' \
3636
--json number,title,statusCheckRollup \
37-
--jq ' .[]| select((.statusCheckRollup // [])| all(.conclusion == "SUCCESS" or .conclusion == "SKIPPED"))| "\(.number)"')
37+
--jq ' .[]| select((.statusCheckRollup // [])| all(.conclusion == "SUCCESS" or .conclusion == "SKIPPED" or .conclusion == "NEUTRAL"))| "\(.number)"')
3838
3939
echo "pr_list=$pr_list" >> "$GITHUB_OUTPUT"
4040
echo "success_pr_list=$success_pr_list" >> "$GITHUB_OUTPUT"

.github/workflows/update-sources.yaml

Lines changed: 78 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,92 @@ on:
44
workflow_dispatch: {}
55
push:
66
branches:
7-
- next
7+
- next
88
paths:
9-
- .github/workflows/update-sources.yaml
9+
- .github/workflows/update-sources.yaml
1010
jobs:
1111
update-sources:
12+
# This line prevents the job from running if CodeFreeze is true
13+
if: true
1214
runs-on: ubuntu-latest
1315
permissions:
1416
contents: write
1517
pull-requests: write
1618
steps:
17-
- name: Checkout the current repo
18-
uses: actions/checkout@v4
19-
with:
20-
ref: next
19+
- name: Checkout the current repo
20+
uses: actions/checkout@v4
21+
with:
22+
ref: next
2123

22-
- name: Clone tektoncd-catalog/git-clone
23-
run: |
24-
rm -fR upstream
25-
git clone https://github.com/tektoncd-catalog/git-clone upstream
26-
pushd upstream
27-
git checkout -B release-v1.2.x origin/release-v1.2.x
28-
popd
29-
- name: Commit new changes
30-
run: |
24+
- name: Clone tektoncd-catalog/git-clone
25+
run: |
26+
rm -fR upstream
27+
git clone https://github.com/tektoncd-catalog/git-clone upstream
28+
pushd upstream
29+
git checkout -B release-v1.7.x origin/release-v1.7.x
30+
popd
31+
- name: update-rpms
32+
continue-on-error: true
33+
run: |
34+
set -x
35+
export BASE_IMAGE=$(grep -h "RUNTIME=" .konflux/dockerfiles/* | sed -E 's/.*RUNTIME=["'\'']?([^"'\'' ]+).*/\1/' | head -n 1)
36+
docker run --rm\
37+
-e BASE_IMAGE=$BASE_IMAGE \
38+
-v ./.konflux/rpms/:/rpms -w /rpms $BASE_IMAGE sh -c "
39+
cp -f /etc/yum.repos.d/*.repo ./
40+
sed -i 's/^\[ubi-9-/\[ubi-9-for-\$basearch-/' *.repo
41+
"
42+
docker run --rm\
43+
-e BASE_IMAGE=$BASE_IMAGE \
44+
-v ./.konflux/rpms/:/rpms -w /rpms registry.access.redhat.com/ubi9/ubi-minimal:latest sh -c "
45+
microdnf update -y && microdnf install -y python3-dnf skopeo pip
46+
python3 -m pip install https://github.com/konflux-ci/rpm-lockfile-prototype/archive/refs/tags/v0.21.0.tar.gz
47+
rpm-lockfile-prototype --image $BASE_IMAGE rpms.in.yaml
48+
"
49+
- name: Commit new changes
50+
run: |
3151
32-
set -x
52+
set -x
3353
34-
git config user.name openshift-pipelines-bot
35-
git config user.email pipelines-extcomm@redhat.com
36-
git checkout -b actions/update/sources-next
37-
touch head
38-
pushd upstream
39-
OLD_COMMIT=$(cat ../head)
40-
NEW_COMMIT=$(git rev-parse HEAD)
41-
echo Previous commit: ${OLD_COMMIT}
42-
git show --stat ${OLD_COMMIT}
43-
echo New commit: ${NEW_COMMIT}
44-
git show --stat ${NEW_COMMIT}
45-
git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} > /tmp/diff.txt
46-
git rev-parse HEAD > ../head
47-
popd
48-
rm -rf upstream/.git
49-
git add -f upstream head .konflux
50-
51-
if [[ -z $(git status --porcelain --untracked-files=no) ]]; then
52-
echo "No change, exiting"
53-
exit 0
54-
fi
55-
56-
git commit -F- <<EOF
57-
[bot] Update next from tektoncd-catalog/git-clone to ${NEW_COMMIT}
58-
59-
$ git diff --stat ${NEW_COMMIT}..${OLD_COMMIT}
60-
$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)
61-
62-
https://github.com/tektoncd-catalog/git-clone/compare/${NEW_COMMIT}..${OLD_COMMIT}
63-
EOF
64-
65-
git push -f origin actions/update/sources-next
66-
67-
if [ "$(gh pr list --base next --head actions/update/sources-next --json url --jq 'length')" = "0" ]; then
68-
echo "creating PR..."
69-
gh pr create -B next -H actions/update/sources-next --label=automated --label=upstream --fill
70-
else
71-
echo "a PR already exists, editing..."
72-
gh pr edit --title "[bot] Update next from tektoncd-catalog/git-clone to ${NEW_COMMIT}" --body "$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)"
73-
fi
74-
env:
75-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
git config user.name openshift-pipelines-bot
55+
git config user.email pipelines-extcomm@redhat.com
56+
git checkout -b actions/update/sources-next
57+
touch head
58+
pushd upstream
59+
OLD_COMMIT=$(cat ../head)
60+
NEW_COMMIT=$(git rev-parse HEAD)
61+
echo Previous commit: ${OLD_COMMIT}
62+
git show --stat ${OLD_COMMIT}
63+
echo New commit: ${NEW_COMMIT}
64+
git show --stat ${NEW_COMMIT}
65+
git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} > /tmp/diff.txt
66+
git rev-parse HEAD > ../head
67+
popd
68+
rm -rf upstream/.git
69+
git add -f upstream head .konflux
70+
71+
if [[ -z $(git status --porcelain --untracked-files=no) ]]; then
72+
echo "No change, exiting"
73+
exit 0
74+
fi
75+
76+
git commit -F- <<EOF
77+
[bot] Update next from tektoncd-catalog/git-clone:release-v1.7.x to ${NEW_COMMIT}
78+
79+
$ git diff --stat ${NEW_COMMIT}..${OLD_COMMIT}
80+
$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)
81+
82+
https://github.com/tektoncd-catalog/git-clone/compare/${NEW_COMMIT}..${OLD_COMMIT}
83+
EOF
84+
85+
git push -f origin actions/update/sources-next
86+
87+
if [ "$(gh pr list --base next --head actions/update/sources-next --json url --jq 'length')" = "0" ]; then
88+
echo "creating PR..."
89+
gh pr create -B next -H actions/update/sources-next --label=automated --label=upstream --fill
90+
else
91+
echo "a PR already exists, editing..."
92+
gh pr edit --title "[bot] Update next from tektoncd-catalog/git-clone:release-v1.7.x to ${NEW_COMMIT}" --body "$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)"
93+
fi
94+
env:
95+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.konflux/dockerfiles/git-init.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GO_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.25
1+
ARG GO_BUILDER=registry.access.redhat.com/ubi9/go-toolset:latest
22
ARG RUNTIME=registry.access.redhat.com/ubi9/ubi-minimal:latest
33

44
FROM $GO_BUILDER AS builder

.tekton/tektoncd-git-clone-next-git-init-push.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ spec:
3939
- name: prefetch-input
4040
value: |
4141
{"type": "rpm", "path": ".konflux/rpms"}
42+
- name: repo-name
43+
value: "tektoncd-git-clone"
44+
- name: slack-group-ids
45+
value:
46+
- "S04UX12MX8B"
4247
pipelineRef:
4348
name: docker-build-ta
4449
taskRunTemplate:

0 commit comments

Comments
 (0)