fix: Make github app target location choice obvious#3848
fix: Make github app target location choice obvious#3848cursor[bot] wants to merge 1 commit intomainfrom
Conversation
Replace the single optional organization text field with a select dropdown that makes the choice between personal account and organization explicit. The 'Install target' select field defaults to 'My personal account' and offers 'An organization' as the second option. When 'An organization' is selected, the organization name field appears via visibility conditions. This follows the same pattern used by GitLab integration (authType select with visibility-conditional fields). Closes #1575
|
👋 Commands for maintainers:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| Label: "Organization", | ||
| Type: configuration.FieldTypeString, | ||
| Description: "Organization to install the app into. If not specified, the app will be installed into the user's account.", | ||
| Required: true, |
There was a problem hiding this comment.
Organization field unconditionally required instead of conditionally required
Medium Severity
The organization field uses Required: true with VisibilityConditions, but the validation framework in ValidateConfiguration checks Required unconditionally — it does not respect VisibilityConditions. This means if validation is applied to integration configs, personal account setups will fail because organization is always treated as required. The codebase provides RequiredConditions specifically for this use case, and the GitLab integration pattern (which the PR description says it follows) notably does NOT set Required: true on its conditionally visible fields. The field needs RequiredConditions matching the same condition used in VisibilityConditions instead of Required: true.


Summary
Replaces the single optional "Organization" text field in the GitHub integration setup with an explicit two-option select dropdown that makes the choice between personal account and organization obvious.
Changes
Backend (
pkg/integrations/github/github.go):InstallTargetfield toConfigurationstruct with constantsInstallTargetPersonalandInstallTargetOrganiationConfiguration()to return:VisibilityConditionsTests (
pkg/integrations/github/github_test.go):InstallTargetconfiguration fieldPattern
This follows the same established pattern used by the GitLab integration, which uses a select field (
authType) withVisibilityConditionsto conditionally show fields based on the selected option.No frontend changes are needed — the existing
ConfigurationFieldRendereralready handlesselectfields andvisibilityConditionscorrectly.Closes #1575