Skip to content

fix: Make github app target location choice obvious#3848

Open
cursor[bot] wants to merge 1 commit intomainfrom
cursor/agent-e1122fb4
Open

fix: Make github app target location choice obvious#3848
cursor[bot] wants to merge 1 commit intomainfrom
cursor/agent-e1122fb4

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor bot commented Mar 31, 2026

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):

  • Added InstallTarget field to Configuration struct with constants InstallTargetPersonal and InstallTargetOrganiation
  • Changed Configuration() to return:
    • A select field ("Install target") with two options: "My personal account" (default) and "An organization"
    • The "Organization" text field is now conditionally visible only when "An organization" is selected, using VisibilityConditions
    • The "Organization" field is now required when visible

Tests (pkg/integrations/github/github_test.go):

  • Updated test cases to pass the new InstallTarget configuration field

Pattern

This follows the same established pattern used by the GitLab integration, which uses a select field (authType) with VisibilityConditions to conditionally show fields based on the selected option.

No frontend changes are needed — the existing ConfigurationFieldRenderer already handles select fields and visibilityConditions correctly.

Closes #1575

Open in Web Open in Cursor 

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
@superplanehq-integration
Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

Copy link
Copy Markdown
Contributor Author

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Additional Locations (1)
Fix in Cursor Fix in Web

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.

Make github app target location choice obvious

2 participants