Skip to content

Commit 1f17f86

Browse files
authored
Merge pull request #254 from fluxcd/update-go-121-deps
Updating dependencies
2 parents eca42bf + 334d0a0 commit 1f17f86

35 files changed

+104
-100
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup Go
2323
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
2424
with:
25-
go-version: 1.20.x
25+
go-version: 1.21.x
2626
- name: Run vet
2727
run: make tidy fmt vet
2828
- name: Check if working tree is dirty

.github/workflows/e2e-gitea.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
- name: Setup Go
2727
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
2828
with:
29-
go-version: 1.20.x
29+
go-version: 1.21.x
3030
- name: Start Provider instances
31-
run: make start-provider-instances-gitea GITEA_VERSION=1.19.3@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a
31+
run: make start-provider-instances-gitea GITEA_VERSION=1.21.1@sha256:63165c64759c98e55f0afdb5fc3be64cbb27180d3474e951fa027228e6955029
3232
- name: Run tests [gitea]
3333
run: |
3434
export GITEA_TOKEN=$(cat /tmp/gitea-token)

.github/workflows/e2e-github.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup Go
2323
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
2424
with:
25-
go-version: 1.20.x
25+
go-version: 1.21.x
2626
- name: Run tests
2727
run: |
2828
[ -n "${{ secrets.GITPROVIDER_BOT_TOKEN }}" ] && export GITHUB_TOKEN=${{ secrets.GITPROVIDER_BOT_TOKEN }} || echo "using default GITHUB_TOKEN"

.github/workflows/e2e-gitlab.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Go
2727
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
2828
with:
29-
go-version: 1.20.x
29+
go-version: 1.21.x
3030
- name: Start Provider instances
3131
run: make start-provider-instances-gitlab
3232
- name: Run tests [gitlab]

.github/workflows/e2e-stash.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup Go
2323
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
2424
with:
25-
go-version: 1.20.x
25+
go-version: 1.21.x
2626
- name: Run tests
2727
run: |
2828
[ -n "${{ secrets.STASH_TOKEN }}" ] && export STASH_TOKEN=${{ secrets.STASH_TOKEN }} || echo "using default STASH_TOKEN"

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup Go
2424
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
2525
with:
26-
go-version: 1.20.x
26+
go-version: 1.21.x
2727
- name: Download release notes utility
2828
env:
2929
GH_REL_URL: https://github.com/buchanae/github-release-notes/releases/download/0.2.0/github-release-notes-linux-amd64-0.2.0.tar.gz

gitea/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func NewClient(token string, optFns ...gitprovider.ClientOption) (gitprovider.Cl
5959

6060
gt, err := gitea.NewClient(baseURL, gitea.SetHTTPClient(httpClient), gitea.SetToken(token))
6161
if err != nil {
62-
return nil, err
62+
return nil, fmt.Errorf("failed to create Gitea client: %w", err)
6363
}
6464
// By default, turn destructive actions off. But allow overrides.
6565
destructiveActions := false

gitea/client_repository_pullrequest.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ func (c *PullRequestClient) Merge(ctx context.Context, number int, mergeMethod g
102102
}
103103

104104
if !done {
105+
if resp.StatusCode != 200 {
106+
return fmt.Errorf("merge failed: %s", resp.Status)
107+
}
105108
return fmt.Errorf("merge failed")
106109
}
107110

gitea/client_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ import (
2828
)
2929

3030
func Test_DomainVariations(t *testing.T) {
31-
32-
giteaBaseUrl = "http://try.gitea.io"
31+
giteaBaseUrl := "http://try.gitea.io"
3332
if giteaBaseUrlVar := os.Getenv("GITEA_BASE_URL"); giteaBaseUrlVar != "" {
3433
giteaBaseUrl = giteaBaseUrlVar
3534
}
3635

36+
token := ""
37+
if giteaToken := os.Getenv("GITEA_TOKEN"); giteaToken != "" {
38+
token = giteaToken
39+
}
40+
3741
u, err := url.Parse(giteaBaseUrl)
3842
if err != nil {
3943
t.Fatalf("failed parsing base URL %q: %s", giteaBaseUrl, err)
@@ -58,7 +62,7 @@ func Test_DomainVariations(t *testing.T) {
5862
}
5963
for _, tt := range tests {
6064
t.Run(tt.name, func(t *testing.T) {
61-
c1, err := NewClient("token", tt.opts)
65+
c1, err := NewClient(token, tt.opts)
6266
if err != nil {
6367
if tt.expectedErrPattern == "" {
6468
t.Fatalf("unexpected error: %s", err)

gitea/integration_repositories_org_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ var _ = Describe("Gitea Provider", func() {
206206
Expect(err).ToNot(HaveOccurred())
207207
Expect(len(keys)).To(Equal(0))
208208

209-
rsaGen := testutils.NewRSAGenerator(2154)
209+
rsaGen := testutils.NewRSAGenerator(3071)
210210
keyPair1, err := rsaGen.Generate()
211211
Expect(err).ToNot(HaveOccurred())
212212
pubKey := keyPair1.PublicKey

0 commit comments

Comments
 (0)