Skip to content

Commit 3d2828a

Browse files
feat!: MAJOR release. Update go to 1.25, and add migration path (#520)
BREAKING CHANGE: This bumps Go and external packages to later versions.
1 parent 7dba805 commit 3d2828a

61 files changed

Lines changed: 358 additions & 266 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/go.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ jobs:
2121
- uses: actions/checkout@v3
2222
- uses: actions/setup-go@v4
2323
with:
24-
go-version: '1.23.1'
24+
go-version: '1.25.1'
2525
cache: false
2626
- name: golangci-lint
27-
uses: golangci/golangci-lint-action@v3
27+
uses: golangci/golangci-lint-action@v7
2828
with:
29-
version: v1.61.0
29+
version: v2.7.2
3030
only-new-issues: true
3131
skip-cache: true
3232
- name: Install staticcheck
33-
run: go install honnef.co/go/tools/cmd/staticcheck@2024.1.1
33+
run: go install honnef.co/go/tools/cmd/staticcheck@2025.1.1
34+
3435
- name: Run staticcheck
3536
run: staticcheck ./...
3637
go_test:
@@ -42,8 +43,9 @@ jobs:
4243
- name: Set up Go
4344
uses: actions/setup-go@v4
4445
with:
45-
go-version: '1.19'
46+
go-version: '1.25.1'
4647
- name: Build
4748
run: make compile
4849
- name: Test
4950
run: make test
51+

.github/workflows/tag-and-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ jobs:
3939
with:
4040
token: ${{ secrets.GITHUB_TOKEN }}
4141
tag: ${{ needs.tag.outputs.tag }}
42-
body: ${{ github.event.head_commit.message }}
43-
skipIfReleaseExists: true # Do not release if NONE tag is used above
42+
generateReleaseNotes: true
43+
skipIfReleaseExists: true # Do not release if NONE tag is used above

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ tests/plugins
88
!tests/plugins/.placeholder
99
luacov.*
1010
tags
11+
.claude
12+
cmd/cmd

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: "2"
12
run:
23
tests: true
34
timeout: 30s

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To view these help docs and to get more detailed help information, please run `:
1818

1919
## Requirements
2020

21-
- <a href="https://go.dev/">Go</a> >= v1.19
21+
- <a href="https://go.dev/">Go</a> >= v1.25.1
2222

2323
## Quick Start
2424

cmd/app/approve.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import (
44
"encoding/json"
55
"net/http"
66

7-
"github.com/xanzy/go-gitlab"
7+
gitlab "gitlab.com/gitlab-org/api/client-go"
88
)
99

1010
type MergeRequestApprover interface {
11-
ApproveMergeRequest(pid interface{}, mr int, opt *gitlab.ApproveMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)
11+
ApproveMergeRequest(pid interface{}, mr int64, opt *gitlab.ApproveMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error)
1212
}
1313

1414
type mergeRequestApproverService struct {

cmd/app/approve_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import (
44
"net/http"
55
"testing"
66

7-
"github.com/xanzy/go-gitlab"
7+
gitlab "gitlab.com/gitlab-org/api/client-go"
88
)
99

1010
type fakeApproverClient struct {
1111
testBase
1212
}
1313

14-
func (f fakeApproverClient) ApproveMergeRequest(pid interface{}, mr int, opt *gitlab.ApproveMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error) {
14+
func (f fakeApproverClient) ApproveMergeRequest(pid interface{}, mr int64, opt *gitlab.ApproveMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequestApprovals, *gitlab.Response, error) {
1515
resp, err := f.handleGitlabError()
1616
if err != nil {
1717
return nil, nil, err

cmd/app/assignee.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import (
55
"errors"
66
"net/http"
77

8-
"github.com/xanzy/go-gitlab"
8+
gitlab "gitlab.com/gitlab-org/api/client-go"
99
)
1010

1111
type AssigneeUpdateRequest struct {
12-
Ids []int `json:"ids" validate:"required"`
12+
Ids []int64 `json:"ids" validate:"required"`
1313
}
1414

1515
type AssigneeUpdateResponse struct {

cmd/app/assignee_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import (
44
"net/http"
55
"testing"
66

7-
"github.com/xanzy/go-gitlab"
7+
gitlab "gitlab.com/gitlab-org/api/client-go"
88
)
99

1010
type fakeAssigneeClient struct {
1111
testBase
1212
}
1313

14-
func (f fakeAssigneeClient) UpdateMergeRequest(pid interface{}, mergeRequest int, opt *gitlab.UpdateMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) {
14+
func (f fakeAssigneeClient) UpdateMergeRequest(pid interface{}, mergeRequest int64, opt *gitlab.UpdateMergeRequestOptions, options ...gitlab.RequestOptionFunc) (*gitlab.MergeRequest, *gitlab.Response, error) {
1515
resp, err := f.handleGitlabError()
1616
if err != nil {
1717
return nil, nil, err
@@ -20,7 +20,7 @@ func (f fakeAssigneeClient) UpdateMergeRequest(pid interface{}, mergeRequest int
2020
}
2121

2222
func TestAssigneeHandler(t *testing.T) {
23-
var updatePayload = AssigneeUpdateRequest{Ids: []int{1, 2}}
23+
var updatePayload = AssigneeUpdateRequest{Ids: []int64{1, 2}}
2424

2525
t.Run("Updates assignees", func(t *testing.T) {
2626
request := makeRequest(t, http.MethodPut, "/mr/assignee", updatePayload)

cmd/app/attachment.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"net/http"
99
"os"
1010

11-
"github.com/xanzy/go-gitlab"
11+
gitlab "gitlab.com/gitlab-org/api/client-go"
1212
)
1313

1414
type FileReader interface {
@@ -48,7 +48,7 @@ func (ar attachmentReader) ReadFile(path string) (io.Reader, error) {
4848
}
4949

5050
type FileUploader interface {
51-
UploadFile(pid interface{}, content io.Reader, filename string, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectFile, *gitlab.Response, error)
51+
UploadProjectMarkdown(pid any, content io.Reader, filename string, options ...gitlab.RequestOptionFunc) (*gitlab.ProjectMarkdownUploadedFile, *gitlab.Response, error)
5252
}
5353

5454
type attachmentService struct {
@@ -67,7 +67,7 @@ func (a attachmentService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
6767
return
6868
}
6969

70-
projectFile, res, err := a.client.UploadFile(a.projectInfo.ProjectId, file, payload.FileName)
70+
projectFile, res, err := a.client.UploadProjectMarkdown(a.projectInfo.ProjectId, file, payload.FileName)
7171
if err != nil {
7272
handleError(w, err, fmt.Sprintf("Could not upload %s to Gitlab", payload.FileName), http.StatusInternalServerError)
7373
return

0 commit comments

Comments
 (0)