feat: github app can be created on organization and can be made public#677
feat: github app can be created on organization and can be made public#677hamir-suspect wants to merge 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for creating GitHub Apps on organizations (instead of just personal accounts) and makes them public if desired. Users are now presented with a setup form to configure these options before being redirected to GitHub's app creation flow.
- Introduces a new setup page (
GithubAppSetup) where users can choose between personal/organization accounts and set app visibility - Updates backend API to accept
is_publicandorganizationquery parameters and construct the appropriate GitHub URL - Refactors configuration to use a base URL instead of a hardcoded install URL
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| guard/lib/guard/instance_config/github_app.ex | Adds is_public parameter to manifest generation |
| guard/lib/guard/instance_config/api.ex | Extracts query parameters and dynamically constructs GitHub URL based on organization |
| guard/config/prod.exs | Changes config from full install URL to base URL |
| front/test/support/stubs/feature.ex | Adds rbac__groups feature stub for tests |
| front/assets/js/git_integration/pages/index.ts | Exports new GithubAppSetup component |
| front/assets/js/git_integration/pages/github_app_setup.tsx | New setup page with form for configuring GitHub App creation |
| front/assets/js/git_integration/components/integration_starter.tsx | Changes from form submission to navigation link |
| front/assets/js/git_integration/app.tsx | Adds route for GitHub App setup page |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (accountType === "organization" && organizationName.trim()) { | ||
| urlWithToken.searchParams.append(`organization`, organizationName.trim()); | ||
| } |
There was a problem hiding this comment.
The organization name is only whitespace-trimmed before being sent to the backend. Consider validating the organization name format (e.g., GitHub organization names can only contain alphanumeric characters and hyphens) to prevent potential issues with invalid characters being passed through.
| window.location.href = urlWithToken.toString(); | ||
| }; | ||
|
|
||
| export const IntegrationStarter = (_props: IntegrationStarterProps) => { |
There was a problem hiding this comment.
The connectButtonUrl prop is no longer used but remains in the interface. Consider removing it from IntegrationStarterProps since the component now navigates to a hardcoded route instead of using the provided URL.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| required | ||
| /> | ||
| <p className="f6 gray mt2 mb0"> | ||
| The exact name of your GitHub organization |
There was a problem hiding this comment.
Please extend this line with info that you need to be an admin on this organization.
📝 Description
Connect button for github app instead of going straight to github with our github app manifest will prompt for a few possible modifications of manifest. This enables users using CE/EE installations to easily create github app on their organization instead of (previously hardcoded) personal account. Also allows making the github app public.
✅ Checklist