Skip to content

ref(seer): Rewrite AutofixRepositories using the new /seer/repos/ endpoints#117630

Closed
ryan953 wants to merge 0 commit into
ryan953/ref-combine-AutofixRepositoriesfrom
ref-autofix-repos
Closed

ref(seer): Rewrite AutofixRepositories using the new /seer/repos/ endpoints#117630
ryan953 wants to merge 0 commit into
ryan953/ref-combine-AutofixRepositoriesfrom
ref-autofix-repos

Conversation

@ryan953

@ryan953 ryan953 commented Jun 15, 2026

Copy link
Copy Markdown
Member

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 15, 2026
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-7nx3jdfo7.sentry.dev

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.70% 93.70% ±0%
Typed 132,876 132,936 🟢 +60
Untyped 8,937 8,937 ±0
🔍 1 new type safety issue introduced

Non-null assertions (!) (1 new)

File Line Detail
static/app/components/seer/legacy/addAutofixRepoModal.tsx 162 filteredRepositories[virtualItem.index]!

This is informational only and does not block the PR.

Comment on lines +84 to +91
// Save the whole form?
// const {mutateAsync: handleFormSubmit} = useMutation(
// getMutateSeerProjectReposOptionsReplaceRepos({
// organization,
// project,
// queryClient,
// })
// );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Save the whole form?
// const {mutateAsync: handleFormSubmit} = useMutation(
// getMutateSeerProjectReposOptionsReplaceRepos({
// organization,
// project,
// queryClient,
// })
// );

@ryan953 ryan953 force-pushed the ryan953/ref-combine-AutofixRepositories branch from 3894f91 to a76ecf7 Compare June 15, 2026 15:50
@ryan953 ryan953 force-pushed the ref-autofix-repos branch from e8b5f31 to f8432c7 Compare June 15, 2026 15:50
@ryan953 ryan953 marked this pull request as ready for review June 15, 2026 20:31
@ryan953 ryan953 requested review from a team as code owners June 15, 2026 20:31

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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 4 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f8432c7. Configure here.

Comment thread static/gsApp/views/seerAutomation/onboarding/onboardingLegacy.tsx Outdated
Comment thread static/app/components/seer/legacy/addAutofixRepoModal.tsx Outdated
Comment thread static/app/components/seer/legacy/addAutofixRepoModal.tsx Outdated
Comment thread static/app/components/seer/projectDetails/index.tsx Outdated
@ryan953 ryan953 force-pushed the ryan953/ref-combine-AutofixRepositories branch from a76ecf7 to 753461c Compare June 15, 2026 20:34
@ryan953 ryan953 requested review from a team as code owners June 15, 2026 20:34
Comment on lines +147 to +150
{modalSearchQuery.trim() &&
selectedExternalIds.length === filteredRepositories.length
? t('All available repositories have been added.')
: t('No matching repositories found.')}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The empty state message logic in the repository selection modal is inverted, showing the wrong message for "no search results" versus "all repos already added".
Severity: MEDIUM

Suggested Fix

The conditional logic for the empty state message should be corrected. Instead of checking selectedExternalIds.length, the logic should differentiate between two scenarios: an empty list due to a user's search query yielding no results, versus an empty list because all available repositories have already been added to the project.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/components/seer/legacy/addAutofixRepoModal.tsx#L147-L150

Potential issue: The logic for displaying an empty state message in the
`addAutofixRepoModal` is flawed. The condition `selectedExternalIds.length ===
filteredRepositories.length` is used to decide between showing "No matching repositories
found" and "All available repositories have been added". When the list of
`filteredRepositories` is empty, this condition incorrectly depends on whether the user
has selected items within the modal, rather than the reason for the list being empty.
This results in showing "All available repositories have been added" when a search
yields no results, and "No matching repositories found" when all repositories are
already connected, which is confusing for the user.

Did we get this right? 👍 / 👎 to inform future reviews.

Comment on lines +95 to +98
});
}, []);

// Virtualizer setup (simplified based on docs)
useEffect(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The check preventing selection of more than MAX_REPOS_LIMIT (8) repositories was removed, allowing users to add more than the intended maximum number of repos.
Severity: MEDIUM

Suggested Fix

Reintroduce the guard within the handleToggleRepository function. Before adding a new repository to the selectedExternalIds state, check if selectedExternalIds.length is already greater than or equal to MAX_REPOS_LIMIT. If it is, prevent the addition and return the existing state.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/components/seer/legacy/addAutofixRepoModal.tsx#L95-L98

Potential issue: The `handleToggleRepository` function was refactored to remove a check
that prevented users from selecting more than `MAX_REPOS_LIMIT` (defined as 8)
repositories. While a `useEffect` hook shows an alert when the limit is reached, it does
not prevent the user from continuing to select more repositories. The submit handler and
the backend endpoint also lack validation to enforce this limit. This allows a user to
add more than the maximum of 8 repositories to a project for Autofix, which could lead
to unexpected backend behavior or violate system constraints.

Did we get this right? 👍 / 👎 to inform future reviews.

@ryan953 ryan953 closed this Jun 15, 2026
@ryan953 ryan953 force-pushed the ref-autofix-repos branch from f8432c7 to 753461c Compare June 15, 2026 20:34
@ryan953 ryan953 deleted the ref-autofix-repos branch June 15, 2026 20:36
@ryan953 ryan953 restored the ref-autofix-repos branch June 15, 2026 20:38
ryan953 added a commit that referenced this pull request Jun 16, 2026
…points (#117740)

This meant adding a `includeInstructions` prop to the new version, which
revealed that the inputs needed to be debounced. apparently saving a
default-branch name before was problematic

With instructions added
<img width="819" height="547" alt="SCR-20260614-lqlb"
src="https://github.com/user-attachments/assets/325af416-9b42-4de1-b190-f8bc874ecd79"
/>


Note: these were originally stacked into
#117618 and
#117630 but i messed that up
somehow to update things on master. So now they're together and ready to
go. No changes made since before.

---------

Co-authored-by: Claude Opus 4 <noreply@anthropic.com>
Co-authored-by: Ryan Albrecht <ryan953@MLHJDQR9VJ.local>
Co-authored-by: billy <billy@sentry.io>
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
sehr-m pushed a commit that referenced this pull request Jun 23, 2026
…points (#117740)

This meant adding a `includeInstructions` prop to the new version, which
revealed that the inputs needed to be debounced. apparently saving a
default-branch name before was problematic

With instructions added
<img width="819" height="547" alt="SCR-20260614-lqlb"
src="https://github.com/user-attachments/assets/325af416-9b42-4de1-b190-f8bc874ecd79"
/>


Note: these were originally stacked into
#117618 and
#117630 but i messed that up
somehow to update things on master. So now they're together and ready to
go. No changes made since before.

---------

Co-authored-by: Claude Opus 4 <noreply@anthropic.com>
Co-authored-by: Ryan Albrecht <ryan953@MLHJDQR9VJ.local>
Co-authored-by: billy <billy@sentry.io>
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants