Skip to content

Commit

Permalink
chore(autofix): Use repo_external_id in autofix change (#73533)
Browse files Browse the repository at this point in the history
In `AutofixCodebaseChange`, use the repo external id instead. Depends on
getsentry/seer#832
  • Loading branch information
jennmueng committed Jul 2, 2024
1 parent d077a5b commit 280a003
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions static/app/components/events/autofix/autofixChanges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ function CreatePullRequestButton({
run_id: autofixData?.run_id,
payload: {
type: 'create_pr',
repo_id: change.repo_id,
repo_external_id: change.repo_external_id,
repo_id: change.repo_id, // The repo_id is only here for temporary backwards compatibility for LA customers, and we should remove it soon.
},
},
});
Expand Down Expand Up @@ -243,7 +244,7 @@ export function AutofixChanges({
return (
<Content>
{step.changes.map((change, i) => (
<Fragment key={change.repo_id}>
<Fragment key={change.repo_external_id}>
{i > 0 && <Separator />}
<AutofixRepoChange change={change} groupId={groupId} isLastStep={isLastStep} />
</Fragment>
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/events/autofix/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe('Autofix', () => {
{
title: 'Test PR Title',
description: 'Test PR Description',
repo_id: 1,
repo_external_id: '1',
repo_name: 'getsentry/sentry',
diff: [],
},
Expand Down
3 changes: 2 additions & 1 deletion static/app/components/events/autofix/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ export interface AutofixRootCauseStep extends BaseStep {
export type AutofixCodebaseChange = {
description: string;
diff: FilePatch[];
repo_id: number;
repo_name: string;
title: string;
diff_str?: string;
pull_request?: AutofixPullRequestDetails;
repo_external_id?: string;
repo_id?: number; // The repo_id is only here for temporary backwards compatibility for LA customers, and we should remove it soon. Use repo_external_id instead.
};

export interface AutofixChangesStep extends BaseStep {
Expand Down
2 changes: 1 addition & 1 deletion tests/js/fixtures/autofixCodebaseChangeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function AutofixCodebaseChangeData(
return {
description: '',
diff: [AutofixDiffFilePatch()],
repo_id: 100,
repo_external_id: "100",
repo_name: 'owner/hello-world',
title: 'Add error handling',
pull_request: { pr_number: 200, pr_url: 'https://github.com/owner/hello-world/pull/200' },
Expand Down

0 comments on commit 280a003

Please sign in to comment.