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: retire activity (#12006)
boojack1620072c7db7
diff --git a/frontend/src/components/ActivityTable/ActivityCommentLink.vue b/frontend/src/components/ActivityTable/ActivityCommentLink.vuedeleted file mode 100644index 9e087a381e..0000000000--- a/frontend/src/components/ActivityTable/ActivityCommentLink.vue+++ /dev/null@@ -1,53 +0,0 @@-<template>- <template v-if="link">- <a- v-if="link.external"- :href="link.path"- target="_blank"- class="normal-link flex flex-row items-center"- >- <span>{{ link.title }}</span>- <heroicons-outline:external-link class="w-4 h-4" />- </a>- <router-link v-else class="normal-link" :to="link.path">- {{ link.title }}- </router-link>- </template>-</template>--<script lang="ts" setup>-import type { PropType } from "vue";-import { computed } from "vue";-import type { LogEntity } from "@/types/proto/v1/logging_service";-import { LogEntity_Action } from "@/types/proto/v1/logging_service";-import type { ActivityProjectRepositoryPushPayload } from "../../types";-import { issueSlug } from "../../utils/slug";-import type { Link } from "./types";--const props = defineProps({- activity: {- type: Object as PropType<LogEntity>,- required: true,- },-});--const link = computed((): Link | undefined => {- const { activity } = props;- switch (activity.action) {- case LogEntity_Action.ACTION_PROJECT_REPOSITORY_PUSH: {- const payload = JSON.parse(- activity.payload- ) as ActivityProjectRepositoryPushPayload;- if (payload.issueId && payload.issueName) {- return {- title: `${activity.resource}/issues/${payload.issueId}`,- path: `/${activity.resource}/issues/${issueSlug(payload.issueName!, payload.issueId!)}`,- external: false,- };- }- break;- }- }- return undefined;-});-</script>diff --git a/frontend/src/components/ActivityTable/ActivityTable.vue b/frontend/src/components/ActivityTable/ActivityTable.vuedeleted file mode 100644index d6b1395b91..0000000000--- a/frontend/src/components/ActivityTable/ActivityTable.vue+++ /dev/null@@ -1,93 +0,0 @@-<template>- <BBTable- :column-list="columnList"- :data-source="activityList"- :show-header="true"- :row-clickable="false"- :left-bordered="true"- :right-bordered="true"- >- <template #body="{ rowData: activity }">- <BBTableCell :left-padding="4" class="w-[20%]">- <div class="flex flew-row space-x-1">- <span- v-if="activity.level != LogEntity_Level.LEVEL_INFO"- class="w-5 h-5 flex items-center justify-center rounded-full select-none"- >- <template v-if="activity.level === LogEntity_Level.LEVEL_WARNING">- <heroicons-outline:information-circle class="text-warning" />- </template>- <template- v-else-if="activity.level === LogEntity_Level.LEVEL_ERROR"- >- <heroicons-outline:exclamation-circle class="text-error" />- </template>- </span>- <span class="capitalize">{{ activityName(activity.action) }}</span>- <ActivityTypeLink :activity="activity" />- </div>- </BBTableCell>- <BBTableCell>- <div class="flex flex-row space-x-1">- <span>{{ activity.comment }}</span>- <ActivityCommentLink :activity="activity" />- </div>- </BBTableCell>- <BBTableCell class="w-[12%]">- {{ humanizeTs((activity.createTime?.getTime() ?? 0) / 1000) }}- </BBTableCell>- <BBTableCell class="w-[12%]">- <div class="flex flex-row items-center">- <BBAvatar- :size="'SMALL'"- :username="getUser(activity)?.title"- :email="getUser(activity)?.email"- />- <span class="ml-2">{{ getUser(activity)?.title }}</span>- </div>- </BBTableCell>- </template>- </BBTable>-</template>--<script lang="ts" setup>-import type { PropType } from "vue";-import { computed } from "vue";-import { useI18n } from "vue-i18n";-import { useUserStore } from "@/store";-import { activityName } from "@/types";-import type { LogEntity } from "@/types/proto/v1/logging_service";-import { LogEntity_Level } from "@/types/proto/v1/logging_service";-import { extractUserResourceName } from "@/utils";-import type { BBTableColumn } from "../../bbkit/types";--defineProps({- activityList: {- type: Object as PropType<LogEntity[]>,- required: true,- },-});--const { t } = useI18n();--const columnList = computed((): BBTableColumn[] => [- {- title: t("activity.name"),- },- {- title: t("activity.comment"),- },- {- title: t("activity.created"),- },- {- title: t("activity.invoker"),- },-]);--const getUser = (activity: LogEntity) => {- return useUserStore().getUserByEmail(- extractUserResourceName(activity.creator)- );-};-</script>diff --git a/frontend/src/components/ActivityTable/ActivityTypeLink.vue b/frontend/src/components/ActivityTable/ActivityTypeLink.vuedeleted file mode 100644index e8390210ce..0000000000--- a/frontend/src/components/ActivityTable/ActivityTypeLink.vue+++ /dev/null@@ -1,32 +0,0 @@-<template>- <template v-if="link">- <a- v-if="link.external"- :href="link.path"- target="_blank"- class="normal-link flex flex-row items-center"- >- <span>{{ link.title }}</span>- <heroicons-outline:external-link class="w-4 h-4" />- </a>- <router-link v-else class="normal-link" :to="link.path">- {{ link.title }}- </router-link>- </template>-</template>--<script lang="ts" setup>-import type { PropType } from "vue";-import { computed } from "vue";-import type { LogEntity } from "@/types/proto/v1/logging_service";-import { getLinkFromActivity } from "./utils";--const props = defineProps({- activity: {- type: Object as PropType<LogEntity>,- required: true,- },-});--const link = computed(() => getLinkFromActivity(props.activity));-</script>diff --git a/frontend/src/components/ActivityTable/types.ts b/frontend/src/components/ActivityTable/types.tsdeleted file mode 100644index 4e087debbf..0000000000--- a/frontend/src/components/ActivityTable/types.ts+++ /dev/null@@ -1,5 +0,0 @@-export type Link = {- title: string;- path: string;- external: boolean;-};diff --git a/frontend/src/components/ActivityTable/utils.ts b/frontend/src/components/ActivityTable/utils.tsdeleted file mode 100644index 22c989ebc4..0000000000--- a/frontend/src/components/ActivityTable/utils.ts+++ /dev/null@@ -1,49 +0,0 @@-import { getIssueId } from "@/store/modules/v1/common";-import type {- ActivityIssueCreatePayload,- ActivityProjectDatabaseTransferPayload,-} from "@/types";-import { UNKNOWN_ID, EMPTY_ID } from "@/types";-import type { LogEntity } from "@/types/proto/v1/logging_service";-import { LogEntity_Action } from "@/types/proto/v1/logging_service";-import type { Link } from "./types";--export const getLinkFromActivity = (activity: LogEntity): Link | undefined => {- switch (activity.action) {- case LogEntity_Action.ACTION_PROJECT_REPOSITORY_PUSH: {- // TODO(d): use the link.- return undefined;- }- case LogEntity_Action.ACTION_PROJECT_DATABASE_TRANSFER: {- const payload = JSON.parse(- activity.payload- ) as ActivityProjectDatabaseTransferPayload;- return {- title: payload.databaseName,- path: `/db/${payload.databaseId}`,- external: false,- };- }- case LogEntity_Action.ACTION_PIPELINE_TASK_STATUS_UPDATE:- case LogEntity_Action.ACTION_PIPELINE_STAGE_STATUS_UPDATE:- case LogEntity_Action.ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE:- case LogEntity_Action.ACTION_PIPELINE_TASK_PRIOR_BACKUP:- case LogEntity_Action.ACTION_ISSUE_STATUS_UPDATE:- case LogEntity_Action.ACTION_ISSUE_CREATE: {- const payload = JSON.parse(- activity.payload- ) as ActivityIssueCreatePayload;-- const issueId = getIssueId(activity.resource);- if (issueId === UNKNOWN_ID || issueId === EMPTY_ID) {- return undefined;- }- return {- title: payload.issueName,- path: `/${activity.resource}/issues/${issueId}`,- external: false,- };- }- }- return undefined;-};diff --git a/frontend/src/components/IssueV1/components/Sidebar/PreBackupSection/common.ts b/frontend/src/components/IssueV1/components/Sidebar/PreBackupSection/common.tsindex 50a730a539..440725fdec 100644--- a/frontend/src/components/IssueV1/components/Sidebar/PreBackupSection/common.ts+++ b/frontend/src/components/IssueV1/components/Sidebar/PreBackupSection/common.ts@@ -139,9 +139,6 @@ export const usePreBackupContext = () => {await useIssueCommentStore().createIssueComment({issueName: issue.value.name,comment: `${action} prior backup for task [${issue.value.title}].`,- payload: {- issueName: issue.value.title,- },});} catch {// fail to comment won't be too baddiff --git a/frontend/src/components/IssueV1/components/Sidebar/RollbackSection/common.ts b/frontend/src/components/IssueV1/components/Sidebar/RollbackSection/common.tsindex 9a4702be5d..72cc2f6dda 100644--- a/frontend/src/components/IssueV1/components/Sidebar/RollbackSection/common.ts+++ b/frontend/src/components/IssueV1/components/Sidebar/RollbackSection/common.ts@@ -176,9 +176,6 @@ export const useRollbackContext = () => {await useIssueCommentStore().createIssueComment({issueName: issue.value.name,comment: `${action} SQL rollback log for task [${issue.value.title}].`,- payload: {- issueName: issue.value.title,- },});} catch {// fail to comment won't be too baddiff --git a/frontend/src/store/modules/v1/issueComment.ts b/frontend/src/store/modules/v1/issueComment.tsindex ea2e85c2bd..f8068afc53 100644--- a/frontend/src/store/modules/v1/issueComment.ts+++ b/frontend/src/store/modules/v1/issueComment.ts@@ -1,7 +1,6 @@import { defineStore } from "pinia";import { reactive } from "vue";import { issueServiceClient } from "@/grpcweb";-import type { ActivityIssueCommentCreatePayload } from "@/types";import type {IssueComment,ListIssueCommentsRequest,@@ -61,17 +60,14 @@ export const useIssueCommentStore = defineStore("issue_comment", () => {const createIssueComment = async ({issueName,comment,- payload,}: {issueName: string;comment: string;- payload?: ActivityIssueCommentCreatePayload;}) => {const issueComment = await issueServiceClient.createIssueComment({parent: issueName,issueComment: {comment,- payload: JSON.stringify(payload ?? {}),},});issueCommentMap.set(issueName, [diff --git a/frontend/src/types/activity.ts b/frontend/src/types/activity.tsdeleted file mode 100644index 77fda6be0c..0000000000--- a/frontend/src/types/activity.ts+++ /dev/null@@ -1,203 +0,0 @@-import type { LogEntity_Level } from "@/types/proto/v1/logging_service";-import { LogEntity_Action } from "@/types/proto/v1/logging_service";-import type { FieldId } from "../plugins";-import { t } from "../plugins/i18n";-import type { ExternalApprovalEvent } from "./externalApproval";-import type { IssueId, PrincipalId, SheetId, StageId, TaskId } from "./id";-import type { IssueStatus } from "./issue";-import type { MemberStatus, RoleType } from "./member";-import type {- StageStatusUpdateType,- TaskRunStatus,- TaskStatus,-} from "./pipeline";-import type { ApprovalEvent } from "./review";--export function activityName(action: LogEntity_Action): string {- switch (action) {- case LogEntity_Action.ACTION_ISSUE_CREATE:- return t("activity.type.issue-create");- case LogEntity_Action.ACTION_ISSUE_COMMENT_CREATE:- return t("activity.type.comment-create");- case LogEntity_Action.ACTION_ISSUE_FIELD_UPDATE:- return t("activity.type.issue-field-update");- case LogEntity_Action.ACTION_ISSUE_STATUS_UPDATE:- return t("activity.type.issue-status-update");- case LogEntity_Action.ACTION_PIPELINE_STAGE_STATUS_UPDATE:- return t("activity.type.pipeline-stage-status-update");- case LogEntity_Action.ACTION_PIPELINE_TASK_STATUS_UPDATE:- return t("activity.type.pipeline-task-status-update");- case LogEntity_Action.ACTION_PIPELINE_TASK_RUN_STATUS_UPDATE:- return t("activity.type.pipeline-task-status-update");- case LogEntity_Action.ACTION_PIPELINE_TASK_PRIOR_BACKUP:- return t("activity.type.pipeline-task-prior-backup");- case LogEntity_Action.ACTION_PIPELINE_TASK_STATEMENT_UPDATE:- return t("activity.type.pipeline-task-statement-update");- case LogEntity_Action.ACTION_PIPELINE_TASK_EARLIEST_ALLOWED_TIME_UPDATE:- return t("activity.type.pipeline-task-earliest-allowed-time-update");- case LogEntity_Action.ACTION_MEMBER_CREATE:- return t("activity.type.member-create");- case LogEntity_Action.ACTION_MEMBER_ROLE_UPDATE:- return t("activity.type.member-role-update");- case LogEntity_Action.ACTION_MEMBER_ACTIVATE:- return t("activity.type.member-activate");- case LogEntity_Action.ACTION_MEMBER_DEACTIVE:- return t("activity.type.member-deactivate");- case LogEntity_Action.ACTION_PROJECT_REPOSITORY_PUSH:- return t("activity.type.project-repository-push");- case LogEntity_Action.ACTION_PROJECT_DATABASE_TRANSFER:- return t("activity.type.project-database-transfer");- case LogEntity_Action.ACTION_PROJECT_MEMBER_CREATE:- return t("activity.type.project-member-create");- case LogEntity_Action.ACTION_PROJECT_MEMBER_DELETE:- return t("activity.type.project-member-delete");- }- console.assert(false, `undefined text for activity type "${action}"`);- return "";-}--export type ActivityLevel = "INFO" | "WARN" | "ERROR";--export type ActivityIssueCreatePayload = {- issueName: string;-};--// TaskRollbackBy records an issue rollback activity.-// The task with taskID in IssueID is rollbacked by the task with RollbackByTaskID in RollbackByIssueID.-export type TaskRollbackBy = {- issueId: IssueId;- taskId: TaskId;- rollbackByIssueId: IssueId;- rollbackByTaskId: TaskId;-};--export type ActivityIssueCommentCreatePayload = {- externalApprovalEvent?: ExternalApprovalEvent;- issueName: string;- taskRollbackBy?: TaskRollbackBy;- approvalEvent?: ApprovalEvent;-};--export type ActivityIssueFieldUpdatePayload = {- fieldId: FieldId;- oldValue?: string;- newValue?: string;- issueName: string;-};--export type ActivityIssueStatusUpdatePayload = {- oldStatus: IssueStatus;- newStatus: IssueStatus;- issueName: string;-};--export type ActivityStageStatusUpdatePayload = {- stageId: StageId;- stageStatusUpdateType: StageStatusUpdateType;- issueName: string;- stageName: string;-};--export type ActivityTaskStatusUpdatePayload = {- taskId: TaskId;- oldStatus: TaskStatus;- newStatus: TaskStatus;- issueName: string;- taskName: string;-};--export type ActivityPipelineTaskRunStatusUpdatePayload = {- taskId: TaskId;- newStatus: TaskRunStatus;- issueName: string;- taskName: string;-};--export type ActivityTaskStatementUpdatePayload = {- taskId: TaskId;- oldStatement: string;- newStatement: string;- oldSheetId: SheetId;- newSheetId: SheetId;- issueName: string;- taskName: string;-};--export type ActivityTaskPriorBackup = {- taskId: TaskId;- schemaMetadata: DatabaseSchemaMetadata[];- issueName: string;- taskName: string;-};--export type DatabaseSchemaMetadata = {- schema: string;- table: string;-};--export type ActivityTaskEarliestAllowedTimeUpdatePayload = {- taskId: TaskId;- oldEarliestAllowedTs: number;- newEarliestAllowedTs: number;- issueName: string;- taskName: string;-};--export type ActivityMemberCreatePayload = {- principalId: PrincipalId;- principalName: string;- principalEmail: string;- memberStatus: MemberStatus;- role: RoleType;-};--export type ActivityMemberRoleUpdatePayload = {- principalId: PrincipalId;- principalName: string;- principalEmail: string;- oldRole: RoleType;- newRole: RoleType;-};--export type ActivityMemberActivateDeactivatePayload = {- principalId: PrincipalId;- principalName: string;- principalEmail: string;- role: RoleType;-};--export type ActivityProjectRepositoryPushPayload = {- issueId?: number;- issueName?: string;-};--export type ActivityProjectDatabaseTransferPayload = {- databaseId: number;- databaseName: string;-};--export type ActionPayloadType =- | ActivityIssueCreatePayload- | ActivityIssueCommentCreatePayload- | ActivityIssueFieldUpdatePayload- | ActivityIssueStatusUpdatePayload- | ActivityTaskStatusUpdatePayload- | ActivityTaskStatementUpdatePayload- | ActivityTaskEarliestAllowedTimeUpdatePayload- | ActivityMemberCreatePayload- | ActivityMemberRoleUpdatePayload- | ActivityMemberActivateDeactivatePayload- | ActivityProjectRepositoryPushPayload- | ActivityProjectDatabaseTransferPayload;--export interface FindActivityMessage {- resource?: string;- creatorEmail?: string;- level?: LogEntity_Level[];- action?: LogEntity_Action[];- createdTsAfter?: number;- createdTsBefore?: number;- order?: "asc" | "desc";- pageSize?: number;- pageToken?: string;-}diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.tsindex 6c1f29d59a..b1c2459b72 100644--- a/frontend/src/types/index.ts+++ b/frontend/src/types/index.ts@@ -1,4 +1,3 @@-export * from "./activity";export * from "./actuator";export * from "./anomaly";export * from "./auditLog";diff --git a/frontend/src/utils/activity.ts b/frontend/src/utils/activity.tsdeleted file mode 100644index 57d55b60b8..0000000000--- a/frontend/src/utils/activity.ts+++ /dev/null@@ -1,105 +0,0 @@-import { t } from "@/plugins/i18n";-import { useUserStore } from "@/store";-import type { LogEntity } from "@/types/proto/v1/logging_service";-import { LogEntity_Action } from "@/types/proto/v1/logging_service";-import { IssueBuiltinFieldId } from "../plugins";-import type {- ActivityIssueFieldUpdatePayload,- ActivityIssueStatusUpdatePayload,-} from "../types";-import { unknownUser } from "../types";--export function issueActivityActionSentence(- activity: LogEntity-): [string, Record<string, any>] {- switch (activity.action) {- case LogEntity_Action.ACTION_ISSUE_CREATE:- return ["activity.sentence.created-issue", {}];- case LogEntity_Action.ACTION_ISSUE_COMMENT_CREATE:- return ["activity.sentence.commented", {}];- case LogEntity_Action.ACTION_ISSUE_FIELD_UPDATE: {- const userStore = useUserStore();- const update = JSON.parse(- activity.payload- ) as ActivityIssueFieldUpdatePayload;-- switch (update.fieldId) {- case IssueBuiltinFieldId.NAME: {- const oldName = update.oldValue ?? "";- const newName = update.newValue ?? "";- return [- "activity.sentence.changed-from-to",- {- name: t("issue.issue-name").toLowerCase(),- oldValue: oldName,- newValue: newName,- },- ];- }- case IssueBuiltinFieldId.ASSIGNEE: {- if (update.oldValue && update.newValue) {- const oldName = (- userStore.getUserById(String(update.oldValue)) ?? unknownUser()- ).title;- const newName = (- userStore.getUserById(String(update.newValue)) ?? unknownUser()- ).title;- return [- "activity.sentence.reassigned-issue",- {- oldName,- newName,- },- ];- } else if (!update.oldValue && update.newValue) {- const newName = (- userStore.getUserById(String(update.newValue)) ?? unknownUser()- ).title;- return [- "activity.sentence.assigned-issue",- {- newName,- },- ];- } else if (update.oldValue && !update.newValue) {- const oldName = (- userStore.getUserById(String(update.oldValue)) ?? unknownUser()- ).title;- return [- "activity.sentence.unassigned-issue",- {- oldName,- },- ];- } else {- return ["activity.sentence.invalid-assignee-update", {}];- }- }- // We don't display subscriber change for now- case IssueBuiltinFieldId.SUBSCRIBER_LIST:- break;- case IssueBuiltinFieldId.DESCRIPTION:- // Description could be very long, so we don't display it.- return ["activity.sentence.changed-description", {}];- case IssueBuiltinFieldId.PROJECT:- case IssueBuiltinFieldId.SQL:- }-- return ["activity.sentence.updated", {}];- }- case LogEntity_Action.ACTION_ISSUE_STATUS_UPDATE: {- const update = JSON.parse(- activity.payload- ) as ActivityIssueStatusUpdatePayload;- switch (update.newStatus) {- case "OPEN":- return ["activity.sentence.reopened-issue", {}];- case "DONE":- return ["activity.sentence.resolved-issue", {}];- case "CANCELED":- return ["activity.sentence.canceled-issue", {}];- }- }- }- return ["activity.sentence.empty", {}];-}diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.tsindex 7f5bafc22f..02a75ffc40 100644--- a/frontend/src/utils/index.ts+++ b/frontend/src/utils/index.ts@@ -1,7 +1,6 @@export * from "./css";export * from "./clipboard";export * from "./collections";-export * from "./activity";export * from "./database";export * from "./environment";export * from "./instance";