Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: tidy test fixtures and design doc wording (#21656)
rebelice75bb2b39e010
diff --git a/backend/component/review/workflow_test.go b/backend/component/review/workflow_test.goindex 053191898b..6679ae1a75 100644--- a/backend/component/review/workflow_test.go+++ b/backend/component/review/workflow_test.go@@ -1504,7 +1504,7 @@ func TestNonHumanPrincipalApprovesTheStepItsRoleHolds(t *testing.T) {},{name: "project service account bound in the project policy",- actor: &store.UserMessage{Email: "[email protected]", Type: storepb.PrincipalType_SERVICE_ACCOUNT},+ actor: &store.UserMessage{Email: "[email protected]", Type: storepb.PrincipalType_SERVICE_ACCOUNT},inProject: true,},{diff --git a/backend/plugin/parser/plsql/byt10010_e2e_test.go b/backend/plugin/parser/plsql/byt10010_e2e_test.goindex 0c869e581b..d138387fc5 100644--- a/backend/plugin/parser/plsql/byt10010_e2e_test.go+++ b/backend/plugin/parser/plsql/byt10010_e2e_test.go@@ -7,28 +7,28 @@ import ("github.com/bytebase/bytebase/backend/plugin/parser/base")-// TestDiagnoseBYT10010CustomerStatement verifies the MBBank statement from-// BYT-10010 passes SQL Review diagnosis end to end after the omni-// constraint_state fix.-func TestDiagnoseBYT10010CustomerStatement(t *testing.T) {- stmt := `CREATE TABLE DATA.RC_FT_ADJ_CONFIG+// TestDiagnoseBYT10010UsingIndexLocal verifies that an interval-partitioned+// table whose primary key uses USING INDEX LOCAL (BYT-10010) passes SQL Review+// diagnosis end to end after the omni constraint_state fix.+func TestDiagnoseBYT10010UsingIndexLocal(t *testing.T) {+ stmt := `CREATE TABLE APP.ORDER_EVENT(- RC_FT_ADJ_CODE VARCHAR2(250) NOT NULL,- RC_CODE VARCHAR2(150),- DATE_REPORT DATE,- IS_CHECK VARCHAR2(255),- IS_ACTION VARCHAR2(255),+ EVENT_CODE VARCHAR2(250) NOT NULL,+ ORDER_CODE VARCHAR2(150),+ EVENT_DATE DATE,+ IS_VERIFIED VARCHAR2(255),+ IS_ARCHIVED VARCHAR2(255),CREATE_DATE DATE DEFAULT SYSDATE NOT NULL,- CREATE_USER VARCHAR2(50) DEFAULT 'ETL_USER',+ CREATE_USER VARCHAR2(50) DEFAULT 'APP_USER',UPDATE_DATE DATE DEFAULT SYSDATE,- UPDATE_USER VARCHAR2(50) DEFAULT 'ETL_USER',+ UPDATE_USER VARCHAR2(50) DEFAULT 'APP_USER',TYPE VARCHAR2(50),- RC_FT_ADJ_STATUS VARCHAR2(255),- PARENT_RC_FT_ADJ_CODE VARCHAR2(250),- E_STATUS NUMBER,+ EVENT_STATUS VARCHAR2(255),+ PARENT_EVENT_CODE VARCHAR2(250),+ RETRY_COUNT NUMBER,- CONSTRAINT PK_RC_FT_ADJ_CONFIG- PRIMARY KEY (RC_FT_ADJ_CODE, CREATE_DATE) USING INDEX LOCAL+ CONSTRAINT PK_ORDER_EVENT+ PRIMARY KEY (EVENT_CODE, CREATE_DATE) USING INDEX LOCAL)PARTITION BY RANGE (CREATE_DATE)INTERVAL (NUMTOYMINTERVAL(1, 'MONTH'))diff --git a/docs/design/approval-step-non-human-approvers.md b/docs/design/approval-step-non-human-approvers.mdindex 1c08914816..6ceb84f65e 100644--- a/docs/design/approval-step-non-human-approvers.md+++ b/docs/design/approval-step-non-human-approvers.md@@ -5,16 +5,16 @@ Status: implemented in this PR · 2026-10-12A custom approval step whose role is held only by service accounts shows "No reviewers" on theplan page, and the code comment beside that string says the step can never be approved. Both arewrong: the backend already lets a service account or workload identity approve any step whose role-it holds, and QVC's ServiceNow integration does exactly that. The review UI applies a display+it holds, and a customer's ServiceNow integration does exactly that. The review UI applies a displayfilter the authorization model does not have. **A principal that holds a step's role is anapprover whatever its type: the review surfaces list it, name it, and attribute its decision thesame way they do for a person. Notifications stay human-only.**## Problem-QVC (2026-10-08) ends every change's approval flow with a custom role "ServiceNow Approver" held-by two service accounts: a workspace account `bytebase-integration-service` bound at workspace and-project level, and a project account `testdt` bound at project level. The plan page shows the step+A customer (2026-10-08) ends every change's approval flow with a custom role "ServiceNow Approver" held+by two service accounts: a workspace account `integration` bound at workspace and+project level, and a project account `approver` bound at project level. The plan page shows the stepas "No reviewers", so the customer asked whether the flow is supported at all.Reproduced on a throwaway 3.24-dev instance with the same shape (Developer → Workspace DBA →@@ -26,14 +26,14 @@ body:| Reviewer line under a pending or current step | "No reviewers" | `ReviewApprovalFlow.tsx` `NodeReviewers`; comment claims the step "can never be approved" (BYT-9711) || Folded-pending popover row | avatars omitted silently | `PendingPopoverRow`, `candidates.length > 0` guard || Header "Review in progress" popover | "No reviewers" | `PlanStatusAction.tsx` → `ReviewApprovalFlow compact` |-| "Approved by …" after the SA approves via API | `Approved by bytebase-integration-service` (email local part, no title, no account-type mark) | `FlowNode` subtitle, `ApprovedPopoverRow`, `ChipAvatars`: `getUserByIdentifier` misses, `unknownUser(principal)` fills in |-| Activity row for the approval comment | `bytebase-integration-service approved issue` | `IssueCommentActivity.tsx` `IssueCommentHeader`, same fallback |-| Collapsed REVIEW summary | `Last approved by bytebase-integration-service` | `phaseSummary.ts`: local part for every principal, humans included |+| "Approved by …" after the SA approves via API | `Approved by integration` (email local part, no title, no account-type mark) | `FlowNode` subtitle, `ApprovedPopoverRow`, `ChipAvatars`: `getUserByIdentifier` misses, `unknownUser(principal)` fills in |+| Activity row for the approval comment | `integration approved issue` | `IssueCommentActivity.tsx` `IssueCommentHeader`, same fallback |+| Collapsed REVIEW summary | `Last approved by integration` | `phaseSummary.ts`: local part for every principal, humans included || Legacy issue page (grant issues) | approver hidden: "Approved by" followed by nothing; candidates filtered to humans | `IssueDetailApprovalFlow.tsx` `ApprovalUserText` returns null for non-`USER`; `useApprovalStep` filters `AccountType.USER` |The authorization side is consistent and needs no change. `canReview` in`backend/component/review/workflow.go` resolves roles through `GetUserFormattedRolesMap`, which-matches `serviceAccounts/{email}` and `workloadIdentities/{email}` members directly. The three QVC+matches `serviceAccounts/{email}` and `workloadIdentities/{email}` members directly. The customer's threebinding shapes all pass. The approval is recorded as `users/<sa-email>`(`common.FormatUserEmail(actor.Email)`), the approval comment's creator is the SA email, thewebhook actor is the SA's `UserMessage`, and the audit log names the actor@@ -126,7 +126,7 @@ string. Nothing needs the type in the string, because the email suffix already ccodebase has two conventions and this field belongs to the first: attribution fields(`issue.creator`, `plan.creator`, `plan.last_plan_editor`, comment creators) are `users/<email>`for every actor, while policy members and the audit-log actor carry the typed prefix. A new format-would need a backfill for every SA approval already stored (QVC's included) and dual-format+would need a backfill for every SA approval already stored (the customer's included) and dual-formatreaders forever, for no information gain.**D6 · Notifications are unchanged.** `getApproversForRole` keeps `END_USER` only anddiff --git a/frontend/src/routes/project/useApprovalCandidates.test.tsx b/frontend/src/routes/project/useApprovalCandidates.test.tsxindex 7ebf959382..4028cb68f8 100644--- a/frontend/src/routes/project/useApprovalCandidates.test.tsx+++ b/frontend/src/routes/project/useApprovalCandidates.test.tsx@@ -16,10 +16,10 @@ import {import { useApprovalCandidates } from "./useApprovalCandidates";const ROLE = "roles/servicenow-approver";-const PROJECT = "projects/orders";+const PROJECT = "projects/project-a";const WORKSPACE_SA = "[email protected]";-const PROJECT_SA = "[email protected]";-const WORKLOAD_IDENTITY = "[email protected]";+const PROJECT_SA = "[email protected]";+const WORKLOAD_IDENTITY = "[email protected]";type Account = { name: string; email: string; title: string; state: State };@@ -71,7 +71,7 @@ const issue = (creator = "users/[email protected]") =>const candidatesOf = async (issueArg = issue(), role = ROLE) => {const { result } = renderHook(() =>- useApprovalCandidates(issueArg, "orders", role, "")+ useApprovalCandidates(issueArg, "project-a", role, ""));return result;};@@ -124,7 +124,7 @@ describe("useApprovalCandidates", () => {);serviceAccounts[`serviceAccounts/${PROJECT_SA}`] = account(PROJECT_SA,- "testdt"+ "Team approver");workloadIdentities[`workloadIdentities/${WORKLOAD_IDENTITY}`] = account(WORKLOAD_IDENTITY,@@ -139,7 +139,7 @@ describe("useApprovalCandidates", () => {).toEqual([["Deploy pipeline", WORKLOAD_IDENTITY],["ServiceNow integration", WORKSPACE_SA],- ["testdt", PROJECT_SA],+ ["Team approver", PROJECT_SA],]);expect(store.batchGetOrFetchUsers).not.toHaveBeenCalledWith(expect.arrayContaining([expect.stringContaining("service.bytebase.com")])@@ -186,7 +186,7 @@ describe("useApprovalCandidates", () => {]);serviceAccounts[`serviceAccounts/${PROJECT_SA}`] = account(PROJECT_SA,- "testdt",+ "Team approver",State.DELETED);diff --git a/frontend/src/types/v1/user.test.ts b/frontend/src/types/v1/user.test.tsindex 3cfc5361c6..469da4c678 100644--- a/frontend/src/types/v1/user.test.ts+++ b/frontend/src/types/v1/user.test.ts@@ -7,9 +7,9 @@ import { AccountType, getAccountTypeByEmail } from "./user";describe("getAccountTypeByEmail", () => {test.each([["[email protected]", AccountType.SERVICE_ACCOUNT],- ["[email protected]", AccountType.SERVICE_ACCOUNT],+ ["[email protected]", AccountType.SERVICE_ACCOUNT],["[email protected]", AccountType.WORKLOAD_IDENTITY],- ["[email protected]", AccountType.WORKLOAD_IDENTITY],+ ["[email protected]", AccountType.WORKLOAD_IDENTITY],["[email protected]", AccountType.USER],["[email protected]", AccountType.USER],["[email protected]", AccountType.USER],diff --git a/frontend/tests/e2e/masking-exemption/masking-exemption.spec.ts b/frontend/tests/e2e/masking-exemption/masking-exemption.spec.tsindex c575990e2a..9ce08766d4 100644--- a/frontend/tests/e2e/masking-exemption/masking-exemption.spec.ts+++ b/frontend/tests/e2e/masking-exemption/masking-exemption.spec.ts@@ -581,7 +581,7 @@ test.describe("E2E Masking Verification", () => {// with stock cel-go (masking_evaluator.go:237) — the OR-group MUST be wrapped:// request.time < T && ((res1) || (res2))// If it isn't, the time bound attaches only to the LAST branch and every earlier-// resource is served unmasked forever (the GovTech incident). #20683 fixed the+// resource is served unmasked forever. #20683 fixed the// create-page builder and #20687 shared it with GrantAccessDialog (BYT-9791).//// These verify the contract end-to-end through the real masking evaluator and SQL