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

Add GitHub Login and Create PR Button for Committing Devcontainer #9

Open
nkkko opened this issue Sep 25, 2024 · 0 comments
Open

Add GitHub Login and Create PR Button for Committing Devcontainer #9

nkkko opened this issue Sep 25, 2024 · 0 comments

Comments

@nkkko
Copy link
Member

nkkko commented Sep 25, 2024

Is your feature request related to a problem? Please describe.
Currently, users can generate devcontainer.json but have to manually commit it to the repository. Adding a GitHub login and an option to create a pull request (PR) directly from the interface will streamline the process.

Describe the solution you'd like

  • Implement a GitHub login option to authenticate users.
  • After successful login, display a "Create PR" button to commit the generated devcontainer.json directly to the repository.
  • Ensure that the PR creation process:
    1. Forks the repository to the user's GitHub account.
    2. Commits the generated devcontainer.json to the forked repository.
    3. Creates a pull request from the fork to the original repository.

Describe alternatives you've considered

  • Manually instructing users on how to copy and commit the devcontainer.json via GitHub interface.
  • Using external GitHub CLI tools, which would complicate the workflow compared to an integrated solution.

Additional context

  1. GitHub Login Integration:

    • Use OAuth to handle GitHub authentication.
    • Store user tokens securely for subsequent API calls.
  2. Frontend Changes:

    • Add the "Create PR" button after successful login and devcontainer.json generation.
  3. Backend Changes:

    • Update main.py to handle OAuth callback and store user token.
    • Implement a function to fork the repository, commit changes, and create a pull request using GitHub API.

Example Flow:

  • User clicks "Login with GitHub".
  • After authentication, the user generates the devcontainer.json.
  • A "Create PR" button appears.
  • Clicking the "Create PR" button forks the repo, commits the devcontainer.json, and creates a pull request.

Security Considerations:

  • Ensure tokens are securely stored and managed.
  • Handle user permissions carefully to avoid unauthorized changes.
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

No branches or pull requests

1 participant