Skip to content

Commit 3c64157

Browse files
authored
Merge pull request #23 from cloudlinux/cloudlinux_v20
Rebase leapp-repository on top of almalinux latest version
2 parents 88c8780 + 79581a2 commit 3c64157

File tree

1,003 files changed

+48199
-6481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,003 files changed

+48199
-6481
lines changed

.github/workflows/codespell.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Codespell
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
codespell:
13+
name: Check for spelling errors
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: codespell-project/actions-codespell@master
19+
with:
20+
ignore_words_list: ro,fo,couldn,repositor
21+
skip: "./repos/system_upgrade/common/actors/storagescanner/tests/files/mounts,\
22+
./repos/system_upgrade/el7toel8/actors/networkmanagerreadconfig/tests/files/nm_cfg_file_error,\
23+
./repos/system_upgrade/el8toel9/actors/xorgdrvfact/tests/files/journalctl-xorg-intel,\
24+
./repos/system_upgrade/el8toel9/actors/xorgdrvfact/tests/files/journalctl-xorg-qxl,\
25+
./repos/system_upgrade/el8toel9/actors/xorgdrvfact/tests/files/journalctl-xorg-without-qxl,\
26+
./repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x,\
27+
./etc/leapp/files/device_driver_deprecation_data.json,\
28+
./etc/leapp/files/pes-events.json,\
29+
./etc/leapp/files/repomap.json,\
30+
./repos/system_upgrade/common/files/prod-certs"

.github/workflows/copr-build.yml

-36
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
# https://github.com/redhat-plumbers-in-action/differential-shellcheck#readme
3+
4+
name: Differential ShellCheck
5+
on:
6+
pull_request:
7+
branches: [master]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
security-events: write
18+
pull-requests: write
19+
20+
steps:
21+
- name: Repository checkout
22+
uses: actions/checkout@v3
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Differential ShellCheck
27+
uses: redhat-plumbers-in-action/differential-shellcheck@v3
28+
with:
29+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr-welcome-msg.yml

+18-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,24 @@ jobs:
1919
issue-number: ${{ github.event.pull_request.number }}
2020
body: |
2121
## **Thank you for contributing to the Leapp project!**
22-
Please note that every PR needs to comply with the [Leapp Guidelines](https://leapp.readthedocs.io/en/latest/contributing.html#) and must pass all tests in order to be mergable.
23-
If you want to re-run tests or request review, you can use following commands as a comment:
24-
- **leapp-ci build** to run copr build and e2e tests in **OAMG CI**
25-
- **review please** to notify leapp developers of review request
22+
Please note that every PR needs to comply with the [Leapp Guidelines](https://leapp.readthedocs.io/en/latest/contributing.html#) and must pass all tests in order to be mergeable.
23+
If you want to request a review or rebuild a package in copr, you can use following commands as a comment:
24+
- **review please @oamg/developers** to notify leapp developers of the review request
25+
- **/packit copr-build** to submit a public copr build using packit
26+
27+
Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp from PR#42, use `/packit test oamg/leapp#42`
28+
29+
It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported, `beaker-minimal` and `kernel-rt`, both can be used to be run on all upgrade paths or just a couple of specific ones.
30+
To launch on-demand tests with packit:
31+
- **/packit test --labels kernel-rt** to schedule `kernel-rt` tests set for all upgrade paths
32+
- **/packit test --labels beaker-minimal-8.9to9.3,kernel-rt-8.9to9.3** to schedule `kernel-rt` and `beaker-minimal` test sets for 8.9->9.3 upgrade path
33+
34+
[Deprecated] To launch on-demand regression testing public members of oamg organization can leave the following comment:
35+
- **/rerun** to schedule basic regression tests using this pr build and latest upstream leapp build as artifacts
36+
- **/rerun 42** to schedule basic regression tests using this pr build and leapp\*PR42\* as artifacts
37+
- **/rerun-sst** to schedule sst tests using this pr build and latest upstream leapp build as artifacts
38+
- **/rerun-sst 42** to schedule sst tests using this pr build and leapp\*PR42\* as artifacts
2639
2740
Please [open ticket](https://url.corp.redhat.com/oamg-ci-issue) in case you experience technical problem with the CI. (RH internal only)
2841
29-
**Note:** In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please consider rerunning the CI by commenting **leapp-ci build** (might require several comments). If the problem persists, contact leapp-infra.
42+
**Note:** In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra.
+163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: reuse-copr-build@TF
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
FEDORA_COPR_LOGIN:
7+
required: true
8+
FEDORA_COPR_TOKEN:
9+
required: true
10+
outputs:
11+
artifacts:
12+
description: "A string with test artifacts to install in tft test env"
13+
value: ${{ jobs.reusable_workflow_copr_build_job.outputs.artifacts }}
14+
15+
jobs:
16+
reusable_workflow_copr_build_job:
17+
# This job only runs for '/rerun' pull request comments by owner, member, or collaborator of the repo/organization.
18+
name: Build copr builds for tft tests
19+
runs-on: ubuntu-20.04
20+
outputs:
21+
artifacts: ${{ steps.gen_artifacts.outputs.artifacts }}
22+
if: |
23+
github.event.issue.pull_request
24+
&& startsWith(github.event.comment.body, '/rerun')
25+
&& contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
26+
steps:
27+
- name: Update repository
28+
id: repo_update
29+
run: sudo apt-get update
30+
31+
- name: Install necessary deps
32+
id: deps_install
33+
run: sudo apt-get install -y libkrb5-dev
34+
35+
- name: Get pull request number
36+
id: pr_nr
37+
run: |
38+
PR_URL="${{ github.event.comment.issue_url }}"
39+
echo "::set-output name=pr_nr::${PR_URL##*/}"
40+
41+
- name: Checkout
42+
# TODO: The correct way to checkout would be to use similar approach as in get_commit_by_timestamp function of
43+
# the github gluetool module (i.e. do not use HEAD but the last commit before comment).
44+
id: checkout
45+
uses: actions/checkout@v2
46+
with:
47+
ref: "refs/pull/${{ steps.pr_nr.outputs.pr_nr }}/head"
48+
49+
- name: Get ref and sha
50+
id: ref_sha
51+
run: |
52+
echo "::set-output name=sha::$(git rev-parse --short HEAD)"
53+
echo "::set-output name=ref::refs/pull/${{ steps.pr_nr.outputs.pr_nr }}/head"
54+
55+
- name: Trigger copr build
56+
id: copr_build
57+
env:
58+
COPR_CONFIG: "copr_fedora.conf"
59+
COPR_CHROOT: "epel-7-x86_64,epel-8-x86_64"
60+
COPR_REPO: "@oamg/leapp"
61+
run: |
62+
cat << EOF > $COPR_CONFIG
63+
[copr-cli]
64+
login = ${{ secrets.FEDORA_COPR_LOGIN }}
65+
username = oamgbot
66+
token = ${{ secrets.FEDORA_COPR_TOKEN }}
67+
copr_url = https://copr.fedorainfracloud.org
68+
# expiration date: 2030-07-04
69+
EOF
70+
71+
pip install copr-cli
72+
PR=${{ steps.pr_nr.outputs.pr_nr }} COPR_CONFIG=$COPR_CONFIG COPR_REPO="$COPR_REPO" COPR_CHROOT=$COPR_CHROOT make copr_build | tee copr.log
73+
74+
COPR_URL=$(grep -Po 'https://copr.fedorainfracloud.org/coprs/build/\d+' copr.log)
75+
echo "::set-output name=copr_url::${COPR_URL}"
76+
echo "::set-output name=copr_id::${COPR_URL##*/}"
77+
78+
- name: Add comment with copr build url
79+
# TODO: Create comment when copr build fails.
80+
id: link_copr
81+
uses: actions/github-script@v4
82+
with:
83+
script: |
84+
github.issues.createComment({
85+
issue_number: context.issue.number,
86+
owner: context.repo.owner,
87+
repo: context.repo.repo,
88+
body: 'Copr build succeeded: ${{ steps.copr_build.outputs.copr_url }}'
89+
})
90+
91+
- name: Get dependent leapp pr number from rerun comment
92+
uses: actions-ecosystem/action-regex-match@v2
93+
id: leapp_pr_regex_match
94+
with:
95+
text: ${{ github.event.comment.body }}
96+
regex: '^/(rerun|rerun-sst)\s+([0-9]+)\s*$'
97+
98+
- name: If leapp_pr was specified in the comment - trigger copr build
99+
# TODO: XXX FIXME This should schedule copr build for leapp but for now it will be just setting an env var
100+
id: leapp_pr
101+
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }}
102+
run: |
103+
echo "::set-output name=leapp_pr::${{ steps.leapp_pr_regex_match.outputs.group2 }}"
104+
105+
- name: Checkout leapp
106+
id: checkout_leapp
107+
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }}
108+
uses: actions/checkout@v2
109+
with:
110+
repository: "oamg/leapp"
111+
ref: "refs/pull/${{ steps.leapp_pr.outputs.leapp_pr }}/head"
112+
113+
- name: Get ref and sha for leapp
114+
id: ref_sha_leapp
115+
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }}
116+
run: |
117+
echo "::set-output name=sha::$(git rev-parse --short HEAD)"
118+
echo "::set-output name=ref::refs/pull/${{ steps.leapp_pr.outputs.leapp_pr }}/head"
119+
120+
- name: Trigger copr build for leapp
121+
id: copr_build_leapp
122+
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }}
123+
env:
124+
COPR_CONFIG: "copr_fedora.conf"
125+
COPR_CHROOT: "epel-7-x86_64,epel-8-x86_64"
126+
COPR_REPO: "@oamg/leapp"
127+
run: |
128+
cat << EOF > $COPR_CONFIG
129+
[copr-cli]
130+
login = ${{ secrets.FEDORA_COPR_LOGIN }}
131+
username = oamgbot
132+
token = ${{ secrets.FEDORA_COPR_TOKEN }}
133+
copr_url = https://copr.fedorainfracloud.org
134+
# expiration date: 2030-07-04
135+
EOF
136+
137+
pip install copr-cli
138+
PR=${{ steps.leapp_pr.outputs.leapp_pr }} COPR_CONFIG=$COPR_CONFIG COPR_REPO="$COPR_REPO" COPR_CHROOT=$COPR_CHROOT make copr_build | tee copr.log
139+
140+
COPR_URL=$(grep -Po 'https://copr.fedorainfracloud.org/coprs/build/\d+' copr.log)
141+
echo "::set-output name=copr_url::${COPR_URL}"
142+
echo "::set-output name=copr_id::${COPR_URL##*/}"
143+
144+
- name: Add comment with copr build url for leapp
145+
# TODO: Create comment when copr build fails.
146+
id: link_copr_leapp
147+
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }}
148+
uses: actions/github-script@v4
149+
with:
150+
script: |
151+
github.issues.createComment({
152+
issue_number: context.issue.number,
153+
owner: context.repo.owner,
154+
repo: context.repo.repo,
155+
body: 'Copr build succeeded: ${{ steps.copr_build_leapp.outputs.copr_url }}'
156+
})
157+
158+
- name: Generate artifacts output
159+
id: gen_artifacts
160+
env:
161+
ARTIFACTS: ${{ steps.leapp_pr_regex_match.outputs.match != '' && format('{0};{1}', steps.copr_build_leapp.outputs.copr_id, steps.copr_build.outputs.copr_id) || steps.copr_build.outputs.copr_id }}
162+
run: |
163+
echo "::set-output name=artifacts::${{ env.ARTIFACTS }}"

0 commit comments

Comments
 (0)