Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix(activity): show actor for bypass deployment (#20898)
boojack6eff2f45e8c2
diff --git a/frontend/src/react/components/issue-activity/IssueCommentActivity.test.tsx b/frontend/src/react/components/issue-activity/IssueCommentActivity.test.tsxnew file mode 100644index 0000000000..a2e0d3ac2d--- /dev/null+++ b/frontend/src/react/components/issue-activity/IssueCommentActivity.test.tsx@@ -0,0 +1,64 @@+import { create } from "@bufbuild/protobuf";+import { render, screen } from "@testing-library/react";+import { describe, expect, test, vi } from "vitest";+import {+ Issue_Type,+ IssueCommentSchema,+ IssueSchema,+ IssueStatus,+} from "@/types/proto-es/v1/issue_service_pb";+import { PlanSchema } from "@/types/proto-es/v1/plan_service_pb";+import { IssueCommentRow } from "./IssueCommentActivity";++vi.mock("react-i18next", async (importOriginal) => ({+ ...(await importOriginal<typeof import("react-i18next")>()),+ useTranslation: () => ({ t: (key: string) => key }),+}));++vi.mock("@/react/stores/app", () => ({+ useAppStore: (selector: (state: unknown) => unknown) =>+ selector({+ getUserByIdentifier: () => ({+ email: "[email protected]",+ title: "Alice",+ }),+ }),+}));++vi.mock("@/react/components/monaco", () => ({+ ReadonlyDiffMonaco: () => null,+}));++describe("IssueCommentRow", () => {+ test("shows who bypassed review and created the rollout", () => {+ const issue = create(IssueSchema, {+ type: Issue_Type.DATABASE_CHANGE,+ });+ const plan = create(PlanSchema, { hasRollout: true });+ const comment = create(IssueCommentSchema, {+ creator: "users/[email protected]",+ event: {+ case: "issueUpdate",+ value: {+ fromStatus: IssueStatus.OPEN,+ toStatus: IssueStatus.DONE,+ },+ },+ });++ render(+ <IssueCommentRow+ comment={comment}+ isLast+ issue={issue}+ linkless+ plan={plan}+ />+ );++ expect(screen.getByText("Alice")).toBeInTheDocument();+ expect(+ screen.getByText("activity.sentence.review-skipped-rollout-created")+ ).toBeInTheDocument();+ });+});diff --git a/frontend/src/react/components/issue-activity/IssueCommentActivity.tsx b/frontend/src/react/components/issue-activity/IssueCommentActivity.tsxindex 2ba161628f..5f7bf283e6 100644--- a/frontend/src/react/components/issue-activity/IssueCommentActivity.tsx+++ b/frontend/src/react/components/issue-activity/IssueCommentActivity.tsx@@ -180,9 +180,8 @@ export function CommentCreator({ creator }: { creator: User }) {);}-// Header line for a comment-backed activity item: creator (suppressed for the-// done-rollout system comment, whose sentence already names the actor), action-// sentence, timestamp, and an "(edited)" marker for edited user comments.+// Header line for a comment-backed activity item: creator, action sentence,+// timestamp, and an "(edited)" marker for edited user comments.function IssueCommentHeader({comment,issue,@@ -203,9 +202,7 @@ function IssueCommentHeader({return (<>- {!isDoneRolloutComment(issue, plan, comment) && (- <CommentCreator creator={creator} />- )}+ <CommentCreator creator={creator} /><IssueCommentActionSentencecomment={comment}issue={issue}