ref(seer): Rewrite AutofixRepositories using the new /seer/repos/ endpoints#117630
ref(seer): Rewrite AutofixRepositories using the new /seer/repos/ endpoints#117630ryan953 wants to merge 0 commit into
Conversation
Story previewsPreview the stories changed in this PR on the Vercel deployment: Preview deployment: https://sentry-7nx3jdfo7.sentry.dev |
📊 Type Coverage Diff
🔍 1 new type safety issue introducedNon-null assertions (
This is informational only and does not block the PR. |
| // Save the whole form? | ||
| // const {mutateAsync: handleFormSubmit} = useMutation( | ||
| // getMutateSeerProjectReposOptionsReplaceRepos({ | ||
| // organization, | ||
| // project, | ||
| // queryClient, | ||
| // }) | ||
| // ); |
There was a problem hiding this comment.
| // Save the whole form? | |
| // const {mutateAsync: handleFormSubmit} = useMutation( | |
| // getMutateSeerProjectReposOptionsReplaceRepos({ | |
| // organization, | |
| // project, | |
| // queryClient, | |
| // }) | |
| // ); |
3894f91 to
a76ecf7
Compare
e8b5f31 to
f8432c7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
❌ 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.
a76ecf7 to
753461c
Compare
| {modalSearchQuery.trim() && | ||
| selectedExternalIds.length === filteredRepositories.length | ||
| ? t('All available repositories have been added.') | ||
| : t('No matching repositories found.')} |
There was a problem hiding this comment.
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.
| }); | ||
| }, []); | ||
|
|
||
| // Virtualizer setup (simplified based on docs) | ||
| useEffect(() => { |
There was a problem hiding this comment.
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.
f8432c7 to
753461c
Compare
…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>
…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>

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.