Skip to content

Commit

Permalink
Merge pull request #492 from Scalingo/fix/491/integration_link_no_int…
Browse files Browse the repository at this point in the history
…egration_link

Do not get the SCM integration when showing the integration link
  • Loading branch information
EtienneM committed Sep 24, 2019
2 parents cf6ed38 + 5e107a7 commit ecfd2ae
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 39 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,9 @@

### To be Released

* Do not get the SCM integration when showing the integration link
[#492](https://github.com/Scalingo/cli/pull/492)

### 1.16.1

* Global commands do not need to query the list of regions
Expand Down
6 changes: 3 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions cmd/integration_link.go
Expand Up @@ -89,7 +89,7 @@ var (
errorQuit(err)
}

var params scalingo.SCMRepoLinkParams
var params scalingo.SCMRepoLinkCreateParams
if c.NumFlags() == 0 {
params, err = interactiveCreate()
if err != nil {
Expand Down Expand Up @@ -123,7 +123,7 @@ var (
}
hoursBeforeDestroyOnStale := c.Uint("hours-before-destroy-on-stale")

params = scalingo.SCMRepoLinkParams{
params = scalingo.SCMRepoLinkCreateParams{
Branch: &branch,
AutoDeployEnabled: &autoDeploy,
DeployReviewAppsEnabled: &deployReviewApps,
Expand Down Expand Up @@ -302,8 +302,8 @@ var (
}
)

func interactiveCreate() (scalingo.SCMRepoLinkParams, error) {
var params scalingo.SCMRepoLinkParams
func interactiveCreate() (scalingo.SCMRepoLinkCreateParams, error) {
var params scalingo.SCMRepoLinkCreateParams
if config.C.DisableInteractive {
return params, errors.New("need at least one integration link parameter")
}
Expand Down
1 change: 1 addition & 0 deletions config/config.go
Expand Up @@ -153,6 +153,7 @@ func (config Config) scalingoClientBaseConfig(opts ClientConfigOpts) scalingo.Cl
Region: opts.Region,
AuthEndpoint: config.ScalingoAuthUrl,
APIToken: opts.APIToken,
UserAgent: "Scalingo CLI v" + Version,
}
}

Expand Down
2 changes: 1 addition & 1 deletion integrationlink/create.go
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/Scalingo/go-scalingo"
)

func Create(app string, integrationType scalingo.SCMType, integrationURL string, params scalingo.SCMRepoLinkParams) error {
func Create(app string, integrationType scalingo.SCMType, integrationURL string, params scalingo.SCMRepoLinkCreateParams) error {
u, err := url.Parse(integrationURL)
if err != nil || u.Scheme == "" || u.Host == "" || u.Path == "" {
return errors.New("source repository URL is not valid")
Expand Down
4 changes: 2 additions & 2 deletions integrationlink/params.go
Expand Up @@ -6,9 +6,9 @@ import (
"github.com/Scalingo/go-scalingo"
)

func CheckAndFillParams(c *cli.Context, app string) (*scalingo.SCMRepoLinkParams, error) {
func CheckAndFillParams(c *cli.Context, app string) (*scalingo.SCMRepoLinkUpdateParams, error) {
paramsChecker := newParamsChecker(c)
params := &scalingo.SCMRepoLinkParams{
params := &scalingo.SCMRepoLinkUpdateParams{
Branch: paramsChecker.lookupBranch(),
AutoDeployEnabled: paramsChecker.lookupAutoDeploy(),
DeployReviewAppsEnabled: paramsChecker.lookupDeployReviewApps(),
Expand Down
11 changes: 5 additions & 6 deletions integrationlink/show.go
Expand Up @@ -27,18 +27,17 @@ func Show(app string) error {
return nil
}

i, err := c.SCMIntegrationsShow(repoLink.AuthIntegrationUUID)
if err != nil {
return errgo.Notef(err, "fail to get integration information of this integration link")
}

fmt.Printf("%s: %s (%s)\n",
color.New(color.FgYellow).Sprint("Application"),
app, repoLink.AppID,
)
fmt.Printf("%s: %s (%s)\n",
color.New(color.FgYellow).Sprint("Integration"),
scalingo.SCMTypeDisplay[i.SCMType], repoLink.AuthIntegrationUUID,
scalingo.SCMTypeDisplay[repoLink.SCMType], repoLink.AuthIntegrationUUID,
)
fmt.Printf("%s: %s\n",
color.New(color.FgYellow).Sprint("Linker"),
repoLink.Linker.Username,
)
fmt.Println()

Expand Down
2 changes: 1 addition & 1 deletion integrationlink/update.go
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/Scalingo/go-scalingo"
)

func Update(app string, params scalingo.SCMRepoLinkParams) error {
func Update(app string, params scalingo.SCMRepoLinkUpdateParams) error {
if app == "" {
return errgo.New("no app defined")
}
Expand Down
5 changes: 5 additions & 0 deletions vendor/github.com/Scalingo/go-scalingo/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 15 additions & 14 deletions vendor/github.com/Scalingo/go-scalingo/http/api_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/github.com/Scalingo/go-scalingo/http/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion vendor/github.com/Scalingo/go-scalingo/http/errors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 18 additions & 7 deletions vendor/github.com/Scalingo/go-scalingo/scm_repo_link.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/github.com/Scalingo/go-scalingo/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ecfd2ae

Please sign in to comment.