Github messages for voidlinux
 help / color / mirror / Atom feed
From: classabbyamp <classabbyamp@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
Date: Wed, 06 Sep 2023 02:56:53 +0200	[thread overview]
Message-ID: <20230906005653.wHXq6XEJuhJy5qxcqAF8iWCVP8e4_GHfryy3ZnxFOBs@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-44927@inbox.vuxu.org>

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

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 10538 bytes --]

From 483e9dd8afb78f1eea69587fe4e9d7968497ae7b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:09:52 -0400
Subject: [PATCH 1/8] common/travis: remove XLINT variable

it seems to do nothing
---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0b..46072e9f81ea9 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef17339..0b2d12d0b0d04 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 409594eb8c162d404648ca429de543de8d33a5ef Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:10:28 -0400
Subject: [PATCH 2/8] .github/workflows/build.yaml: run xlint in a void
 container

---
 .github/workflows/build.yaml | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 82463955ee984..df91320404f3b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,33 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/void-buildroot-musl:20230904R2'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From ae1d050054319d760b74a684d63c19aef93ab442 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 3/8] .github/workflows/build.yaml: verify the functionality of
 update-check

---
 .github/workflows/build.yaml         |  4 +++-
 common/travis/verify-update-check.sh | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index df91320404f3b..0a09dc201b967 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,9 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          common/travis/xlint.sh
+          common/travis/verify-update-check.sh
 
   # Build changed packages.
   build:
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 0000000000000..b5624921306d4
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	./xbps-src update-check "$pkg" 2>&1 > /tmp/update-check.log || err=1
+	cat /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 49ac3e811f36cdaf2b494ce7ff7984f33bb24e89 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 4/8] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index bbe6d869c6170..0a68f088f6a25 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc2..8827641005777 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From be905add641def692473e94e268434d66e3142ad Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:50:04 -0400
Subject: [PATCH 5/8] chezmoi:

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index f046f669df41c..7ecf6f84aef19 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.38.0
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

From fa6453722ca76954db3a43c5286049bbe97fb4e5 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:51:50 -0400
Subject: [PATCH 6/8] fixup! .github/workflows/build.yaml: verify the
 functionality of update-check

---
 .github/workflows/build.yaml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 0a09dc201b967..a9b56e6e5d992 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,9 +47,8 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: |
-          common/travis/xlint.sh
-          common/travis/verify-update-check.sh
+      - run: common/travis/xlint.sh
+      - run: common/travis/verify-update-check.sh
 
   # Build changed packages.
   build:

From 83dc03164fd3b72b860f67959e6f5caf5528caf6 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:53:55 -0400
Subject: [PATCH 7/8] fixup! fixup! .github/workflows/build.yaml: verify the
 functionality of update-check

---
 .github/workflows/build.yaml         | 2 +-
 common/travis/verify-update-check.sh | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index a9b56e6e5d992..622e6b61da5a2 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,7 +37,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # install tools needed for lints
-          xbps-install -y grep
+          xbps-install -y grep curl
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - name: Create hostrepo and prepare masterdir
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
index b5624921306d4..902ebc0d6b445 100755
--- a/common/travis/verify-update-check.sh
+++ b/common/travis/verify-update-check.sh
@@ -5,7 +5,6 @@
 
 set -e
 
-xbps-install -Syu curl grep
 export XBPS_UPDATE_CHECK_VERBOSE=yes
 err=0
 

From dd5a745932bd967c516b823899b2cebf26055671 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:56:41 -0400
Subject: [PATCH 8/8] fixup! fixup! .github/workflows/build.yaml: verify the
 functionality of update-check

---
 .github/workflows/build.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 622e6b61da5a2..d860feff70d38 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,8 +47,12 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/xlint.sh
-      - run: common/travis/verify-update-check.sh
+      - name: Run lints
+        run: |
+          rv=0
+          common/travis/xlint.sh || rv=1
+          common/travis/verify-update-check.sh || rv=1
+          exit $rv
 
   # Build changed packages.
   build:

  parent reply	other threads:[~2023-09-06  0:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-08 19:07 [PR PATCH] " classabbyamp
2023-07-08 19:22 ` Chocimier
2023-07-08 19:56 ` [PR PATCH] [Updated] " classabbyamp
2023-07-08 19:56 ` classabbyamp
2023-07-08 19:58 ` [PR PATCH] [Updated] " classabbyamp
2023-07-08 20:19 ` classabbyamp
2023-07-08 20:26 ` classabbyamp
2023-07-08 20:45 ` classabbyamp
2023-07-08 20:52 ` Chocimier
2023-07-08 20:55 ` [PR PATCH] [Updated] " classabbyamp
2023-07-08 21:01 ` classabbyamp
2023-07-08 21:04 ` classabbyamp
2023-07-08 21:09 ` [PR REVIEW] " mhmdanas
2023-07-08 21:11 ` [PR PATCH] [Updated] " classabbyamp
2023-07-08 23:02 ` classabbyamp
2023-07-09  6:35 ` classabbyamp
2023-09-06  0:49 ` classabbyamp
2023-09-06  0:50 ` classabbyamp
2023-09-06  0:51 ` classabbyamp
2023-09-06  0:54 ` classabbyamp
2023-09-06  0:56 ` classabbyamp [this message]
2023-09-06  0:58 ` classabbyamp
2023-09-06  1:00 ` classabbyamp
2023-09-06  1:00 ` [PR PATCH] [Updated] " classabbyamp
2023-09-08  8:33 ` [PR PATCH] [Merged]: " classabbyamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230906005653.wHXq6XEJuhJy5qxcqAF8iWCVP8e4_GHfryy3ZnxFOBs@z \
    --to=classabbyamp@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).