diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9deeb2c7f..93531e2cc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -23,4 +23,14 @@ test/README.md and add these additional items: - [ ] QE has approved reproducer/new tests and - [ ] Subsequent commits provide bug fixes without modifying the reproducer; CI reports PASS and - [ ] QE approves this PR; RHBZ status is set to `MODIFIED + Verified=Tested` + +Information regarding our GitLab pipeline (Schutzbot): + +CI will not be ran automatically if WIP label is applied or the PR is in DRAFT state, instead only +a link will be provided to the pipeline which can then be triggered manually if desired. To run the +CI automatically either switch the PR to ready or apply WIP+test label. + +Outside contributors need manual approval from one of the osbuild-composer maintainers. + +Schutzbot will only be triggered if all Tests jobs in GitHub workflow succeed. --> diff --git a/.github/workflows/trigger-gitlab.yml b/.github/workflows/trigger-gitlab.yml index ef7c7e8f6..899fef7ed 100644 --- a/.github/workflows/trigger-gitlab.yml +++ b/.github/workflows/trigger-gitlab.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest env: SCHUTZBOT_SSH_KEY: ${{ secrets.SCHUTZBOT_SSH_KEY }} - SKIP_CI: ${{ github.event.pull_request.draft == true || contains(github.event.pull_request.labels.*.name, 'WIP') }} + SKIP_CI: ${{ (github.event.pull_request.draft == true || contains(github.event.pull_request.labels.*.name, 'WIP')) && !contains(github.event.pull_request.labels.*.name, 'WIP+test') }} steps: - name: Report status uses: haya14busa/action-workflow_run-status@v1 @@ -59,5 +59,5 @@ jobs: touch ~/.ssh/known_hosts ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts git remote add ci git@gitlab.com:osbuild/ci/osbuild-composer.git - [[ "${SKIP_CI}" == true ]] && PUSH_OPTION="-o ci.skip" || PUSH_OPTION="" + [[ "${SKIP_CI}" == true ]] && PUSH_OPTION='-o ci.variable="SKIP_CI=true"' || PUSH_OPTION="" git push -f ${PUSH_OPTION} ci diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e79132409..ae5852cfc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,21 @@ init: script: - schutzbot/update_github_status.sh start +.build_rules: + rules: + - if: '$CI_PIPELINE_SOURCE != "schedule" && $SKIP_CI == "false"' + - if: '$CI_PIPELINE_SOURCE != "schedule" && $SKIP_CI == "true"' + when: manual + +.upstream_rules: + rules: + - if: '$CI_PIPELINE_SOURCE != "schedule"' + +.nightly_rules: + rules: + - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' + - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"' + .RPM_RUNNERS_RHEL: &RPM_RUNNERS_RHEL RUNNER: @@ -56,7 +71,7 @@ RPM: stage: rpmbuild extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' + - !reference [.build_rules, rules] script: - sh "schutzbot/mockbuild.sh" after_script: @@ -79,8 +94,7 @@ Build -tests RPM for RHEL: stage: rpmbuild extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"' + - !reference [.nightly_rules, rules] script: - sh "schutzbot/mockbuild.sh" interruptible: true @@ -95,7 +109,7 @@ Container: stage: rpmbuild extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' + - !reference [.build_rules, rules] script: - sh "schutzbot/containerbuild.sh" parallel: @@ -117,8 +131,7 @@ Prepare-rhel-internal: stage: prepare-rhel-internal extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"' + - !reference [.nightly_rules, rules] script: - schutzbot/prepare-rhel-internal.sh artifacts: @@ -140,9 +153,8 @@ Base: stage: test extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"' + - !reference [.upstream_rules, rules] + - !reference [.nightly_rules, rules] script: - schutzbot/deploy.sh - /usr/libexec/tests/osbuild-composer/base_tests.sh @@ -170,9 +182,8 @@ Manifests: stage: test extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"' + - !reference [.upstream_rules, rules] + - !reference [.nightly_rules, rules] script: - schutzbot/deploy.sh - /usr/libexec/tests/osbuild-composer/manifest_tests.sh @@ -186,9 +197,8 @@ Regression: stage: test extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"' + - !reference [.upstream_rules, rules] + - !reference [.nightly_rules, rules] script: - schutzbot/deploy.sh - /usr/libexec/tests/osbuild-composer/regression.sh @@ -216,8 +226,7 @@ Image Tests: stage: test extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"' + - !reference [.nightly_rules, rules] script: - schutzbot/deploy.sh - /usr/libexec/tests/osbuild-composer/image_tests.sh @@ -235,7 +244,7 @@ Test Case Generation: stage: test extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' + - !reference [.upstream_rules, rules] script: - schutzbot/deploy.sh - /usr/libexec/tests/osbuild-composer/generation.sh @@ -249,9 +258,8 @@ OSTree: stage: test extends: .terraform/openstack rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"' + - !reference [.upstream_rules, rules] + - !reference [.nightly_rules, rules] script: - schutzbot/deploy.sh - /usr/libexec/tests/osbuild-composer/ostree.sh @@ -333,9 +341,8 @@ Integration: stage: test extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"' + - !reference [.upstream_rules, rules] + - !reference [.nightly_rules, rules] script: - schutzbot/deploy.sh - /usr/libexec/tests/osbuild-composer/${SCRIPT} @@ -368,7 +375,7 @@ API: stage: test extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' + - !reference [.upstream_rules, rules] # note: cloud API is not supported for on-prem installations so # don't run this test case for nightly trees script: @@ -387,9 +394,8 @@ libvirt: stage: test extends: .terraform/openstack rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9.0-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8.6-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"' + - !reference [.upstream_rules, rules] + - !reference [.nightly_rules, rules] script: - schutzbot/deploy.sh - /usr/libexec/tests/osbuild-composer/libvirt.sh @@ -397,18 +403,16 @@ libvirt: matrix: - RUNNER: - rhos-01/centos-stream-8-x86_64 - - RUNNER: - rhos-01/rhel-8.5-ga-x86_64 - rhos-01/rhel-8.6-nightly-x86_64 - rhos-01/rhel-9.0-nightly-x86_64 - rhos-01/centos-stream-9-x86_64 - INTERNAL_NETWORK: ["true"] RHEL 9 on 8: stage: test extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' + - !reference [.upstream_rules, rules] script: - schutzbot/deploy.sh - /usr/libexec/tests/osbuild-composer/koji.sh @@ -421,7 +425,7 @@ Upgrade: stage: test extends: .terraform/openstack rules: - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9\.[0-9]-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' + - !reference [.nightly_rules, rules] script: - schutzbot/deploy.sh - /usr/libexec/tests/osbuild-composer/upgrade8to9.sh @@ -463,9 +467,8 @@ Installer: stage: test extends: .terraform/openstack rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-9\.[0-9]-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "9"' - - if: '$CI_PIPELINE_SOURCE == "schedule" && $RUNNER =~ /[\S]+rhel-8\.[0-9]-[^ga][\S]+/ && $NIGHTLY == "true" && $RHEL_MAJOR == "8"' + - !reference [.upstream_rules, rules] + - !reference [.nightly_rules, rules] script: - schutzbot/deploy.sh - /usr/libexec/tests/osbuild-composer/installers.sh @@ -493,7 +496,7 @@ SonarQube: stage: test extends: .terraform rules: - - if: '$CI_PIPELINE_SOURCE != "schedule"' + - !reference [.upstream_rules, rules] script: - schutzbot/sonarqube.sh variables: