[OS-BUILD PATCH] Remove unused ci scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Don Zickus <dzickus@xxxxxxxxxx>

Remove unused ci scripts

The ARK CI process has changed over time and the following scripts are
no longer used.  Remove them to avoid confusion for future contributors.

* ark-rebase-patches.sh
  used to rebase patches for ark-patches.  ark-patches was replaced by
the current merge based workflow.

* ark-update-changelog.sh
  a legacy implementation to update the changelog on os-build from
ark-latest when ark-patches was being used.  This has been replaced by
the current merge based workflow.

* sign_off_check.py
  used by ci scripts to verify every MR had a signed-off-by line.
Replaced with kernel-webhooks implementation of the same idea.

Signed-off-by: Don Zickus <dzickus@xxxxxxxxxx>

diff --git a/redhat/scripts/ci/ark-rebase-patches.sh b/redhat/scripts/ci/ark-rebase-patches.sh
deleted file mode 100755
index blahblah..blahblah 0
--- a/redhat/scripts/ci/ark-rebase-patches.sh
+++ /dev/null
@@ -1,128 +0,0 @@
-#!/usr/bin/bash
-#
-# Automatically rebase the kernel patches in ark-patches.
-#
-# If the REPORT_BUGS environment variable is set, any patches that do not apply
-# cleanly during the rebase are dropped, and an issue is filed to track rebasing
-# that patch.
-#
-# If run with REPORT_BUGS, you must have python3-gitlab installed and a
-# configuration file set up in ~/.python-gitlab.cfg or /etc/python-gitlab.cfg.
-# An example configuration can be found at
-# https://python-gitlab.readthedocs.io/en/stable/cli.html. If the configuration
-# is not in one of the above locations, the path can be set
-# with the PYTHON_GITLAB_CONFIG environment variable.
-#
-# Arguments:
-#   1) The commit/tag/branch to rebase onto.
-#   2) The Gitlab project ID to file issues against. See the project page on
-#      Gitlab for the ID. For example, https://gitlab.com/cki-project/kernel-ark/
-#      is project ID 13604247
-set -e
-
-UPSTREAM_REF=${1:-master}
-test -n "$PROJECT_ID" || PROJECT_ID="${2:-13604247}"
-
-ISSUE_TEMPLATE="During an automated rebase of ark-patches, commit %s failed to rebase.
-
-The commit in question is:
-~~~
-%s
-~~~
-
-To fix this issue:
-
-1. \`git rebase upstream ark-patches\`
-2. Use your soft, squishy brain to resolve the conflict as you see fit. If it is
-   non-trivial and has an \"Upstream Status: RHEL only\" tag, ask the author
-   to rebase the patch.
-3. \`if git tag -v $UPSTREAM_REF; then git branch ark/patches/$UPSTREAM_REF && git push upstream ark/patches/$UPSTREAM_REF; fi\`
-4. \`git push -f upstream ark-patches\`
-"
-
-if [ -z "$PYTHON_GITLAB_CONFIG" ]; then
-	GITLAB_CONFIG_OPT=""
-else
-	GITLAB_CONFIG_OPT="-c $PYTHON_GITLAB_CONFIG"
-fi
-
-# Check if ark-patches is already rebased to $UPSTREAM_REF
-test -n "$(git branch os-build --contains "$UPSTREAM_REF")" && exit 0
-
-if git show "$UPSTREAM_REF" > /dev/null 2>&1; then
-	printf "Rebasing ark-patches onto %s...\n" "$UPSTREAM_REF"
-else
-	printf "No such git object \"%s\" in tree\n" "$UPSTREAM_REF"
-	exit 1
-fi
-
-if [ -n "$PROJECT_ID" ] && [ "$PROJECT_ID" -eq "$PROJECT_ID" ] 2> /dev/null; then
-	printf "Filing issues against GitLab project ID %s\n" "$PROJECT_ID"
-else
-	printf "No Gitlab project ID specified; halting!\n"
-	exit 1
-fi
-
-CLEAN_REBASE=true
-if git rebase "$UPSTREAM_REF" ark-patches; then
-	printf "Cleanly rebased all patches\n"
-elif [ -n "$REPORT_BUGS" ]; then
-	while true; do
-		CLEAN_REBASE=false
-		CONFLICT=$(git am --show-current-patch)
-		COMMIT=$(git am --show-current-patch | head -n1 | awk '{print $2}' | cut -c 1-12)
-		TITLE=$(printf "Unable to automatically rebase commit %s" "$COMMIT")
-		# shellcheck disable=SC2059     # There is a multi-line pattern in ISSUE_TEMPLATE;
-		# wiki says there is no good rewrite and recommends disabling warning.
-		DESC=$(printf "$ISSUE_TEMPLATE" "$COMMIT" "$CONFLICT")
-		# shellcheck disable=SC2086
-		# GITLAB_CONFIG_OPT DEPENDS on word splitting:
-		OPEN_ISSUES=$(gitlab $GITLAB_CONFIG_OPT project-issue list --project-id "$PROJECT_ID" --search "$TITLE")
-		if [ -n "$OPEN_ISSUES" ]; then
-			echo "Skipping filing an issue about commit $COMMIT; already exists as $OPEN_ISSUES"
-			continue
-		fi
-
-		# shellcheck disable=SC2086
-		# GITLAB_CONFIG_OPT DEPENDS on word splitting:
-		if gitlab $GITLAB_CONFIG_OPT project-issue create --project-id "$PROJECT_ID" \
-			--title "$TITLE" --description "$DESC" --labels "Patch Rebase"; then
-			if git rebase --skip; then
-				printf "Finished dropping patches that fail to rebase\n"
-				break
-			else
-				continue
-			fi
-		else
-			printf "Halting rebase because an issue cannot be filed for a conflict\n"
-			exit 1
-		fi
-	done
-else
-	printf "A conflict occurred while rebase patches, please resolve manually.\n"
-	exit 2
-fi
-
-if $CLEAN_REBASE; then
-	if test -n "$DIST_PUSH"; then
-		echo "Pushing branch ark-patches to $(git remote get-url gitlab)"
-		git push -f gitlab ark-patches
-	else
-		printf "You can safely update ark-patches with 'git push -f <remote> ark-patches'\n"
-	fi
-else
-	printf "Some patches could not be rebased, fix up ark-patches as necessary"
-	printf " before pushing the branch."
-	exit 2
-fi
-
-if git tag -v "$UPSTREAM_REF" > /dev/null 2>&1; then
-	printf "Creating branch \"ark/patches/%s\"\n" "$UPSTREAM_REF"
-	git branch ark/patches/"$UPSTREAM_REF"
-	if test -n "$DIST_PUSH"; then
-		echo "Pushing branch ark/patches to $(git remote get-url gitlab)"
-		git push gitlab ark/patches/"$UPSTREAM_REF"
-	else
-		printf "Don't forget to run 'git push <remote> ark/patches/%s'\n" "$UPSTREAM_REF"
-	fi
-fi
diff --git a/redhat/scripts/ci/ark-update-changelog.sh b/redhat/scripts/ci/ark-update-changelog.sh
deleted file mode 100755
index blahblah..blahblah 0
--- a/redhat/scripts/ci/ark-update-changelog.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-#
-# Update the changelog in the current branch to match the changelog in
-# ark-latest.  CI runs this against the os-build branch so the change log
-# entries from the new release are pulled in and used to figure out what's
-# changed in the *next* release.
-
-set -x
-set -e
-
-git checkout ark-latest -- redhat/kernel.changelog-8.99
-git add redhat/kernel.changelog-8.99
-git checkout ark-latest -- redhat/marker
-git add redhat/marker
-
-# Did anything change?
-LINES_CHANGED=$(git diff --cached | wc -l)
-if [ "${LINES_CHANGED}" != "0" ]; then
-    git commit -m "Updated changelog for the release based on $(cat redhat/marker)"
-fi
diff --git a/redhat/scripts/ci/sign_off_check.py b/redhat/scripts/ci/sign_off_check.py
deleted file mode 100755
index blahblah..blahblah 0
--- a/redhat/scripts/ci/sign_off_check.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env python3
-#
-# SPDX-License-Identifier: GPL-2.0-or-later
-#
-# Asserts each commit in a merge request is signed-off-by the author of the
-# commit.  Exits 1 if signed-off-bys are missing, or if run in an invalid
-# context (i.e. not a merge request).
-import os
-import sys
-
-import gitlab as gitlab_module
-
-LICENSE_DOCS = "https://gitlab.com/cki-project/kernel-ark/-/wikis/Contributor-Guide#licensing";
-
-# Refer to https://docs.gitlab.com/ee/ci/variables/predefined_variables.html for
-# environment variables.
-gitlab = gitlab_module.Gitlab(
-    os.environ["CI_SERVER_URL"], job_token=os.environ["CI_JOB_TOKEN"], timeout=30
-)
-
-project_id = os.environ.get("CI_MERGE_REQUEST_PROJECT_ID")
-merge_request_iid = os.environ.get("CI_MERGE_REQUEST_IID")
-if project_id is None or merge_request_iid is None:
-    print("This test is only valid against merge requests.")
-    sys.exit(1)
-
-project = gitlab.projects.get(project_id)
-mr = project.mergerequests.get(merge_request_iid)
-
-invalid_commits = []
-for commit in mr.commits():
-    sign_offs = [
-        line.strip()
-        for line in commit.message.splitlines()
-        if line.strip().startswith("Signed-off-by:")
-    ]
-    required_sign_off = f"Signed-off-by: {commit.author_name} <{commit.author_email}>"
-    if required_sign_off not in sign_offs:
-        invalid_commits.append((commit, required_sign_off))
-
-
-if invalid_commits:
-    for commit, required_sign_off in invalid_commits:
-        print(f"Commit {commit.id} is missing a '{required_sign_off}' tag.")
-    print(f"Refer to {LICENSE_DOCS} for details.")
-    sys.exit(1)

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2091
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux