From: Scott Weaver <scwea...@redhat.com> redhat/scripts/ci/ark-linux-next.sh: initial commit
This creates a new CI job to regularly merge the kernel-ark tree with linux-next. The primary goal is to proactively identify integration issues, conflicts and bugs before they land in the main os-build branch. This initial version is a proof-of-concept and does not, for example, yet include any logic for automatically resolving merge conflicts, misconfigured options or analyzing config mismatches. It serves as a foundation for building more sophisticated automation to help resolve these types of problems in the future. Signed-off-by: Scott Weaver <scwea...@redhat.com> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index blahblah..blahblah 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,6 +60,9 @@ workflow: only-ark-latest-head: &only-ark-latest-head if: $CI_COMMIT_BRANCH != "ark-latest" || $CI_PIPELINE_SOURCE !~ /push|web/ when: never + only-os-build-next-head: &only-os-build-next-head + if: $CI_COMMIT_BRANCH != "os-build-next" || $CI_PIPELINE_SOURCE !~ /push|web/ + when: never only-ark-latest-head-mr: &only-ark-latest-head-mr if: ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "os-build") && ($CI_COMMIT_BRANCH != "ark-latest" || $CI_PIPELINE_SOURCE !~ /push|web/) @@ -171,6 +174,11 @@ workflow: - *only-ark-latest-head - *on-success +.os_build_next_head: + rules: + - *only-os-build-next-head + - *on-success + .cki_gating_head: rules: - *only-cki-gating-head @@ -366,6 +374,10 @@ rawhide_clanglto_debug_baseline: extends: [.baseline, .trigger_rawhide, .reported_tests_clang, .ark_latest_head, .rawhide_clanglto_up_debug] +rawhide_next_baseline: + extends: [.baseline, .trigger_rawhide, .reported_tests, .os_build_next_head, + .rawhide_up] + # Rawhide CKI container image gating rawhide_cki_gating: extends: [.baseline, .trigger_rawhide, .no_tests, .cki_gating_head, @@ -449,6 +461,10 @@ eln_debug_baseline: extends: [.baseline, .trigger_eln, .reported_tests, .ark_latest_head, .eln_up_debug] +eln_next_baseline: + extends: [.baseline, .trigger_eln, .reported_tests, .os_build_next_head, + .eln_up] + # eln_clang_baseline: # extends: [.baseline, .trigger_eln, .reported_tests_clang, .ark_latest_head, # .eln_clang_up] @@ -691,6 +707,7 @@ c10s_automotive_debug_cki_gating: ssh-add -q - <<< "${PRIVATE_KEY}" fi # set up and fetch all remotes and expected branches + git remote add linux-next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git remote add linux-rt-devel git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git git remote add gitlab https://gitlab.com/cki-project/kernel-ark.git git remote set-url --push gitlab g...@gitlab.com:cki-project/kernel-ark.git @@ -747,6 +764,11 @@ merge-rt-automotive: rules: - when: never +merge-linux-next: + extends: .maintenance + script: + - redhat/scripts/ci/ark-linux-next.sh + docs: image: quay.io/cki/cki-tools:production script: diff --git a/redhat/scripts/ci/ark-linux-next.sh b/redhat/scripts/ci/ark-linux-next.sh new file mode 100755 index blahblah..blahblah 100755 --- /dev/null +++ b/redhat/scripts/ci/ark-linux-next.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +# This script is intended to sync up the os-build-next branch with the +# linux-next master branch. Just as linux-next is rebased, so will the +# os-build-next branch. + +set -e + +# source common CI functions and variables +# shellcheck disable=SC1091 +. "$(dirname "$0")"/ark-ci-env.sh + +commit_new_configs() +{ + make FLAVOR=fedora dist-configs-commit + make FLAVOR=rhel dist-configs-commit +} + +commit_mismatches() +{ + make FLAVOR=fedora dist-configs-commit-mismatches + make FLAVOR=rhel dist-configs-commit-mismatches +} + +# Upstream linux-next tree +LINUX_NEXT_REPO_URL="git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git" +LINUX_NEXT_REMOTE_NAME="linux-next" +LINUX_NEXT_BRANCH="master" +KERNEL_ARK_REMOTE_NAME="origin" +KERNEL_ARK_MAIN_BRANCH="os-build" +KERNEL_ARK_NEXT_BRANCH="os-build-next" + +# verify git remote linux-next is setup +if ! git remote get-url "$LINUX_NEXT_REMOTE_NAME" 2>/dev/null; then + die "Please 'git remote add $LINUX_NEXT_REMOTE_NAME $LINUX_NEXT_REPO_URL'" +fi + +# switch to kernel-ark's next branch +ark_git_mirror "$KERNEL_ARK_NEXT_BRANCH" "$KERNEL_ARK_REMOTE_NAME" "$KERNEL_ARK_NEXT_BRANCH" +git checkout "$KERNEL_ARK_NEXT_BRANCH" + +# hard reset the next branch to kernel-ark's main branch +git reset --hard "$KERNEL_ARK_REMOTE_NAME/$KERNEL_ARK_MAIN_BRANCH" + +# merge linux-next to kernel-ark's next branch +git merge --signoff --no-ff --no-edit "$(git describe "$LINUX_NEXT_REMOTE_NAME/$LINUX_NEXT_BRANCH")" + +# generate pending configs for new configs +commit_new_configs + +# generate pending configs for mismatches +commit_mismatches + +# TODO: resolve misconfigured config options +# For now, error on misconfigured config options +make PROCESS_CONFIGS_CHECK_OPTS="-w -n -c" dist-configs-check + +# We have to drop the localversion-next file or 'make dist-srpm' will +# generate a bad NVR. We'll be using this branch for CKI baseline builds, +# so set the localversion file to use the localversion-next value which +# is equivalent to setting DISTLOCALVERSION. +LOCALVERSION_NEXT=$(cat localversion-next) +sed 's/-/./g' localversion-next > localversion +git add -f localversion +git rm localversion-next +git commit -s -m "kernel-ark: drop localversion-next ($LOCALVERSION_NEXT)" + +# push the changes to the branch +test "$TO_PUSH" && git push -f "$KERNEL_ARK_REMOTE_NAME" "$KERNEL_ARK_NEXT_BRANCH" + +exit 0 -- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3971 -- _______________________________________________ kernel mailing list -- kernel@lists.fedoraproject.org To unsubscribe send an email to kernel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue