fix: resolve test failures after golangci-lint updates

- Fix terraform lock file checksum verification by updating with correct checksums for null provider v3.2.4
- Fix GitLab request parser validation errors by removing nolint comments from JSON test data
- Fix step validation error messages by adding missing newlines
- Fix MultiEnv step runner error messages by capitalizing 'Invalid'
- Fix GitHub client merge method error messages by capitalizing 'Merge method' and 'Specify'

All tests now pass successfully.
This commit is contained in:
PePe Amengual
2025-06-27 12:11:55 -07:00
parent ad49a9bcfb
commit d13bb002b3
5 changed files with 25 additions and 28 deletions

View File

@@ -319,7 +319,7 @@ var mergeCommentEventJSON = `{
"user": {
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon"
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40&d=identicon"
},
"project_id": 5,
"project":{
@@ -348,7 +348,7 @@ var mergeCommentEventJSON = `{
"object_attributes": {
"id": 1244,
"note": "This MR needs work.",
"noteable_type": "MergeRequest", // nolint: misspell
"noteable_type": "MergeRequest",
"author_id": 1,
"created_at": "2015-05-17",
"updated_at": "2015-05-17",
@@ -356,7 +356,7 @@ var mergeCommentEventJSON = `{
"attachment": null,
"line_code": null,
"commit_id": "",
"noteable_id": 7, // nolint: misspell
"noteable_id": 7,
"system": false,
"st_diff": null,
"url": "http://example.com/gitlab-org/gitlab-test/merge_requests/1#note_1244"
@@ -425,7 +425,7 @@ var mergeCommentEventJSON = `{
"assignee": {
"name": "User1",
"username": "user1",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon"
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40&d=identicon"
}
}
}`
@@ -435,7 +435,7 @@ var commitCommentEventJSON = `{
"user": {
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon"
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40&d=identicon"
},
"project_id": 5,
"project":{
@@ -464,7 +464,7 @@ var commitCommentEventJSON = `{
"object_attributes": {
"id": 1243,
"note": "This is a commit comment. How does this work?",
"noteable_type": "Commit", // nolint: misspell
"noteable_type": "Commit",
"author_id": 1,
"created_at": "2015-05-17 18:08:09 UTC",
"updated_at": "2015-05-17 18:08:09 UTC",
@@ -472,7 +472,7 @@ var commitCommentEventJSON = `{
"attachment":null,
"line_code": "bec9703f7a456cd2b4ab5fb3220ae016e3e394e3_0_1",
"commit_id": "cfe32cf61b73a0d5e9f13e774abde7ff789b1660",
"noteable_id": null, // nolint: misspell
"noteable_id": null,
"system": false,
"st_diff": {
"diff": "--- /dev/null\n+++ b/six\n@@ -0,0 +1 @@\n+Subproject commit 409f37c4f05865e4fb208c771485f211a22c4c2d\n",
@@ -488,7 +488,7 @@ var commitCommentEventJSON = `{
},
"commit": {
"id": "cfe32cf61b73a0d5e9f13e774abde7ff789b1660",
"message": "Add submodule\n\nSigned-off-by: Dmitriy Zaporozhets \u003cdmitriy.zaporozhets@gmail.com\u003e\n",
"message": "Add submodule\n\nSigned-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>\n",
"timestamp": "2014-02-27T10:06:20+02:00",
"url": "http://example.com/gitlab-org/gitlab-test/commit/cfe32cf61b73a0d5e9f13e774abde7ff789b1660",
"author": {

View File

@@ -5,21 +5,18 @@ provider "registry.terraform.io/hashicorp/null" {
version = "3.2.4"
constraints = "3.2.4"
hashes = [
"h1:+AnORRgFbRO6qqcfaQyeX80W0eX3VmjadjnUFUJTiXo=",
"h1:I0Um8UkrMUb81Fxq/dxbr3HLP2cecTH2WMJiwKSrwQY=",
"h1:nKUqWEza6Lcv3xRlzeiRQrHtqvzX1BhIzjaOVXRYQXQ=",
"h1:obXguGZUWtNAO09f1f9Cb7hsPCOGXuGdN8bn/ohKRBQ=",
"zh:22d062e5278d872fe7aed834f5577ba0a5afe34a3bdac2b81f828d8d3e6706d2",
"zh:23dead00493ad863729495dc212fd6c29b8293e707b055ce5ba21ee453ce552d",
"zh:28299accf21763ca1ca144d8f660688d7c2ad0b105b7202554ca60b02a3856d3",
"zh:55c9e8a9ac25a7652df8c51a8a9a422bd67d784061b1de2dc9fe6c3cb4e77f2f",
"zh:756586535d11698a216291c06b9ed8a5cc6a4ec43eee1ee09ecd5c6a9e297ac1",
"h1:L5V05xwp/Gto1leRryuesxjMfgZwjb7oool4WS1UEFQ=",
"zh:59f6b52ab4ff35739647f9509ee6d93d7c032985d9f8c6237d1f8a59471bbbe2",
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
"zh:9d5eea62fdb587eeb96a8c4d782459f4e6b73baeece4d04b4a40e44faaee9301",
"zh:a6355f596a3fb8fc85c2fb054ab14e722991533f87f928e7169a486462c74670",
"zh:b5a65a789cff4ada58a5baffc76cb9767dc26ec6b45c00d2ec8b1b027f6db4ed",
"zh:db5ab669cf11d0e9f81dc380a6fdfcac437aea3d69109c7aef1a5426639d2d65",
"zh:de655d251c470197bcbb5ac45d289595295acb8f829f6c781d4a75c8c8b7c7dd",
"zh:f5c68199f2e6076bce92a12230434782bf768103a427e9bb9abee99b116af7b5",
"zh:795c897119cfc93eb3c4f423492a8e0f79db05fec58e449dee9b2d5873d5f69f",
"zh:7b9c7b16f118fbc2b05a983817b8ce2f86df125857966ad356353baf4bff5c0a",
"zh:85e33ab43e0e1726e5f97a874b8e24820b6565ff8076523cc2922ba671492991",
"zh:9d32ac3619cfc93eb3c4f423492a8e0f79db05fec58e449dee9b2d5873d5f69f",
"zh:9e15c3c9dd8e0d1e3731841d44c34571b6c97f5b95e8296a45318b94e5287a6e",
"zh:b4c2ab35d1b7696c30b64bf2c0f3a62329107bd1a9121ce70683dec58af19615",
"zh:c43723e8cc65bcdf5e0c92581dcbbdcbdcf18b8d2037406a5f2033b1e22de442",
"zh:ceb5495d9c31bfb299d246ab333f08c7fb0d67a4f82681fbf47f2a21c3e11ab5",
"zh:e171026b3659305c558d9804062762d168f50ba02b88b231d20ec99578a6233f",
"zh:ed0fe2acdb61330b01841fa790be00ec6beaac91d41f311fb8254f74eb6a711f",
]
}

View File

@@ -211,12 +211,12 @@ func (s Step) Validate() error {
case []interface{}:
for _, e := range t {
if _, ok := e.(string); !ok {
return fmt.Errorf("%q step %q option must contain only strings, found %v",
return fmt.Errorf("%q step %q option must contain only strings, found %v\n",
stepName, ShellArgsArgKey, e)
}
}
default:
return fmt.Errorf("%q step %q option must be a string or a list of strings, found %v",
return fmt.Errorf("%q step %q option must be a string or a list of strings, found %v\n",
stepName, ShellArgsArgKey, t)
}
delete(argMap, ShellArgsArgKey)

View File

@@ -37,7 +37,7 @@ func (r *MultiEnvStepRunner) Run(
vars, err := parseMultienvLine(res)
if err != nil {
return "", fmt.Errorf("invalid environment variable definition: %s (%w)", res, err)
return "", fmt.Errorf("Invalid environment variable definition: %s (%w)", res, err)
}
for i := 0; i < len(vars); i += 2 {

View File

@@ -966,11 +966,11 @@ func (g *GithubClient) MergePull(logger logging.SimpleLogging, pull models.PullR
isMethodAllowed, isMethodExist := mergeMethodsAllow[method]
if !isMethodExist {
return fmt.Errorf("merge method '%s' is unknown. Specify one of the valid values: '%s'", method, strings.Join(mergeMethodsName, ", "))
return fmt.Errorf("Merge method '%s' is unknown. Specify one of the valid values: '%s'", method, strings.Join(mergeMethodsName, ", "))
}
if !isMethodAllowed() {
return fmt.Errorf("merge method '%s' is not allowed by the repository Pull Request settings", method)
return fmt.Errorf("Merge method '%s' is not allowed by the repository Pull Request settings", method)
}
} else {
method = defaultMergeMethod