Skip to content

Fix different test failures #890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stages:
- release

default:
image: golang:1.18
image: golang:1.21
tags:
- gitlab-org

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ os:
- linux

go:
- 1.18.x
- 1.21.x

# use containers which run faster and have cache
sudo: false
Expand Down
8 changes: 4 additions & 4 deletions cmd/ci_view_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,22 +422,22 @@ func Test_jobsView(t *testing.T) {
" │ Stage1 │ │ Stage2 │ │ Stage3 │ ",
" └────────────────────┘ └────────────────────┘ └────────────────────┘ ",
" ",
" ╔✔ stage1-job1-reall…╗ ┌───● stage2-job1───┐ ┌───● stage3-job1───┐ ",
" ╔✔ stage1-job1-reall…╗ ┌───● stage2-job1───┐ ┌───● stage3-job1───┐ ",
" ║ ║ │ │ │ │ ",
" ║ 01m 01s║━┳━━┳━│ │━┳━━┳━│ │ ",
" ╚════════════════════╝ ┃ ┃ └────────────────────┘ ┃ ┃ └────────────────────┘ ",
" ┃ ┃ ┃ ┃ ",
" ┌───✔ stage1-job2───┐ ┃ ┃ ┌───● stage2-job2───┐ ┃ ┃ ┌───● stage3-job2───┐ ",
" ┌───✔ stage1-job2───┐ ┃ ┃ ┌───● stage2-job2───┐ ┃ ┃ ┌───● stage3-job2───┐ ",
" │ │ ┃ ┃ │ │ ┃ ┃ │ │ ",
" │ │━┫ ┣━│ │━┫ ┗━│ │ ",
" └────────────────────┘ ┃ ┃ └────────────────────┘ ┃ └────────────────────┘ ",
" ┃ ┃ ┃ ",
" ┌───✔ stage1-job3───┐ ┃ ┃ ┌───● stage2-job3───┐ ┃ ",
" ┌───✔ stage1-job3───┐ ┃ ┃ ┌───● stage2-job3───┐ ┃ ",
" │ │ ┃ ┃ │ │ ┃ ",
" │ │━┫ ┗━│ │━┛ ",
" └────────────────────┘ ┃ └────────────────────┘ ",
" ┃ ",
" ┌───✘ stage1-job4───┐ ┃ ",
" ┌───✘ stage1-job4───┐ ┃ ",
" │ │ ┃ ",
" │ │━┛ ",
" └────────────────────┘ ",
Expand Down
15 changes: 6 additions & 9 deletions cmd/mr_discussion.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ var mrCreateDiscussionCmd = &cobra.Command{
return
}

var notePos gitlab.PositionOptions
var discussionOpts gitlab.CreateMergeRequestDiscussionOptions
if position != "" {
if commit == "" {
// We currently only support "--position" when commenting on individual commits within an MR.
Expand Down Expand Up @@ -150,7 +150,7 @@ var mrCreateDiscussionCmd = &cobra.Command{
oldLine := int(oldLine64)

positionType := "text"
notePos = gitlab.PositionOptions{
discussionOpts.Position = &gitlab.PositionOptions{
BaseSHA: &parentSHA,
StartSHA: &parentSHA,
HeadSHA: &commit,
Expand All @@ -165,16 +165,13 @@ var mrCreateDiscussionCmd = &cobra.Command{
if body == "" {
log.Fatal("aborting discussion due to empty discussion msg")
}
var commitID *string
discussionOpts.Body = &body

if commit != "" {
commitID = &commit
discussionOpts.CommitID = &commit
}

discussionURL, err := lab.MRCreateDiscussion(rn, int(mrNum), &gitlab.CreateMergeRequestDiscussionOptions{
Body: &body,
CommitID: commitID,
Position: &notePos,
})
discussionURL, err := lab.MRCreateDiscussion(rn, int(mrNum), &discussionOpts)
if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/mr_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func Test_mrFilterByTargetBranch(t *testing.T) {
}

var (
latestCreatedTestMR = "!1447 Test for mr approval rules"
latestCreatedTestMR = "!1476 create mr request"
latestUpdatedTestMR = "!329 MR for assign and review commands"
)

Expand Down
1 change: 1 addition & 0 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ func mapLabelsAsLabelOptions(rn string, labelTerms []string) (gitlab.LabelOption

return gitlab.LabelOptions(matches), nil
}

// dumpToken dumps information about a specific Personal Access Token
func dumpToken(tokendata *gitlab.PersonalAccessToken) {
fmt.Println("ID: ", tokendata.ID)
Expand Down
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ require (
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)

require (
Expand Down Expand Up @@ -68,7 +66,6 @@ require (
github.com/rivo/uniseg v0.4.4 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/whilp/git-urls v1.0.0
Expand All @@ -87,4 +84,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

go 1.17
go 1.21
Loading