Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] common/travis/xlint: make xlint only fatal for new templates
@ 2023-07-08 22:28 classabbyamp
  2023-07-08 22:29 ` [PR PATCH] [Updated] " classabbyamp
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: classabbyamp @ 2023-07-08 22:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

There is a new pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages ci/xlint-nonfatal
https://github.com/void-linux/void-packages/pull/44930

common/travis/xlint: make xlint only fatal for new templates
per discussion on irc, to help updates and other changes go more smoothly, xlint should only cause a CI failure if the linted template is new.

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**



A patch file from https://github.com/void-linux/void-packages/pull/44930.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci/xlint-nonfatal-44930.patch --]
[-- Type: text/x-diff, Size: 2108 bytes --]

From adbca83b26d56e5a41ab23079312328af76b0a65 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 18:19:43 -0400
Subject: [PATCH] common/travis/xlint: make xlint only fatal for new templates

to help updates and other changes go more smoothly, xlint should only
cause a CI failure if the linted template is new.
---
 common/travis/changed_templates.sh | 10 +++++++++-
 common/travis/xlint.sh             |  7 ++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/common/travis/changed_templates.sh b/common/travis/changed_templates.sh
index 91af1f1a3c1a..c54b76e92e85 100755
--- a/common/travis/changed_templates.sh
+++ b/common/travis/changed_templates.sh
@@ -20,9 +20,17 @@ base="$(git merge-base origin/HEAD "$tip")"
 echo "$base $tip" >/tmp/revisions
 
 /bin/echo -e '\x1b[32mChanged packages:\x1b[0m'
-git diff-tree -r --no-renames --name-only --diff-filter=AM \
+git diff-tree -r --no-renames --name-only --diff-filter=M \
 	"$base" "$tip" \
 	-- 'srcpkgs/*/template' |
 	cut -d/ -f 2 |
 	tee /tmp/templates |
 	sed "s/^/  /" >&2
+/bin/echo -e '\x1b[32mNew packages:\x1b[0m'
+git diff-tree -r --no-renames --name-only --diff-filter=A \
+	"$base" "$tip" \
+	-- 'srcpkgs/*/template' |
+	cut -d/ -f 2 |
+	tee -a /tmp/templates |
+	tee /tmp/new-templates |
+	sed "s/^/  /" >&2
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..2f0ab673a10a 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -11,7 +11,12 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
-	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	if grep -q "srcpkgs/$t/template" /tmp/new-templates; then
+		# only fatal if xlint fails for new templates
+		xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	else
+		xlint "$t" > /tmp/xlint_out || true
+	fi
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-10-22  1:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-08 22:28 [PR PATCH] common/travis/xlint: make xlint only fatal for new templates classabbyamp
2023-07-08 22:29 ` [PR PATCH] [Updated] " classabbyamp
2023-07-08 22:41 ` classabbyamp
2023-07-08 22:42 ` classabbyamp
2023-07-08 22:44 ` classabbyamp
2023-07-08 22:51 ` classabbyamp
2023-07-08 22:53 ` classabbyamp
2023-07-08 22:55 ` classabbyamp
2023-07-08 22:58 ` classabbyamp
2023-07-08 23:00 ` classabbyamp
2023-07-08 23:02 ` classabbyamp
2023-10-07  1:45 ` github-actions
2023-10-22  1:46 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).