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

Use go-gh config package #5771

Merged
merged 2 commits into from Jun 23, 2022
Merged

Use go-gh config package #5771

merged 2 commits into from Jun 23, 2022

Conversation

samcoe
Copy link
Contributor

@samcoe samcoe commented Jun 7, 2022

This PR changes all uses of config to now use the go-gh config package. The majority of non-test file changes are just modifying the return values from cfg.DefaultHost(), since it no longer returns an error.

Follow up to cli/go-gh#44 and cli/go-gh#45.
cc #5560

@samcoe samcoe self-assigned this Jun 7, 2022
ghrepo.SetDefaultHost(host)
}
host, _ := cfg.DefaultHost()
ghrepo.SetDefaultHost(host)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

After this change we will be able to remove this and use ghAuth.DefaultHost() inside of ghrepo instead of the defaultHostOverride variable.

This comment was marked as spam.

@samcoe samcoe force-pushed the config-integration branch 3 times, most recently from 1e0d995 to e64b4f4 Compare June 8, 2022 21:02
@samcoe samcoe marked this pull request as ready for review June 23, 2022 04:03
@samcoe samcoe requested a review from a team as a code owner June 23, 2022 04:03
@samcoe samcoe requested review from mislav and removed request for a team June 23, 2022 04:03
@cliAutomation cliAutomation added this to Needs review 🤔 in The GitHub CLI Jun 23, 2022
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

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

Thanks for the giant body of work!

This diff could have been potentially made smaller by keeping some old interfaces and their return values the same: the Aliases API, for example, cfg.Set, and DefaultHost. If something used to return an error before but doesn't anymore, it would have been fine to keep returning a nil error (for example). But now that you've already done the legwork to rewrite all the call points, I guess that's fine!

internal/config/stub.go Outdated Show resolved Hide resolved
The GitHub CLI automation moved this from Needs review 🤔 to Needs to be merged 🎉 Jun 23, 2022
@samcoe samcoe enabled auto-merge (squash) June 23, 2022 11:42
@samcoe samcoe merged commit cacff4a into trunk Jun 23, 2022
The GitHub CLI automation moved this from Needs to be merged 🎉 to Pending Release 🥚 Jun 23, 2022
@samcoe samcoe deleted the config-integration branch June 23, 2022 11:50
@github-actions github-actions bot moved this from Pending Release 🥚 to Done 💤 in The GitHub CLI Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
The GitHub CLI
  
Done 💤
Development

Successfully merging this pull request may close these issues.

None yet

3 participants