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

feat: autoconfigure github repos #712

Merged
merged 4 commits into from
May 21, 2024

Conversation

ryan-timothy-albert
Copy link
Contributor

If speakeasy configure github is called from a directory with a remote default we

  1. Prompt asking if they would like to install the app similar to what is seen in the webapp
  2. If the app is installed we will move forward with automatically configuring secrets and permission in their repo.

Copy link
Contributor Author

@ryan-timothy-albert ryan-timothy-albert left a comment

Choose a reason for hiding this comment

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

Looking into what's going on with this test. Something with the go SDK

@@ -499,6 +503,39 @@ func configureGithub(ctx context.Context, _flags ConfigureGithubFlags) error {

ctx = events.SetTargetInContext(ctx, workingDir)

// check if the git repository is a github URI
event := shared.CliEvent{}
events.EnrichEventWithGitMetadata(ctx, &event)
Copy link
Member

Choose a reason for hiding this comment

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

nit: I feel like this is a bit of a hack. Can we just expose a method like GetGitMetadata that is used both inside EnrichEvent and here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya I was just trying to not change it in core, I can do that

cmd/configure.go Outdated Show resolved Hide resolved

if continueAfterInstall {
browser.OpenURL(appInstallURL)
logger.Println(styles.Info.Render("Install the Github App then continue with `speakeasy configure github`!\n"))
Copy link
Member

Choose a reason for hiding this comment

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

Can we not wait until we detect its installed, then continue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could poll. But I'm not sure that's the best idea.

  1. We don't know what kind of caching github has in place
  2. Sometimes a user may not have the right permissions to install it by themselves.

Polling just felt kind of weird to me

Copy link
Member

@chase-crumbaugh chase-crumbaugh left a comment

Choose a reason for hiding this comment

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

Some nits, nothing that important

@ryan-timothy-albert ryan-timothy-albert merged commit d6992e3 into main May 21, 2024
5 checks passed
@ryan-timothy-albert ryan-timothy-albert deleted the integrate_github_app_prompts branch May 21, 2024 21:46
LukeHagar pushed a commit that referenced this pull request Jun 13, 2024
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.

None yet

2 participants