AUR AI Reviewer

Review Results

Version #2166 of snapd · commit a23b24125cde · status Reviewed

Risk 0/5 · Safe .SRCINFO
Result #2205

Comment

The change only bumps pkgrel from 1 to 2 in .SRCINFO, with no source, build, install-script, dependency, or packaging logic changes. This is a metadata-only rebuild marker and does not introduce any new attack surface or integrity concern by itself.

@@ -1,7 +1,7 @@
 pkgbase = snapd
 	pkgdesc = Service and tools for management of snap packages.
 	pkgver = 2.76.2
-	pkgrel = 1
+	pkgrel = 2
 	url = https://github.com/snapcore/snapd
 	install = snapd.install
 	arch = x86_64
Risk 0/5 · Safe .SRCINFO
Result #2206

Comment

The change only adds a local patch source to relax Go 1.27-related test assertions and updates the checksum in .SRCINFO. The patch is fetched from the package tree, not an external runtime download, and the upstream URL remains the official GitHub release tarball over HTTPS. I reviewed the patch contents: it only adjusts test regexes for changed json error strings and does not introduce build-time network access, privilege escalation, persistence, or packaging changes. Risk is low.

@@ -32,6 +32,8 @@ pkgbase = snapd
 	options = emptydirs
 	options = !lto
 	source = snapd-2.76.2.tar.xz::https://github.com/snapcore/snapd/releases/download/2.76.2/snapd_2.76.2.vendor.tar.xz
+	source = 0001-tests-fix-json-error-assertions-for-Go-1.27-17472.patch
 	sha256sums = 873fedb8525057c2b276003c2f90c2e5f7b541ec1bb409a6f489c51b5c72af2b
+	sha256sums = 0a091ec38ffbe653db698a96ae3486233746711da138e2e5793cff97b523f3f2
 
 pkgname = snapd
Risk 0/5 · Safe 0001-tests-fix-json-error-assertions-for-Go-1.27-17472.patch
Result #2207

Comment

The patch only relaxes unit-test assertions to accommodate Go 1.27 JSON error-message wording changes. It does not alter runtime package behavior, install scripts, sources, permissions, or any build-time network/download logic. The modified regexes remain narrowly scoped to expected JSON parsing failures and do not introduce security-relevant behavior. No supply-chain or privilege-escalation concerns are evident in this diff.

