Verified Commit f79fc936 authored by Patrick Rice's avatar Patrick Rice 🌆 Committed by GitLab
Browse files

Merge branch 'release-client-3.0' into 'main'

Release client-go 3.0

See merge request !3026

BREAKING CHANGE: Release 3.0
parents 9301ec7e 38ec2b20
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -65,8 +65,8 @@ stages:
  parallel:
    matrix:
      - GOLANG_IMAGE_VERSION:
          - "1.25"
          - "1.26"
          - "1.27"

.go:base:
  extends:
@@ -124,7 +124,7 @@ golangci-lint:
    REPORT_FILENAME: "gl-code-quality-report.json"
  image: golang:1.27-bookworm
  script:
    - golangci-lint run
    - go list -f '{{.Dir}}' -m | xargs golangci-lint run
  artifacts:
    reports:
      codequality: $REPORT_FILENAME
@@ -173,7 +173,7 @@ tests:unit:
    COVERPROFILE_FILENAME: coverage.out
    COVERPROFILE_XML_FILENAME: coverage.xml
  script:
    - go run gotest.tools/gotestsum@${GOTESTSUM_VERSION} --format=standard-quiet --junitfile=$JUNIT_FILENAME -- -race -coverprofile=$COVERPROFILE_FILENAME -covermode=atomic ./...
    - go run gotest.tools/gotestsum@${GOTESTSUM_VERSION} --format=standard-quiet --junitfile=$JUNIT_FILENAME -- -race -coverprofile=$COVERPROFILE_FILENAME -covermode=atomic work
    - grep -v '_generated.go' "$COVERPROFILE_FILENAME" | grep -v '_mock.go' > "${COVERPROFILE_FILENAME}.tmp"
    - mv "${COVERPROFILE_FILENAME}.tmp" "$COVERPROFILE_FILENAME"
    - go run github.com/boumenot/gocover-cobertura@${GOCOVER_COBERTURA_VERSION} < $COVERPROFILE_FILENAME > $COVERPROFILE_XML_FILENAME
+2 −0
Original line number Diff line number Diff line
@@ -65,6 +65,8 @@ linters:
    modernize:
      disable:
        - omitzero
        # TODO: migrate Ptr(x) calls to new(x) in a follow-up MR.
        - newexpr
    revive:
      enable-all-rules: false
      rules:
+5 −4
Original line number Diff line number Diff line
@@ -10,10 +10,11 @@ reviewable: setup generate fmt lint test ## Run before committing.

fmt: ## Format code
	@buf format -w
	@gofumpt -l -w *.go testing/*.go gitlab_test/*.go
	@gofumpt -l -w *.go testing/*.go
	@gofumpt -l -w config/*.go

lint: ## Run linter
	@golangci-lint run
	@go list -f '{{.Dir}}' -m | xargs golangci-lint run
	@buf format --exit-code
	@buf lint

@@ -36,10 +37,10 @@ clean: ## Remove generated files
		*_generated_test.go

test: ## Run tests
	go test ./... -race
	go test work -race

test-integration: ## Run integration tests
	go test ./... -race -tags=integration
	go test ./gitlab_test/... -race -tags=integration -v

testacc-up: ## Launch a GitLab instance.
	GITLAB_TOKEN=$(GITLAB_TOKEN) $(CONTAINER_COMPOSE_ENGINE) up -d $(SERVICE)
+1 −1
Original line number Diff line number Diff line
@@ -193,8 +193,8 @@ import (
	"fmt"
	"log"

	"gitlab.com/gitlab-org/api/client-go/config/v2"
	"gitlab.com/gitlab-org/api/client-go/v2"
	"gitlab.com/gitlab-org/api/client-go/v2/config"
)

func main() {
+2 −3
Original line number Diff line number Diff line
@@ -27,8 +27,8 @@ import (
	"buf.build/go/protovalidate"
	"buf.build/go/protoyaml"
	"github.com/zalando/go-keyring"
	"gitlab.com/gitlab-org/api/client-go/config/v2/v1beta1"
	gitlab "gitlab.com/gitlab-org/api/client-go/v2"
	"gitlab.com/gitlab-org/api/client-go/v2/config/v1beta1"
	"gitlab.com/gitlab-org/api/client-go/v2/gitlaboauth2"
	"golang.org/x/oauth2"
	"golang.org/x/time/rate"
@@ -900,8 +900,7 @@ func (c *Config) resolveCredentialSource(cs *v1beta1.CredentialSource) (string,
		output, err := cmd.Output()
		if err != nil {
			e := fmt.Errorf("unable to read credential from command output: %w", err)
			var ee *exec.ExitError
			if errors.As(err, &ee) {
			if ee, ok := errors.AsType[*exec.ExitError](err); ok {
				if ee.ExitCode() == CredentialSourceNotFoundExitCode {
					return "", &errCredentialSourceNotFound{inner: e}
				}
Loading