Skip to content
Merged
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
16 changes: 8 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:
- name: Get golangci-lint configuration file
run: wget --output-document=$(pwd)/.golangci.yml https://sc-devtools.s3.eu-west-1.amazonaws.com/golang-ci/golangci.yml
- name: Get master branch commit ID
id: new-from-rev
run: echo "NEW_FROM_REV=$( git rev-parse origin/master )" >> "$GITHUB_OUTPUT"
id: new-from-merge-base
run: echo "NEW-FROM-MERGE-BASE=$( git rev-parse origin/master )" >> "$GITHUB_OUTPUT"
- name: "Execute golangci-lint on a pull request"
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v8
with:
# The `only-new-issues` flag is not working (https://github.com/golangci/golangci-lint-action/issues/531).
# We rather decided to use the suggestion from the FAQ (https://golangci-lint.run/welcome/faq/#how-to-integrate-golangci-lint-into-large-project-with-thousands-of-issues) and use `--new-from-rev`
# We rather decided to use the suggestion from the FAQ (https://golangci-lint.run/welcome/faq/#how-to-integrate-golangci-lint-into-large-project-with-thousands-of-issues) and use `--new-from-merge-base`
# only-new-issues: false
args: "--config=$(pwd)/.golangci.yml --new-from-rev=${{ steps.new-from-rev.outputs.NEW_FROM_REV }}"
args: "--config=$(pwd)/.golangci.yml --new-from-merge-base=${{ steps.new-from-merge-base.outputs.NEW-FROM-MERGE-BASE }}"

linter-master:
name: golangci-lint on master branch
Expand All @@ -53,12 +53,12 @@ jobs:
- name: Get golangci-lint configuration file
run: wget --output-document=$(pwd)/.golangci.yml https://sc-devtools.s3.eu-west-1.amazonaws.com/golang-ci/golangci.yml
- name: "Execute golangci-lint on the master branch"
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v8
with:
# The `only-new-issues` flag is not working (https://github.com/golangci/golangci-lint-action/issues/531).
# We rather decided to use the suggestion from the FAQ (https://golangci-lint.run/usage/faq/#how-to-integrate-golangci-lint-into-large-project-with-thousands-of-issues) and use `--new-from-rev`
# We rather decided to use the suggestion from the FAQ (https://golangci-lint.run/usage/faq/#how-to-integrate-golangci-lint-into-large-project-with-thousands-of-issues) and use `--new-from-merge-base`
# only-new-issues: false
args: "--config=$(pwd)/.golangci.yml --new-from-rev=HEAD~1"
args: "--config=$(pwd)/.golangci.yml --new-from-merge-base=HEAD~1"

tests:
name: Unit Tests
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

### To be Released

* feat(regionmigrations): remove the commands
* feat(regionmigrations): remove the commands [#1104](https://github.com/Scalingo/cli/pull/1104)
* chore(go) update go version to 1.24 [#1108](https://github.com/Scalingo/cli/pull/1108)

### 1.34.0

Expand Down
10 changes: 5 additions & 5 deletions apps/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ func (w *OperationWaiter) SetPrompt(p string) {
func (w *OperationWaiter) WaitOperation(ctx context.Context) (*scalingo.Operation, error) {
opURL, err := url.Parse(w.url)
if err != nil {
return nil, errors.Notef(ctx, err, "parse url of operation")
return nil, errors.Wrap(ctx, err, "parse url of operation")
}

c, err := config.ScalingoClient(ctx)
if err != nil {
return nil, errors.Notef(ctx, err, "get Scalingo client")
return nil, errors.Wrap(ctx, err, "get Scalingo client")
}

var op *scalingo.Operation
Expand All @@ -70,7 +70,7 @@ func (w *OperationWaiter) WaitOperation(ctx context.Context) (*scalingo.Operatio

op, err = c.OperationsShow(ctx, w.app, opID)
if err != nil {
return nil, errors.Notef(ctx, err, "get operation %v", opID)
return nil, errors.Wrapf(ctx, err, "get operation %v", opID)
}

go func() {
Expand All @@ -89,15 +89,15 @@ func (w *OperationWaiter) WaitOperation(ctx context.Context) (*scalingo.Operatio
}
}()

fmt.Fprintf(w.output, w.prompt)
fmt.Fprint(w.output, w.prompt)
spinner := io.NewSpinner(os.Stderr)
go spinner.Start()
defer spinner.Stop()

for {
select {
case err := <-errs:
return op, errors.Notef(ctx, err, "get operation %v", op.ID)
return op, errors.Wrapf(ctx, err, "get operation %v", op.ID)
case <-done:
if op.Status == "done" {
fmt.Printf("\bDone in %.3f seconds\n", op.ElapsedDuration())
Expand Down
9 changes: 5 additions & 4 deletions git/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
gitconfig "github.com/go-git/go-git/v5/config"
errgo "gopkg.in/errgo.v1"

"github.com/pkg/errors"

"github.com/Scalingo/cli/io"
"github.com/Scalingo/cli/utils"
"github.com/Scalingo/go-scalingo/v7/debug"
)

Expand Down Expand Up @@ -63,10 +64,10 @@ func createRemoteInRepository(repository *git.Repository, remoteName string, url
URLs: []string{url},
})
if err != nil {
errWrapped := utils.WrapError(err, "fail to create the Git remote")
errWrapped := errors.Wrapf(err, "create the Git remote")
if err == git.ErrRemoteExists {
message := "Fail to configure git repository, '" + remoteName + "' remote already exists (use --force option to override)"
errWrapped = utils.WrapError(errWrapped, message)
errWrapped = errors.Wrap(errWrapped, message)
}
return errWrapped
}
Expand All @@ -76,7 +77,7 @@ func createRemoteInRepository(repository *git.Repository, remoteName string, url
func deleteThenCreateRemoteInRepository(repository *git.Repository, remoteName string, url string) error {
err := repository.DeleteRemote(remoteName)
if err != nil {
return utils.WrapError(err, "fail to delete the Git remote")
return errors.Wrap(err, "delete the Git remote")
}
return createRemoteInRepository(repository, remoteName, url)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Scalingo/cli

go 1.23.4
go 1.24.2

require (
github.com/AlecAivazis/survey/v2 v2.3.7
Expand Down
6 changes: 0 additions & 6 deletions utils/errors.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package utils

import (
"gopkg.in/errgo.v1"

"github.com/Scalingo/go-scalingo/v7/http"
errors "github.com/Scalingo/go-utils/errors/v2"
)
Expand All @@ -15,7 +13,3 @@ func IsRegionDisabledError(err error) bool {
httperr, ok := reqerr.APIError.(http.ForbiddenError)
return ok && httperr.Code == "region_disabled"
}

func WrapError(err error, wrappingMessage string) error {
return errgo.Notef(err, wrappingMessage)
}