-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(autofix): Add GitHub Copilot agent provider UI #106290
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b995bb8
feat(autofix): Add GitHub Copilot agent provider UI
JoshFerge 635fde2
fix(autofix): Fix lint and TypeScript errors in Copilot UI
JoshFerge 42463ba
fix(autofix): Handle nullable integration id in nextSteps.tsx
JoshFerge e994682
fix(autofix): Update test to use agent: prefix instead of cursor:
JoshFerge 2e2bba9
fix(autofix): Make localStorage preference backwards compatible
JoshFerge 2619c55
ref(autofix): Use PluginIcon alias for github_copilot instead of helper
JoshFerge 80e5ba4
chore(autofix): Restore deleted code comments
JoshFerge cc6107a
fix(autofix): Restore original styled component positions and styling
JoshFerge 9d869cc
revert: Remove v2/nextSteps.tsx changes for follow-up PR
JoshFerge 3647a72
fix(autofix): Handle nullable integration id in v2/nextSteps.tsx
JoshFerge 1947abd
ref(autofix): Use Container component instead of styled Card
JoshFerge ee7b202
Merge branch 'master' into jferg/github-copilot-frontend
JoshFerge d849f00
fix(autofix): Use correct Container prop name 'radius' instead of 'bo…
JoshFerge 4fc6bf2
fix(autofix): Update GitHub Copilot feature flag name
JoshFerge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
static/app/components/events/autofix/githubCopilotIntegrationCta.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| import {Container, Flex} from '@sentry/scraps/layout'; | ||
| import {Heading, Text} from '@sentry/scraps/text'; | ||
|
|
||
| import {LinkButton} from 'sentry/components/core/button/linkButton'; | ||
| import {ExternalLink} from 'sentry/components/core/link'; | ||
| import {useCodingAgentIntegrations} from 'sentry/components/events/autofix/useAutofix'; | ||
| import Placeholder from 'sentry/components/placeholder'; | ||
| import {t, tct} from 'sentry/locale'; | ||
| import {PluginIcon} from 'sentry/plugins/components/pluginIcon'; | ||
| import useOrganization from 'sentry/utils/useOrganization'; | ||
|
|
||
| export function GithubCopilotIntegrationCta() { | ||
| const organization = useOrganization(); | ||
|
|
||
| const {data: codingAgentIntegrations, isLoading: isLoadingIntegrations} = | ||
| useCodingAgentIntegrations(); | ||
|
|
||
| const githubCopilotIntegration = codingAgentIntegrations?.integrations.find( | ||
| integration => integration.provider === 'github_copilot' | ||
| ); | ||
|
|
||
| const hasGithubCopilotFeatureFlag = organization.features.includes( | ||
| 'integrations-github-copilot-agent' | ||
| ); | ||
| const hasGithubCopilotIntegration = Boolean(githubCopilotIntegration); | ||
|
|
||
| if (!hasGithubCopilotFeatureFlag) { | ||
| return null; | ||
| } | ||
|
|
||
| if (isLoadingIntegrations) { | ||
| return ( | ||
| <Container | ||
| padding="xl" | ||
| border="primary" | ||
| radius="md" | ||
| marginTop="2xl" | ||
| marginBottom="2xl" | ||
| > | ||
| <Placeholder height="120px" /> | ||
| </Container> | ||
| ); | ||
| } | ||
|
|
||
| if (!hasGithubCopilotIntegration) { | ||
| return ( | ||
| <Container | ||
| padding="xl" | ||
| border="primary" | ||
| radius="md" | ||
| marginTop="2xl" | ||
| marginBottom="2xl" | ||
| > | ||
| <Flex direction="column" gap="lg"> | ||
| <Heading as="h3"> | ||
| <Flex direction="row" gap="sm" align="center"> | ||
| <PluginIcon pluginId="github" /> <span>GitHub Copilot Integration</span> | ||
| </Flex> | ||
| </Heading> | ||
| <Text> | ||
| {tct( | ||
| 'Connect GitHub Copilot to hand off Seer root cause analysis to GitHub Copilot coding agent for seamless code fixes. [docsLink:Read the docs] to learn more.', | ||
| { | ||
| docsLink: ( | ||
| <ExternalLink href="https://docs.sentry.io/organization/integrations/github-copilot/" /> | ||
| ), | ||
| } | ||
| )} | ||
| </Text> | ||
| <div> | ||
| <LinkButton | ||
| to={`/settings/${organization.slug}/integrations/github_copilot/`} | ||
| priority="default" | ||
| size="sm" | ||
| > | ||
| {t('Install GitHub Copilot Integration')} | ||
| </LinkButton> | ||
| </div> | ||
| </Flex> | ||
| </Container> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <Container | ||
| padding="xl" | ||
| border="primary" | ||
| radius="md" | ||
| marginTop="2xl" | ||
| marginBottom="2xl" | ||
| > | ||
| <Flex direction="column" gap="lg"> | ||
| <Heading as="h3"> | ||
| <Flex direction="row" gap="sm" align="center"> | ||
| <PluginIcon pluginId="github" /> <span>GitHub Copilot Integration</span> | ||
| </Flex> | ||
| </Heading> | ||
| <Text> | ||
| {tct( | ||
| 'GitHub Copilot integration is installed. You can trigger GitHub Copilot from Issue Fix to create pull requests. [docsLink:Read the docs] to learn more.', | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: update this copy
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (can be done in a follow up, the flag is not on for anyone atm) |
||
| { | ||
| docsLink: ( | ||
| <ExternalLink href="https://docs.sentry.io/organization/integrations/github-copilot/" /> | ||
| ), | ||
| } | ||
| )} | ||
| </Text> | ||
| </Flex> | ||
| </Container> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.