@@ -0,0 +1,125 @@
+From 7f387cb34beb15cc489e21552d35160b12fd53eb Mon Sep 17 00:00:00 2001
+Message-ID: <7f387cb34beb15cc489e21552d35160b12fd53eb.1787321101.git.maciej.borzecki@canonical.com>
+From: Anshul Singh <77113867+levihackerman-102@users.noreply.github.com>
+Date: Wed, 19 Aug 2026 00:05:55 +0900
+Subject: [PATCH] tests: fix json error assertions for Go 1.27 (#17472)
+
+Go 1.27's encoding/json changed several error message formats:
+
+- unmarshal type errors drop the 'Go struct field <T>'/'Go value'
+  type prefix ('cannot unmarshal number into Go struct field ...' ->
+  'cannot unmarshal number into .path of type ...')
+- syntax errors drop the 'literal' suffix ('in string literal' ->
+  'in string')
+- invalid escape errors are reworded ('invalid character ... in
+  string escape code' / 'in \u hexadecimal character escape' ->
+  'invalid escape sequence ... in string')
+- base64 errors are now wrapped
+
+Relax the affected test assertions so they match both the Go 1.26
+and Go 1.27 message formats (verified against go1.26.5 and
+go1.27rc3).
+
+Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
+---
+ daemon/api_prompting_test.go                   |  2 +-
+ interfaces/prompting/patterns/patterns_test.go |  2 +-
+ jsonutil/safejson/safejson_test.go             | 10 +++++-----
+ overlord/devicestate/devicestate_test.go       |  2 +-
+ overlord/install/install_test.go               |  6 +++---
+ usersession/client/client_test.go              |  2 +-
+ 6 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/daemon/api_prompting_test.go b/daemon/api_prompting_test.go
+index 536ed4f3f7dfe266822d36a0e010f07bb9443185..29566e848b490c6fee0a03bd315163c16b45f3f6 100644
+--- a/daemon/api_prompting_test.go
++++ b/daemon/api_prompting_test.go
+@@ -1305,7 +1305,7 @@ func (s *promptingSuite) TestPostPromptErrors(c *C) {
+ 	rspe = s.errorReq(c, req, nil, actionIsExpected)
+ 	c.Check(rspe.Status, Equals, 400)
+ 	c.Check(rspe.Kind, Equals, client.ErrorKind(""))
+-	c.Check(rspe.Message, Matches, "cannot decode request body into prompt reply:.*cannot unmarshal number into Go struct field.*")
++	c.Check(rspe.Message, Matches, "cannot decode request body into prompt reply:.*cannot unmarshal number into.*")
+ 
+ 	// Invalid outcome (action) or lifespan
+ 	for _, testCase := range []struct {
+diff --git a/interfaces/prompting/patterns/patterns_test.go b/interfaces/prompting/patterns/patterns_test.go
+index 2222c5012ab1bee6214ba9232e862830232c0640..51e6d5d803b2764d6562ffc325cc5775c2389cd8 100644
+--- a/interfaces/prompting/patterns/patterns_test.go
++++ b/interfaces/prompting/patterns/patterns_test.go
+@@ -376,7 +376,7 @@ func (s *patternsSuite) TestPathPatternUnmarshalJSONUnhappy(c *C) {
+ 		},
+ 		{
+ 			[]byte{'"', 0x00, '"'},
+-			`invalid character '\\x00' in string literal`,
++			`invalid character '\\x00' in string.*`,
+ 		},
+ 	} {
+ 		pathPattern := patterns.PathPattern{}
+diff --git a/jsonutil/safejson/safejson_test.go b/jsonutil/safejson/safejson_test.go
+index 9bbf8dfa6ce768857bd51ef97bb45c66fae3789e..901a0975bcddffa4d8fc311b2e616570c542af23 100644
+--- a/jsonutil/safejson/safejson_test.go
++++ b/jsonutil/safejson/safejson_test.go
+@@ -86,11 +86,11 @@ func (escapeSuite) TestBadStrings(c *check.C) {
+ 
+ 	table := map[string][][]byte{
+ 		// these are from json itself (so we're not checking them):
+-		"invalid character '.+' in string literal":     cc0,
+-		"invalid character '.+' in string escape code": badesc,
+-		`invalid character '.+' in \\u .*`:             {[]byte(`"\u02"`), []byte(`"\u02zz"`)},
+-		"invalid character '\"' after top-level value": {[]byte(`"""`)},
+-		"unexpected end of JSON input":                 {[]byte(`"\"`)},
++		"invalid character '.+' in string.*":                                                                cc0,
++		"(invalid character '.+' in string escape code|invalid escape sequence .+ in string)":               badesc,
++		`(invalid character '.+' in \\u hexadecimal character escape|invalid escape sequence .+ in string)`: {[]byte(`"\u02"`), []byte(`"\u02zz"`)},
++		"invalid character '\"' after top-level value":                                                      {[]byte(`"""`)},
++		"unexpected end of JSON input":                                                                      {[]byte(`"\"`)},
+ 	}
+ 
+ 	for e, js := range table {
+diff --git a/overlord/devicestate/devicestate_test.go b/overlord/devicestate/devicestate_test.go
+index 04c6dd6ad7b19ba3015b9adfe60a5970ee70f317..3d784456f63ff040a1fb8fb7d46a7eaf8fcf5907 100644
+--- a/overlord/devicestate/devicestate_test.go
++++ b/overlord/devicestate/devicestate_test.go
+@@ -2073,7 +2073,7 @@ func (s *deviceMgrSuite) TestRunFDESetupHookErrorResult(c *C) {
+ 	st.Lock()
+ 	_, err := devicestate.DeviceManagerRunFDESetupHook(s.mgr, req)
+ 	st.Unlock()
+-	c.Assert(err, ErrorMatches, `cannot get result from fde-setup hook "op": cannot unmarshal context value for "fde-setup-result": illegal base64 data at input byte 3`)
++	c.Assert(err, ErrorMatches, `cannot get result from fde-setup hook "op": cannot unmarshal context value for "fde-setup-result": .*illegal base64 data at input byte 3`)
+ }
+ 
+ type startOfOperationTimeSuite struct {
+diff --git a/overlord/install/install_test.go b/overlord/install/install_test.go
+index eba3a0667485d7b68e3d846da3b876b7967fd183..6ade141505f81c1f7b0ea7bc9c7b53438c419e69 100644
+--- a/overlord/install/install_test.go
++++ b/overlord/install/install_test.go
+@@ -1578,9 +1578,9 @@ func (s *installSuite) TestInstallCheckEncryptedFDEHook(c *C) {
+ 		{`{"features":["a"]}`, "", device.EncryptionTypeLUKS},
+ 		{`{"features":["a","b"]}`, "", device.EncryptionTypeLUKS},
+ 		// features must be list of strings
+-		{`{"features":[1]}`, `cannot parse hook output ".*": json: cannot unmarshal number into Go struct.*`, device.EncryptionTypeNone},
+-		{`{"features":1}`, `cannot parse hook output ".*": json: cannot unmarshal number into Go struct.*`, device.EncryptionTypeNone},
+-		{`{"features":"1"}`, `cannot parse hook output ".*": json: cannot unmarshal string into Go struct.*`, device.EncryptionTypeNone},
++		{`{"features":[1]}`, `cannot parse hook output ".*": json: cannot unmarshal number into.*`, device.EncryptionTypeNone},
++		{`{"features":1}`, `cannot parse hook output ".*": json: cannot unmarshal number into.*`, device.EncryptionTypeNone},
++		{`{"features":"1"}`, `cannot parse hook output ".*": json: cannot unmarshal string into.*`, device.EncryptionTypeNone},
+ 		// valid and uses ice
+ 		{`{"features":["a","inline-crypto-engine","b"]}`, "", device.EncryptionTypeLUKSWithICE},
+ 	} {
+diff --git a/usersession/client/client_test.go b/usersession/client/client_test.go
+index ffb9c5909f468bcb8df23f577e034ffdf698a6f8..d7d5732e0462dee97f80d578818f6b61f94db2c7 100644
+--- a/usersession/client/client_test.go
++++ b/usersession/client/client_test.go
+@@ -665,7 +665,7 @@ func (s *clientSuite) TestServiceStatusWrongResultType(c *C) {
+ 	})
+ 	_, failures, err := s.cli.ServiceStatus(context.Background(), []string{"snap.foo.service"})
+ 	c.Check(failures, DeepEquals, map[int][]client.ServiceFailure{})
+-	c.Check(err, ErrorMatches, `json: cannot unmarshal string into Go value of type client.ServiceUnitStatus`)
++	c.Check(err, ErrorMatches, `json: cannot unmarshal string into .* of type client.ServiceUnitStatus`)
+ }
+ 
+ func (s *clientSuite) TestServiceStatusFailure(c *C) {
+-- 
+2.55.0
+
Risk 0/5 · Safe PKGBUILD
Result #2208

Comment

This change only bumps pkgrel from 1 to 2 in PKGBUILD; no source URLs, checksums, build steps, install scripts, permissions, or dependencies are altered. There is no new attack surface or integrity concern visible in the diff, so the change is effectively a packaging rebuild/release bump only.

@@ -9,7 +9,7 @@ depends=('squashfs-tools' 'libseccomp' 'libsystemd' 'libcap' 'apparmor')
 optdepends=('bash-completion: bash completion support'
             'xdg-desktop-portal: desktop integration')
 pkgver=2.76.2
-pkgrel=1
+pkgrel=2
 arch=('x86_64' 'i686' 'armv7h' 'aarch64')
 url="https://github.com/snapcore/snapd"
 license=('GPL3')
Risk 0/5 · Safe PKGBUILD
Result #2209

Comment

The change only adds a vendored patch to relax Go 1.27 test assertions and updates the PKGBUILD checksums accordingly. The new source is fetched over HTTPS from the official snapd GitHub release, and the patch content is limited to test expectation regexes; it does not introduce build-time network access, privilege escalation, install-script changes, or packaging behavior changes. No supply-chain or persistence red flags are present in this diff.

@@ -19,9 +19,11 @@ options=('!strip' 'emptydirs' '!lto')
 install=snapd.install
 source=(
     "$pkgname-$pkgver.tar.xz::https://github.com/snapcore/${pkgname}/releases/download/${pkgver}/${pkgname}_${pkgver}.vendor.tar.xz"
+    "0001-tests-fix-json-error-assertions-for-Go-1.27-17472.patch"
 )
 
-sha256sums=('873fedb8525057c2b276003c2f90c2e5f7b541ec1bb409a6f489c51b5c72af2b')
+sha256sums=('873fedb8525057c2b276003c2f90c2e5f7b541ec1bb409a6f489c51b5c72af2b'
+           '0a091ec38ffbe653db698a96ae3486233746711da138e2e5793cff97b523f3f2')
 
 
 prepare() {