From patchwork Tue Apr 30 00:33:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13647900 Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B94CC2107 for ; Tue, 30 Apr 2024 00:35:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714437308; cv=none; b=AssUPaZbrDUbwnAAjnTw+PJNh3btHXIKhNsLTeqBRejunMVf+5D/hb10HKSsWp2ccxQLIvkqmporrJCVb2dE+YgldK85a37CFmBrxfic7/I0dQtg0lEO/9PDKSoiYHumYDJbFz4mvN4WWP8Vd84pmEUqhALiIuMExzed4I45rTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714437308; c=relaxed/simple; bh=ys7WnnxBoxcQj/tiDbX8Y2lJ+cON98xBG6DqxCYSp1c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rG9Uzeo+4AdrV0n1i/leCdqxY/BrcANRLj7ouXzbGNs9jXSX1s2qzKBLKyuQspCMRxdn3dVW7O4VVnAP/pIqQmX3KtpuMTEbshYrnKENvn9waeI+ZXCgUg9ZJPvaRAO6Mm3PnzvXKje5cZxjGPVKjHxWgkTIce6A+7a8B9J0s6g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RiH+c+Et; arc=none smtp.client-ip=209.85.210.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RiH+c+Et" Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-6eb86b69e65so3114365a34.3 for ; Mon, 29 Apr 2024 17:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714437305; x=1715042105; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Gtm7mmt8gRCogwolmSbMqmLapvDsaZpxoixUgZfCI3c=; b=RiH+c+EtXWtf8HQyela8Du4sDcO6HwXVvg/k0uYdro9AtuljEKTAj7E8Pw9WTrc7ec bC8n6HwckZpGC30qYN3cQrpGB0sccMCCuy2fg7O/geOtPWgfAk9zNTUJYa5tcFoX+CIN 0meQjHytkdQ3gGu5hrdmvVK8MaeSkmDj5tPMYG28lqcxllgF9peqP0Kk7sPiIsBb9LDY x1wakLr3hobla8jUUf/CI9gksdOx+HvjbRyc5ONoEwMVtzm5voHaNpezKHajGuKA1tsZ yfgF7besWgb39Scy/pLirI4XMMBfnC+WP066jcpRZpPBem8f9uaeAzsqg7zWoceYsEdd HENg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714437305; x=1715042105; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gtm7mmt8gRCogwolmSbMqmLapvDsaZpxoixUgZfCI3c=; b=kfHdCeBKLODf+dZ6LF3eay/Kf5dBiXsS6iP0+fku5621nhXId51wmbfzjTRStwxYP3 A254bq0HpUYqkX+EjhwY//hkmIBB5vuyMGhBfSMICVhGIhjpv4hu/TFASVtRE0lqbyzr VS5HtxuByBBgzNi48vHqejipbl/0f2b3J+eOyw62dRGOpmB5xzzJa6D9jcBlvVMwtBgF xFSVh0wTkG4m11MbEokF5E8eS7OWvlQVOEVWWq23HwJLf/ZOv36AiE8WEoC0YBCopef+ qymozqOMa03W4N98hkaNXQO6Rs3vrr4ZcL8+1otWv3dZoHI1ZCqs2Ixgv0dGYzpFeEJF Cn1w== X-Gm-Message-State: AOJu0YwcL8n4lV3Ehg48qXMbu+t1CW06yxE4ejyHs1Ck2C6OiCH51VcA eMSq4GpdhIo1GndYou5N4qW/Bsr1f5/sDike/s2siwL6iuRKMFaawbjHoBN0 X-Google-Smtp-Source: AGHT+IG6TkpwLGHOr74ehRpIWgyd58WGcgIqmrpoEIeOYPyu1HlyOlbhfGz7xHM0iayMIaFhG+F9vA== X-Received: by 2002:a05:6830:10ce:b0:6ee:4c37:995 with SMTP id z14-20020a05683010ce00b006ee4c370995mr3350699oto.19.1714437305414; Mon, 29 Apr 2024 17:35:05 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id bw3-20020a0568300dc300b006ee5b409f23sm188645otb.22.2024.04.29.17.35.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 17:35:05 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler Subject: [PATCH 1/2] ci: pre-collapse GitLab CI sections Date: Mon, 29 Apr 2024 19:33:22 -0500 Message-ID: <20240430003323.6210-2-jltobler@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240430003323.6210-1-jltobler@gmail.com> References: <20240430003323.6210-1-jltobler@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sections of CI output defined by `begin_group()` and `end_group()` are expanded in GitLab pipelines by default. This can make CI job output rather noisy and harder to navigate. Update the behavior for GitLab pipelines to now collapse sections by default. Signed-off-by: Justin Tobler --- ci/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/lib.sh b/ci/lib.sh index 0a73fc7bd1..02e5e058dd 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -18,7 +18,7 @@ elif test true = "$GITLAB_CI" then begin_group () { need_to_end_group=t - printf "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)\r\e[0K$1\n" + printf "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)[collapsed=true]\r\e[0K$1\n" trap "end_group '$1'" EXIT set -x } From patchwork Tue Apr 30 00:33:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13647901 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26BC328F0 for ; Tue, 30 Apr 2024 00:35:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714437310; cv=none; b=ULXQyUEz1YVEY+pyldc46WqJUGdtS7Rs9yFWkmAYobIVPKozrN2ztR/PtqN6hCkmZeYVxL+IOHeFN/IC/wJuaaT/4Uby+t4dzU3+zKLKNnbjNlVbiuMGtCTkbQQhZEc3+wwIdxy4ZJi72w2BKGbZpgTh5axxz2hEPyIlFt7lA7c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714437310; c=relaxed/simple; bh=IC3xG8rggbCOARBpCSeuJmsFTaIp/UHBbUFexka6P3A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tQeUss+SIueRKPzw+nXWExxdE5/ZZ40sUJJwLjvEuuqDfNVR7Xh3Ch0qgd0T0eheIpgCD5c7xSmrR84gWIEJJgxgXN+ojenbr/SBSQBF7nUVJVqG4dVeQuIqFY93nqyEPekSJxpTiCTCjufzLahDvUUMvrx/XT475QaYbvTVSvE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ABLvED5Z; arc=none smtp.client-ip=209.85.210.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ABLvED5Z" Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-6ed3587b93bso3090915a34.1 for ; Mon, 29 Apr 2024 17:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714437308; x=1715042108; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KL8kJSAclLO5yPOlqZEE9sIdByXY7rfvTqxrHUoUmW4=; b=ABLvED5ZkogaLm959Ier37hu/x2XCzbSlP5yrrhwMKWT7eq6K+QDs+Glq2kcFkFpae WJSYo0rYhd0IOMqpi9FVh2e4YEAgIb8prs+XuD6Mf3WzhYVfebr3fjZe18Lwzg0u7Vtf /IiS+cfMdh2N/XRxoKLXPiMvnvYf9mhDyyWfzu0l1u9mG99cRz6/vt+sn5GFxC5nnhcD YZ6QIuK62oePO/dHADZkR3DgDVauuYIhUHhv+9DVakYuaG5yC+8JFlUln+i4SEJ+TmVe +tj6sYiXkGzhJoBFsdyMFZ8yn6+13pSpD9Uiv7iKgHlXn0jIZz0xE06NuWxrGelJt99Q oEwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714437308; x=1715042108; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KL8kJSAclLO5yPOlqZEE9sIdByXY7rfvTqxrHUoUmW4=; b=V51UwdL+r2bwg+Qptne6FnDc0mEjxvhEIMQPbkTeXPWhg9tdxY45leEomzwq5yYsQP ahObye24MXfbtCOOYv7zT6NFTF3tKPMkbKwv1h7Q3Sym4xMVhB9qOVJ+ZpPjKNkwgz/i +UQZ+zHNdb+VPjFxfJGJofM2Ry/J7bNkHxqAwHW9aToHseb+Jxl9GZTtbWY5NUowlEaG 6i0ekTbpTXaP6TxcbtPvW7IwSqmoMVjRHyFOZeX3E0JmxLlIbugllSlD9A51lyD2+qCy HBRzn69pVE9+yI4eUFh3Jif4NlTwW5+NO+2Q7UETdn41aNW4IU0x16jo4YfTawKwDgrN JpAA== X-Gm-Message-State: AOJu0YwS8EM4TIMqMGV2zJQoTbrdCQ2gni1PCq8sc4FHg2Ed/XQgRvGl f3po/8Wc/OxG/4npGgfs1FNkt8gS4zIbRwYcIkRe+kY3qKhLXnfKwVUyk4Qx X-Google-Smtp-Source: AGHT+IH7YkoFOkunMWoegRGVt074+jDjh2ASEq/LeleaWi1xz0ZiV2jp+XpiyJoi275IQ1SQv7ImiA== X-Received: by 2002:a05:6830:1199:b0:6ee:3a37:b230 with SMTP id u25-20020a056830119900b006ee3a37b230mr4014346otq.38.1714437307891; Mon, 29 Apr 2024 17:35:07 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id bw3-20020a0568300dc300b006ee5b409f23sm188645otb.22.2024.04.29.17.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 17:35:07 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler Subject: [PATCH 2/2] gitlab-ci: add whitespace error check Date: Mon, 29 Apr 2024 19:33:23 -0500 Message-ID: <20240430003323.6210-3-jltobler@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240430003323.6210-1-jltobler@gmail.com> References: <20240430003323.6210-1-jltobler@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To check for whitespace errors introduced by a set of changes, there is the `.github/workflows/check-whitespace.yml` GitHub action. This script executes `git log --check` over a range containing the new commits and parses the output to generate a markdown formatted artifact that summarizes detected errors with GitHub links to the affected commits and blobs. Since this script is rather specific to GitHub actions, a more general and simple `ci/check-whitespace.sh` is added instead that functions the same, but does not generate the markdown file for the action summary. From this, a new GitLab CI job is added to support the whitespace error check. Note that the `$CI_MERGE_REQUEST_TARGET_BRANCH_SHA` variable is only available in GitLab merge request pipelines and therefore the CI job is configured to only run as part of those pipelines. Signed-off-by: Justin Tobler --- .gitlab-ci.yml | 9 +++++++++ ci/check-whitespace.sh | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100755 ci/check-whitespace.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c0fa2fe90b..31cf420a11 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -102,3 +102,12 @@ static-analysis: script: - ./ci/run-static-analysis.sh - ./ci/check-directional-formatting.bash + +check-whitespace: + image: ubuntu:latest + before_script: + - ./ci/install-docker-dependencies.sh + script: + - ./ci/check-whitespace.sh $CI_MERGE_REQUEST_TARGET_BRANCH_SHA + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' diff --git a/ci/check-whitespace.sh b/ci/check-whitespace.sh new file mode 100755 index 0000000000..1cad2d7374 --- /dev/null +++ b/ci/check-whitespace.sh @@ -0,0 +1,16 @@ +#! /bin/sh +# +# Check that commits after a specified point do not contain new or modified +# lines with whitespace errors. +# + +baseSha=${1} + +git log --check --pretty=format:"---% h% s" ${baseSha}.. +if test $? -ne 0 +then + echo "A whitespace issue was found in one or more of the commits." + echo "Run the following command to resolve whitespace issues:" + echo "\tgit rebase --whitespace=fix ${baseSha}" + exit 2 +fi