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

[Feature]: Auto-create github repo on cargo shuttle init #988

Closed
1 task done
beyarkay opened this issue Jun 9, 2023 · 3 comments
Closed
1 task done

[Feature]: Auto-create github repo on cargo shuttle init #988

beyarkay opened this issue Jun 9, 2023 · 3 comments
Labels
T-Feature Request A request for a new feature

Comments

@beyarkay
Copy link
Contributor

beyarkay commented Jun 9, 2023

Describe the feature

It would be super slick if one of the options in the cargo shuttle init workflow was to create a GH repo and setup CI/CD on the user's behalf.

The process might look something like:

  1. If the user says yes, create a new github repo on the user's behalf (initialised with the shuttle GH workflow)
  2. Continue the regular initialization process
  3. After the project code is initialized, push the project to github.
  4. Give the user a link so they can see the github runner compiling and deploying their new project.

If logging in with GitHub gives shuttle a GH API key, then this shouldn't require any additional authentication by the user. If the user has to go into GitHub and get an API key for shuttle to use, then this feature probably isn't worth it.

Since users log in with GitHub, would cargo shuttle init be able to make authenticated calls to the GitHub API to create a new repo on their behalf?

Suggestion or Example of how the feature would be used

$ cargo shuttle init
How do you want to name your project? It will be hosted at ${project_name}.shuttleapp.rs.
✔ Project name · my-new-project

[omitting the other steps that init takes]

? Should we create a new GitHub repository and set it up with our GitHub actions workflow? (y/n) › yes

 Adding github workflow to project...
 Creating repository https://github.com/MY_USERNAME/my-new-project...

 Done! Your project will auto-deploy every time you push to the `main` branch on GitHub.

So when the user uses cargo shuttle init, it will not only setup the project locally, but also setup CI/CD for them.

Maybe it would be a good idea to require that tests pass before deploying, but that's a different discussion.

Duplicate declaration

  • I have searched the issues and this feature has not been requested before.
@jonaro00
Copy link
Member

jonaro00 commented Jun 9, 2023

I would personally not want cargo shuttle to mess with a GitHub api key. Creating and pushing to a repo is trivial enough.

I like the idea to include the official CD action though! Not sure if it is necessary to automate adding it, but it should at the very least be added to the docs!
I'm working on a PR that revamps the init command right now (#984). I can take a look at how it could be implemented.

@beyarkay
Copy link
Contributor Author

beyarkay commented Jun 9, 2023

Ah cool! I wasn't sure if shuttle maybe already had some permissions with GitHub due to the login being via through github. But I agree, if it's not there already it definitely isn't worth the hassle of adding it just for this convenience.

I'll close this issue in deference to your one #984, it would be cool to have something there 😄

@beyarkay beyarkay closed this as completed Jun 9, 2023
@oddgrd
Copy link
Contributor

oddgrd commented Jun 9, 2023

Hey, thanks for the suggestion! I agree that this may be a bit much for the CLI right now, since we will also be able to init examples with all the CI config set up now after #888.

We are planning a git integration for our upcoming console (web-based dashboard) down the line that will initialize a github repo from a template, so keep an eye out for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Feature Request A request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants