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

Fix/537/detect region from git remote #724

Merged
merged 1 commit into from
May 30, 2022

Conversation

mrunichs
Copy link
Contributor

@mrunichs mrunichs commented May 16, 2022

Fix #537

  • Detect region from current git remote

  • appdetect package has been replaced by detect which handles app and region detection

  • Git related methods have been moved in the utils package

  • Add a changelog entry in the section "To Be Released" of CHANGELOG.md

@mrunichs mrunichs marked this pull request as ready for review May 16, 2022 13:33
@mrunichs mrunichs requested review from EtienneM and johnsudaar May 16, 2022 13:33
utils/git.go Outdated Show resolved Hide resolved
cmd/autocomplete/current_app.go Outdated Show resolved Hide resolved
detect/app.go Outdated Show resolved Hide resolved
detect/region.go Outdated Show resolved Hide resolved
detect/region.go Outdated Show resolved Hide resolved
detect/region.go Outdated Show resolved Hide resolved
detect/region.go Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
utils/git.go Outdated Show resolved Hide resolved
utils/git.go Outdated Show resolved Hide resolved
utils/git.go Outdated Show resolved Hide resolved
detect/region.go Outdated Show resolved Hide resolved
detect/region.go Outdated Show resolved Hide resolved
detect/region.go Outdated Show resolved Hide resolved
detect/region.go Outdated Show resolved Hide resolved
detect/app.go Outdated Show resolved Hide resolved
detect/app.go Outdated Show resolved Hide resolved
@mrunichs mrunichs force-pushed the fix/537/detect_region_from_git_remote branch from 0b85353 to 2f23272 Compare May 26, 2022 20:01
@mrunichs mrunichs requested review from johnsudaar and EtienneM May 26, 2022 20:08

"github.com/Scalingo/cli/config"
"github.com/Scalingo/cli/utils"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure your IDE is correctly configured?

Suggested change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix that and have a look at my linter configuration.

"gopkg.in/errgo.v1"

"github.com/Scalingo/cli/utils"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

if dir, ok := utils.DetectGit(); ok {
remotes, err := utils.ScalingoGitRemotes(dir)
if err != nil {
debug.Println(err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the errors not returned and directly printed in a debug log? This is not the choice made for apps (cf. GetAppNameFromGitRemote).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same for the app part (CurrentApp), at first, this error was simply ignored, @johnsudaar thought it could be convenient to print it in a debug log. It's not a blocking error, we do not want to make anything out of it. We simply return an empty string and the --region flag is use instead.

@johnsudaar johnsudaar requested a review from EtienneM May 27, 2022 13:52
@mrunichs mrunichs merged commit 2556aba into master May 30, 2022
@mrunichs mrunichs deleted the fix/537/detect_region_from_git_remote branch May 30, 2022 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Git App Detect] Detect region from the git url
3 participants