Skip to content
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

[ScmRepoLink] Cannot link an app to a repo link #520

Closed
johnsudaar opened this issue Feb 11, 2020 · 1 comment · Fixed by #521
Closed

[ScmRepoLink] Cannot link an app to a repo link #520

johnsudaar opened this issue Feb 11, 2020 · 1 comment · Fixed by #521
Labels
bug

Comments

@johnsudaar
Copy link
Member

@johnsudaar johnsudaar commented Feb 11, 2020

When checking if the app is already linked, we use the following condition:

if scerr, ok := errors.ErrgoRoot(err).(*http.RequestFailedError); ok || (ok && scerr.Code != 404) {
	return errgo.Notef(err, "fail to get the integration link for this app")
}

Howerver if there is a 404 error (which is likely since the app should not be linked), err will be something like:

&http.RequestFailedError{
  Code: 404
}

So ok will be true.

Since the condition for failure is:

ok || (ok && scerr.Code != 404)

This will be true || false => true and we will fail.

@johnsudaar johnsudaar added the bug label Feb 11, 2020
@johnsudaar

This comment has been minimized.

Copy link
Member Author

@johnsudaar johnsudaar commented Feb 11, 2020

This bug was introduced here: https://github.com/Scalingo/cli/pull/515/files

johnsudaar added a commit that referenced this issue Feb 11, 2020
Fix #520
@Soulou Soulou closed this in #521 Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.