From a60f6ed245bf1c842f1aae14333f71b76eeb8871 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 01:29:34 +0000 Subject: [PATCH 1/6] fix(deps): update github.com/opentofu/tofudl digest to d4254f2 in go.mod (main) (#5305) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d17aafafc9..e425456953 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/moby/patternmatcher v0.6.0 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/opentofu/tofudl v0.0.0-20240923062014-8c1e00f33ce6 + github.com/opentofu/tofudl v0.0.0-20250129123822-d4254f2a6147 github.com/petergtz/pegomock/v4 v4.1.0 github.com/pkg/errors v0.9.1 github.com/redis/go-redis/v9 v9.7.0 diff --git a/go.sum b/go.sum index 699c99f807..2ba4cc3960 100644 --- a/go.sum +++ b/go.sum @@ -358,8 +358,8 @@ github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU= github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts= github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= -github.com/opentofu/tofudl v0.0.0-20240923062014-8c1e00f33ce6 h1:+1yJm0gEoDaxYmMhmmU3gRAOMx3A43z84bokm1dQroU= -github.com/opentofu/tofudl v0.0.0-20240923062014-8c1e00f33ce6/go.mod h1:CD1BhvxxNPp4ZBwNBjWycf5isG9UaPrzfE7J/E/s6RY= +github.com/opentofu/tofudl v0.0.0-20250129123822-d4254f2a6147 h1:FRrWXOEB5P/rmDbXNON3erWlAxe8NtxEeAfYqMk0oRY= +github.com/opentofu/tofudl v0.0.0-20250129123822-d4254f2a6147/go.mod h1:HeIabsnOzo0WMnIRqI13Ho6hEi6tu2nrQpzSddWL/9w= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/petergtz/pegomock/v4 v4.1.0 h1:Reoy2rlwshuxNaD2ZWp5TrSCrmoFH5SSLHb5U1z2pog= From 33b0c708101bee8d72f64c0ec4d9593ce29aeb85 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Thu, 6 Feb 2025 13:31:22 -0500 Subject: [PATCH 2/6] chore(goreleaser): update for deprecated attributes (#5304) Signed-off-by: Rui Chen --- .goreleaser.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 52d450ba21..77130c453b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -26,7 +26,8 @@ builds: archives: - id: zip name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" - format: zip + formats: + - zip files: - none* From 72750fda06d67a54b9035fbf591fee2ea637bc5f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 01:02:50 +0000 Subject: [PATCH 3/6] chore(deps): update docker/setup-buildx-action digest to f7ce87c in .github/workflows/testing-env-image.yml (main) (#5306) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/atlantis-image.yml | 4 ++-- .github/workflows/testing-env-image.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/atlantis-image.yml b/.github/workflows/atlantis-image.yml index ef18a97b78..91bc07953f 100644 --- a/.github/workflows/atlantis-image.yml +++ b/.github/workflows/atlantis-image.yml @@ -91,7 +91,7 @@ jobs: platforms: arm64,arm - name: Set up Docker Buildx - uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3 + uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3 # https://github.com/docker/build-push-action/issues/761#issuecomment-1575006515 with: driver-opts: | @@ -216,7 +216,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3 + uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3 # https://github.com/docker/build-push-action/issues/761#issuecomment-1575006515 with: driver-opts: | diff --git a/.github/workflows/testing-env-image.yml b/.github/workflows/testing-env-image.yml index e42cdab80a..30cdc60d9d 100644 --- a/.github/workflows/testing-env-image.yml +++ b/.github/workflows/testing-env-image.yml @@ -62,7 +62,7 @@ jobs: platforms: arm64,arm - name: Set up Docker Buildx - uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3 + uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3 - name: Login to Packages Container registry uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 From 6f3c2b036ae7ec2c388c68bfcc1f85e417031e8e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 8 Feb 2025 00:34:59 +0000 Subject: [PATCH 4/6] chore(deps): update docker/setup-qemu-action digest to 4574d27 in .github/workflows/testing-env-image.yml (main) (#5307) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/atlantis-image.yml | 2 +- .github/workflows/testing-env-image.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/atlantis-image.yml b/.github/workflows/atlantis-image.yml index 91bc07953f..604e8bb481 100644 --- a/.github/workflows/atlantis-image.yml +++ b/.github/workflows/atlantis-image.yml @@ -85,7 +85,7 @@ jobs: go-version-file: "go.mod" - name: Set up QEMU - uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3 + uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # v3 with: image: tonistiigi/binfmt:latest platforms: arm64,arm diff --git a/.github/workflows/testing-env-image.yml b/.github/workflows/testing-env-image.yml index 30cdc60d9d..e7ee5adb96 100644 --- a/.github/workflows/testing-env-image.yml +++ b/.github/workflows/testing-env-image.yml @@ -56,7 +56,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up QEMU - uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3 + uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # v3 with: image: tonistiigi/binfmt:latest platforms: arm64,arm From e1dcc4491845a5474c1899b5d52fae5563d55ecc Mon Sep 17 00:00:00 2001 From: Luke Massa Date: Sat, 8 Feb 2025 12:55:10 -0500 Subject: [PATCH 5/6] chore: Refactor retries in gitlab set status (#5293) Signed-off-by: Luke Massa --- server/events/vcs/gitlab_client.go | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/server/events/vcs/gitlab_client.go b/server/events/vcs/gitlab_client.go index 68f78a3829..ae7632bbb4 100644 --- a/server/events/vcs/gitlab_client.go +++ b/server/events/vcs/gitlab_client.go @@ -456,16 +456,27 @@ func (g *GitlabClient) UpdateStatus(logger logging.SimpleLogging, repo models.Re } ) - for i := 0; i < maxAttempts; i++ { + for { + attempt := int(retryer.Attempt()) + 1 logger := logger.With( - "attempt", i+1, + "attempt", attempt, "max_attempts", maxAttempts, "repo", repo.FullName, "commit", commit.ShortID, "state", state.String(), ) - _, resp, err = g.Client.Commits.SetCommitStatus(repo.FullName, pull.HeadCommit, setCommitStatusOptions) + _, resp, err := g.Client.Commits.SetCommitStatus(repo.FullName, pull.HeadCommit, setCommitStatusOptions) + if err == nil { + if retryer.Attempt() > 0 { + logger.Info("GitLab returned HTTP [200 OK] after updating commit status") + } + + return nil + } + if attempt == maxAttempts { + return errors.Wrap(err, fmt.Sprintf("failed to update commit status for '%s' @ '%s' to '%s' after %d attempts", repo.FullName, pull.HeadCommit, src, attempt)) + } if resp != nil { logger.Debug("POST /projects/%s/statuses/%s returned: %d", repo.FullName, pull.HeadCommit, resp.StatusCode) @@ -481,26 +492,15 @@ func (g *GitlabClient) UpdateStatus(logger logging.SimpleLogging, repo models.Re // GitLab does not allow merge requests to be merged when the pipeline status is "running." if resp.StatusCode == http.StatusConflict { - sleep := retryer.ForAttempt(float64(i)) - - logger.With("retry_in", sleep).Warn("GitLab returned HTTP [409 Conflict] when updating commit status") - time.Sleep(sleep) - - continue + logger.Warn("GitLab returned HTTP [409 Conflict] when updating commit status") } } - // Log we got a 200 OK response from GitLab after at least one retry to help with debugging/understanding delays/errors. - if err == nil && i > 0 { - logger.Info("GitLab returned HTTP [200 OK] after updating commit status") - } + sleep := retryer.Duration() - // Return the err, which might be nil if everything worked out - return err + logger.With("retry_in", sleep).Warn("GitLab errored when updating commit status: %w", err) + time.Sleep(sleep) } - - // If we got here, we've exhausted all attempts to update the commit status and still failed, so return the error upstream - return errors.Wrap(err, fmt.Sprintf("failed to update commit status for '%s' @ '%s' to '%s' after %d attempts", repo.FullName, pull.HeadCommit, src, maxAttempts)) } func (g *GitlabClient) GetMergeRequest(logger logging.SimpleLogging, repoFullName string, pullNum int) (*gitlab.MergeRequest, error) { From 452040f6069e7dff92921cfbf0457da702805377 Mon Sep 17 00:00:00 2001 From: Luke Massa Date: Sat, 8 Feb 2025 18:44:35 -0500 Subject: [PATCH 6/6] fix: Unintentional nil errors in azuredevops client (#5312) Signed-off-by: Luke Massa --- server/events/vcs/azuredevops_client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/events/vcs/azuredevops_client.go b/server/events/vcs/azuredevops_client.go index 77ccf948e5..f612ebd5cb 100644 --- a/server/events/vcs/azuredevops_client.go +++ b/server/events/vcs/azuredevops_client.go @@ -267,7 +267,7 @@ func (g *AzureDevopsClient) UpdateStatus(logger logging.SimpleLogging, repo mode return errors.Wrap(err, "getting pull request") } if resp.StatusCode != http.StatusOK { - return errors.Wrapf(err, "http response code %d getting pull request", resp.StatusCode) + return errors.Errorf("http response code %d getting pull request", resp.StatusCode) } if source.GetSupportsIterations() { opts := azuredevops.PullRequestIterationsListOptions{} @@ -276,7 +276,7 @@ func (g *AzureDevopsClient) UpdateStatus(logger logging.SimpleLogging, repo mode return errors.Wrap(err, "listing pull request iterations") } if resp.StatusCode != http.StatusOK { - return errors.Wrapf(err, "http response code %d listing pull request iterations", resp.StatusCode) + return errors.Errorf("http response code %d listing pull request iterations", resp.StatusCode) } for _, iteration := range iterations { if sourceRef := iteration.GetSourceRefCommit(); sourceRef != nil { @@ -297,7 +297,7 @@ func (g *AzureDevopsClient) UpdateStatus(logger logging.SimpleLogging, repo mode return errors.Wrap(err, "creating pull request status") } if resp.StatusCode != http.StatusOK { - return errors.Wrapf(err, "http response code %d creating pull request status", resp.StatusCode) + return errors.Errorf("http response code %d creating pull request status", resp.StatusCode) } return err }