-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(signals): wrong-repo dismissals feed repo selection #90022
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
Open
sortafreel
wants to merge
25
commits into
master
Choose a base branch
from
posthog/wrong-repo-dismissal-feedback
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7b8494e
feat(signals): wrong-repo dismissals feed repo selection
sortafreel f62155e
fix(signals): harden the wrong-repo correction loop after review
sortafreel f9449f5
test(mcp): update unit test snapshots
tests-posthog[bot] 96547a5
chore: update OpenAPI generated types
tests-posthog[bot] ea15557
Merge branch 'master' into posthog/wrong-repo-dismissal-feedback
sortafreel 9d0d460
test(mcp): update unit test snapshots
tests-posthog[bot] b7f5ff4
fix(signals): publish corrected_repository non-empty rule in schema
posthog[bot] b04466f
fix(signals): load wrong-repo picker on reason, not popover state
posthog[bot] 259bf0b
fix(signals): surface repo lookup errors in wrong-repo picker
posthog[bot] 2709407
fix(signals): align wrong_repo help text with recorded selection
posthog[bot] 0a337f1
fix(signals): stop Enter in repo picker from submitting dismiss form
posthog[bot] 02a84e4
docs(signals): correct wrong-repo restore re-research wording
posthog[bot] 242a116
docs(signals): correct unconnected-correction gate rationale
posthog[bot] 43fdc38
test(mcp): update unit test snapshots
tests-posthog[bot] b386149
fix(signals): gate corrected_repository on reason and normalize casing
sortafreel b9879ae
fix(desktop): keep dismiss dialog open while repo picker is open
sortafreel 53250b1
fix(signals): clear repo selection on uncorrected wrong-repo dismissal
sortafreel 8750da7
fix(signals): stop in-flight runs burying mid-run repo corrections
sortafreel ca25262
perf(signals): index artefacts for team-wide corrections reads
sortafreel 2cb4018
fix(signals): drop deleted reports from the corrections feed
sortafreel eb32bd8
chore(signals): document wrong_repo dismissal in MCP tool descriptions
posthog[bot] 5affc6a
chore: update OpenAPI generated types
tests-posthog[bot] ddf73ec
fix(signals): stop auto-start when a reviewer supersedes the repository
posthog[bot] b069b0d
fix(signals): detect task-attributed wrong-repo corrections mid-run
posthog[bot] e6a27f5
fix(signals): add a clear action to the wrong-repo correction picker
posthog[bot] 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
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
65 changes: 65 additions & 0 deletions
65
products/desktop/packages/ui/src/features/inbox/components/DismissReportDialog.test.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,65 @@ | ||
| import type { SignalReport } from "@posthog/shared/types"; | ||
| import { fireEvent, render, screen } from "@testing-library/react"; | ||
| import { afterEach, describe, expect, it, vi } from "vitest"; | ||
|
|
||
| import { DismissReportDialog } from "./DismissReportDialog"; | ||
|
|
||
| const connectedRepositories = ["posthog/posthog", "posthog/posthog-js"]; | ||
|
|
||
| // Mirrors the real hook's cold-cache behavior: it yields repositories only while enabled | ||
| // (the query is gated off when disabled, so the list is empty). Capturing the enabled | ||
| // argument is what lets the test assert the fetch is driven by the reason, not the popover. | ||
| const useGithubRepositoriesSpy = vi.fn((_search: string, enabled: boolean) => ({ | ||
| repositories: enabled ? connectedRepositories : [], | ||
| isPending: false, | ||
| isFetchingMore: false, | ||
| hasMore: false, | ||
| loadMore: vi.fn(), | ||
| })); | ||
|
|
||
| vi.mock("@posthog/ui/features/integrations/useIntegrations", () => ({ | ||
| useIntegrations: vi.fn(), | ||
| useGithubRepositories: (search: string, enabled: boolean) => | ||
| useGithubRepositoriesSpy(search, enabled), | ||
| })); | ||
|
|
||
| vi.mock("@posthog/ui/features/integrations/store", () => ({ | ||
| useIntegrationSelectors: () => ({ hasGithubIntegration: true }), | ||
| })); | ||
|
|
||
| const report = { title: "Something broke" } as SignalReport; | ||
|
|
||
| describe("DismissReportDialog", () => { | ||
| afterEach(() => { | ||
| vi.clearAllMocks(); | ||
| }); | ||
|
|
||
| it("offers an openable repository picker on a cold cache once wrong-repo is chosen", () => { | ||
| render( | ||
| <DismissReportDialog | ||
| open | ||
| onOpenChange={vi.fn()} | ||
| report={report} | ||
| isSubmitting={false} | ||
| snoozeDisabledReason={null} | ||
| onConfirm={vi.fn()} | ||
| />, | ||
| ); | ||
|
|
||
| const wrongRepoRadio = screen | ||
| .getByText("Agent picked the wrong repository") | ||
| .closest("div") | ||
| ?.querySelector("#dismiss-report-dialog-reason-wrong_repo"); | ||
| if (!wrongRepoRadio) { | ||
| throw new Error("Expected the wrong-repo reason radio to render"); | ||
| } | ||
| fireEvent.click(wrongRepoRadio); | ||
|
|
||
| // The repositories load on the reason alone, so with the picker still closed it renders | ||
| // its openable trigger, not the dead-end disabled "No GitHub repos" button that a | ||
| // fetch gated on the popover state would leave the reviewer stuck on. | ||
| expect(screen.getByText("Search repositories")).toBeInTheDocument(); | ||
| expect(screen.queryByText("No GitHub repos")).not.toBeInTheDocument(); | ||
| expect(useGithubRepositoriesSpy).toHaveBeenLastCalledWith("", true); | ||
| }); | ||
| }); |
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.