Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: ci sampling proto (#15930)

Danny Xu87e4cd1b3a73
diff --git a/backend/api/v1/project_service.go b/backend/api/v1/project_service.go
index 9ccfc215ff..98cb43bee3 100644
--- a/backend/api/v1/project_service.go
+++ b/backend/api/v1/project_service.go
@@ -339,6 +339,7 @@ func (s *ProjectService) UpdateProject(ctx context.Context, request *v1pb.Update
"auto_enable_backup",
"skip_backup_errors",
"postgres_database_tenant_mode",
+ "ci_sampling_size",
}
for _, path := range request.UpdateMask.Paths {
if slices.Contains(issueProjectSettingFeatureRelatedPaths, path) {
@@ -415,6 +416,10 @@ func (s *ProjectService) UpdateProject(ctx context.Context, request *v1pb.Update
projectSettings := project.Setting
projectSettings.ExecutionRetryPolicy = convertToStoreExecutionRetryPolicy(request.Project.ExecutionRetryPolicy)
patch.Setting = projectSettings
+ case "ci_sampling_size":
+ projectSettings := project.Setting
+ projectSettings.CiSamplingSize = request.Project.CiSamplingSize
+ patch.Setting = projectSettings
default:
return nil, status.Errorf(codes.InvalidArgument, `unsupport update_mask "%s"`, path)
}
@@ -1329,6 +1334,7 @@ func convertToProject(projectMessage *store.ProjectMessage) *v1pb.Project {
PostgresDatabaseTenantMode: projectMessage.Setting.PostgresDatabaseTenantMode,
AllowSelfApproval: projectMessage.Setting.AllowSelfApproval,
ExecutionRetryPolicy: convertToV1ExecutionRetryPolicy(projectMessage.Setting.ExecutionRetryPolicy),
+ CiSamplingSize: projectMessage.Setting.CiSamplingSize,
}
}
@@ -1363,6 +1369,7 @@ func convertToProjectMessage(resourceID string, project *v1pb.Project) (*store.P
SkipBackupErrors: project.SkipBackupErrors,
PostgresDatabaseTenantMode: project.PostgresDatabaseTenantMode,
AllowSelfApproval: project.AllowSelfApproval,
+ CiSamplingSize: project.CiSamplingSize,
}
return &store.ProjectMessage{
ResourceID: resourceID,
diff --git a/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue b/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
index 2f825a6dc7..14110af5b4 100644
--- a/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
+++ b/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
@@ -185,6 +185,27 @@
</NInputNumber>
</div>
</div>
+ <div>
+ <p class="">
+ <span class="textlabel">
+ {{ $t("project.settings.issue-related.ci-sampling-size.self") }}
+ </span>
+ </p>
+ <p class="mt-1 mb-3 text-sm text-gray-400">
+ {{ $t("project.settings.issue-related.ci-sampling-size.description") }}
+ </p>
+ <div class="mt-3 w-full flex flex-row justify-start items-center gap-4">
+ <NInputNumber
+ :value="state.ciSamplingSize"
+ :disabled="!allowUpdateIssueProjectSetting || loading"
+ class="w-60"
+ :min="0"
+ :precision="0"
+ @update:value="handleCiSamplingSizeInput"
+ >
+ </NInputNumber>
+ </div>
+ </div>
</div>
</div>
</template>
@@ -217,6 +238,7 @@ interface LocalState {
skipBackupErrors: boolean;
postgresDatabaseTenantMode: boolean;
executionRetryPolicy: Project_ExecutionRetryPolicy | undefined;
+ ciSamplingSize: number;
}
const getInitialLocalState = (): LocalState => {
@@ -232,6 +254,7 @@ const getInitialLocalState = (): LocalState => {
skipBackupErrors: project.skipBackupErrors,
postgresDatabaseTenantMode: project.postgresDatabaseTenantMode,
executionRetryPolicy: project.executionRetryPolicy,
+ ciSamplingSize: project.ciSamplingSize || 0,
};
};
@@ -365,6 +388,9 @@ const updateMask = computed(() => {
if (!isEqual(state.executionRetryPolicy?.maximumRetries ?? 0, props.project.executionRetryPolicy?.maximumRetries ?? 0)) {
mask.push("execution_retry_policy");
}
+ if (!isEqual(state.ciSamplingSize, props.project.ciSamplingSize || 0)) {
+ mask.push("ci_sampling_size");
+ }
return mask;
});
@@ -376,6 +402,11 @@ const handleInput = (value: number | null) => {
});
};
+const handleCiSamplingSizeInput = (value: number | null) => {
+ if (value === null || value === undefined) return;
+ state.ciSamplingSize = value;
+};
+
defineExpose({
isDirty: valueChanged,
update: doUpdate,
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 85db81c48e..d1480159ab 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1640,6 +1640,10 @@
"max-retries": {
"self": "Maximum retries count for lock timeout",
"description": "The maximum retries count for lock timeout when running the task. The default value is 0."
+ },
+ "ci-sampling-size": {
+ "self": "CI Data Sampling Size",
+ "description": "The maximum number of databases to sample during CI data validation. When disabled (zero), full validation will be performed."
}
}
},
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 2aeb3076b5..bdc9f6a4e8 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1640,6 +1640,10 @@
"max-retries": {
"self": "Los reintentos máximos cuentan para el tiempo de espera de bloqueo",
"description": "Las reintentos máximas cuentan para el tiempo de espera de bloqueo al ejecutar la tarea. El valor predeterminado es 0."
+ },
+ "ci-sampling-size": {
+ "self": "Tamaño de muestreo de datos de CI",
+ "description": "El número máximo de bases de datos para probar durante la validación de datos de CI. \nCuando está deshabilitado (cero), se realizará la validación completa."
}
}
},
@@ -2598,4 +2602,4 @@
"last-visit": "Última visita",
"changelog-for-version": "Registro de cambios para {version}"
}
-}
\ No newline at end of file
+}
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 9c8e0a8822..fbb68bdabd 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1640,6 +1640,10 @@
"max-retries": {
"self": "ロックタイムアウトの最大レトリカウント",
"description": "タスクを実行するときのロックタイムアウトの最大再試行カウント。デフォルト値は0です。"
+ },
+ "ci-sampling-size": {
+ "self": "CIデータサンプリングサイズ",
+ "description": "CIデータ検証中にサンプリングするデータベースの最大数。\n無効(ゼロ)の場合、完全な検証が実行されます。"
}
}
},
@@ -2598,4 +2602,4 @@
"last-visit": "最終訪問",
"changelog-for-version": "{version} の変更履歴"
}
-}
\ No newline at end of file
+}
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 8db2eddb7d..a93be4bb32 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -1640,6 +1640,10 @@
"max-retries": {
"self": "Số lần thử lại tối đa cho thời gian chờ khóa",
"description": "Tối đa nhớ lại số lượng thời gian chờ khóa khi chạy tác vụ. Giá trị mặc định là 0."
+ },
+ "ci-sampling-size": {
+ "self": "Kích thước lấy mẫu dữ liệu CI",
+ "description": "Số lượng cơ sở dữ liệu tối đa để lấy mẫu trong quá trình xác thực dữ liệu CI. \nKhi bị vô hiệu hóa (không), xác thực đầy đủ sẽ được thực hiện."
}
}
},
@@ -2598,4 +2602,4 @@
"last-visit": "Lần truy cập cuối",
"changelog-for-version": "Nhật ký thay đổi cho phiên bản {version}"
}
-}
\ No newline at end of file
+}
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index ffbc8ffa90..98a2f587b4 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1640,6 +1640,10 @@
"max-retries": {
"self": "锁超时的最大重试数",
"description": "运行任务时锁超时的最大重试数。默认值为0。"
+ },
+ "ci-sampling-size": {
+ "self": "CI 数据采样大小",
+ "description": "在CI数据验证期间,要采样的数据库数量的最大数量。\n禁用(零)时,将执行完整验证。"
}
}
},
diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.ts
index 2fdf22f5e2..1576d9993b 100644
--- a/frontend/src/types/proto/google/protobuf/descriptor.ts
+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts
@@ -210,11 +210,19 @@ export interface FileDescriptorProto {
* The supported values are "proto2", "proto3", and "editions".
*
* If `edition` is present, this value must be "editions".
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
*/
syntax?:
| string
| undefined;
- /** The edition of the proto file. */
+ /**
+ * The edition of the proto file.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
edition?: Edition | undefined;
}
@@ -931,7 +939,12 @@ export interface FileOptions {
rubyPackage?:
| string
| undefined;
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1083,7 +1096,12 @@ export interface MessageOptions {
deprecatedLegacyJsonFieldConflicts?:
| boolean
| undefined;
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1188,7 +1206,12 @@ export interface FieldOptions {
retention?: FieldOptions_OptionRetention | undefined;
targets: FieldOptions_OptionTargetType[];
editionDefaults: FieldOptions_EditionDefault[];
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?: FeatureSet | undefined;
featureSupport?:
| FieldOptions_FeatureSupport
@@ -1524,7 +1547,12 @@ export interface FieldOptions_FeatureSupport {
}
export interface OneofOptions {
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1562,7 +1590,12 @@ export interface EnumOptions {
deprecatedLegacyJsonFieldConflicts?:
| boolean
| undefined;
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1580,7 +1613,12 @@ export interface EnumValueOptions {
deprecated?:
| boolean
| undefined;
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1601,7 +1639,12 @@ export interface EnumValueOptions {
}
export interface ServiceOptions {
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1629,7 +1672,12 @@ export interface MethodOptions {
idempotencyLevel?:
| MethodOptions_IdempotencyLevel
| undefined;
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1746,6 +1794,7 @@ export interface FeatureSet {
utf8Validation?: FeatureSet_Utf8Validation | undefined;
messageEncoding?: FeatureSet_MessageEncoding | undefined;
jsonFormat?: FeatureSet_JsonFormat | undefined;
+ enforceNamingStyle?: FeatureSet_EnforceNamingStyle | undefined;
}
export enum FeatureSet_FieldPresence {
@@ -2074,6 +2123,59 @@ export function featureSet_JsonFormatToNumber(object: FeatureSet_JsonFormat): nu
}
}
+export enum FeatureSet_EnforceNamingStyle {
+ ENFORCE_NAMING_STYLE_UNKNOWN = "ENFORCE_NAMING_STYLE_UNKNOWN",
+ STYLE2024 = "STYLE2024",
+ STYLE_LEGACY = "STYLE_LEGACY",
+ UNRECOGNIZED = "UNRECOGNIZED",
+}
+
+export function featureSet_EnforceNamingStyleFromJSON(object: any): FeatureSet_EnforceNamingStyle {
+ switch (object) {
+ case 0:
+ case "ENFORCE_NAMING_STYLE_UNKNOWN":
+ return FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
+ case 1:
+ case "STYLE2024":
+ return FeatureSet_EnforceNamingStyle.STYLE2024;
+ case 2:
+ case "STYLE_LEGACY":
+ return FeatureSet_EnforceNamingStyle.STYLE_LEGACY;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return FeatureSet_EnforceNamingStyle.UNRECOGNIZED;
+ }
+}
+
+export function featureSet_EnforceNamingStyleToJSON(object: FeatureSet_EnforceNamingStyle): string {
+ switch (object) {
+ case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN:
+ return "ENFORCE_NAMING_STYLE_UNKNOWN";
+ case FeatureSet_EnforceNamingStyle.STYLE2024:
+ return "STYLE2024";
+ case FeatureSet_EnforceNamingStyle.STYLE_LEGACY:
+ return "STYLE_LEGACY";
+ case FeatureSet_EnforceNamingStyle.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export function featureSet_EnforceNamingStyleToNumber(object: FeatureSet_EnforceNamingStyle): number {
+ switch (object) {
+ case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN:
+ return 0;
+ case FeatureSet_EnforceNamingStyle.STYLE2024:
+ return 1;
+ case FeatureSet_EnforceNamingStyle.STYLE_LEGACY:
+ return 2;
+ case FeatureSet_EnforceNamingStyle.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/**
* A compiled specification for the defaults of a set of features. These
* messages are generated from FeatureSet extensions and can be used to seed
@@ -6160,6 +6262,7 @@ function createBaseFeatureSet(): FeatureSet {
utf8Validation: FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN,
messageEncoding: FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN,
jsonFormat: FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,
+ enforceNamingStyle: FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,
};
}
@@ -6194,6 +6297,12 @@ export const FeatureSet: MessageFns<FeatureSet> = {
if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) {
writer.uint32(48).int32(featureSet_JsonFormatToNumber(message.jsonFormat));
}
+ if (
+ message.enforceNamingStyle !== undefined &&
+ message.enforceNamingStyle !== FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN
+ ) {
+ writer.uint32(56).int32(featureSet_EnforceNamingStyleToNumber(message.enforceNamingStyle));
+ }
return writer;
},
@@ -6252,6 +6361,14 @@ export const FeatureSet: MessageFns<FeatureSet> = {
message.jsonFormat = featureSet_JsonFormatFromJSON(reader.int32());
continue;
}
+ case 7: {
+ if (tag !== 56) {
+ break;
+ }
+
+ message.enforceNamingStyle = featureSet_EnforceNamingStyleFromJSON(reader.int32());
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -6281,6 +6398,9 @@ export const FeatureSet: MessageFns<FeatureSet> = {
jsonFormat: isSet(object.jsonFormat)
? featureSet_JsonFormatFromJSON(object.jsonFormat)
: FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,
+ enforceNamingStyle: isSet(object.enforceNamingStyle)
+ ? featureSet_EnforceNamingStyleFromJSON(object.enforceNamingStyle)
+ : FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,
};
},
@@ -6315,6 +6435,12 @@ export const FeatureSet: MessageFns<FeatureSet> = {
if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) {
obj.jsonFormat = featureSet_JsonFormatToJSON(message.jsonFormat);
}
+ if (
+ message.enforceNamingStyle !== undefined &&
+ message.enforceNamingStyle !== FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN
+ ) {
+ obj.enforceNamingStyle = featureSet_EnforceNamingStyleToJSON(message.enforceNamingStyle);
+ }
return obj;
},
@@ -6330,6 +6456,8 @@ export const FeatureSet: MessageFns<FeatureSet> = {
message.utf8Validation = object.utf8Validation ?? FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;
message.messageEncoding = object.messageEncoding ?? FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN;
message.jsonFormat = object.jsonFormat ?? FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN;
+ message.enforceNamingStyle = object.enforceNamingStyle ??
+ FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
return message;
},
};
diff --git a/frontend/src/types/proto/google/protobuf/wrappers.ts b/frontend/src/types/proto/google/protobuf/wrappers.ts
index 07224c0f85..bb730b69e5 100644
--- a/frontend/src/types/proto/google/protobuf/wrappers.ts
+++ b/frontend/src/types/proto/google/protobuf/wrappers.ts
@@ -14,6 +14,9 @@ export const protobufPackage = "google.protobuf";
* Wrapper message for `double`.
*
* The JSON representation for `DoubleValue` is JSON number.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface DoubleValue {
/** The double value. */
@@ -24,6 +27,9 @@ export interface DoubleValue {
* Wrapper message for `float`.
*
* The JSON representation for `FloatValue` is JSON number.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface FloatValue {
/** The float value. */
@@ -34,6 +40,9 @@ export interface FloatValue {
* Wrapper message for `int64`.
*
* The JSON representation for `Int64Value` is JSON string.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface Int64Value {
/** The int64 value. */
@@ -44,6 +53,9 @@ export interface Int64Value {
* Wrapper message for `uint64`.
*
* The JSON representation for `UInt64Value` is JSON string.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface UInt64Value {
/** The uint64 value. */
@@ -54,6 +66,9 @@ export interface UInt64Value {
* Wrapper message for `int32`.
*
* The JSON representation for `Int32Value` is JSON number.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface Int32Value {
/** The int32 value. */
@@ -64,6 +79,9 @@ export interface Int32Value {
* Wrapper message for `uint32`.
*
* The JSON representation for `UInt32Value` is JSON number.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface UInt32Value {
/** The uint32 value. */
@@ -74,6 +92,9 @@ export interface UInt32Value {
* Wrapper message for `bool`.
*
* The JSON representation for `BoolValue` is JSON `true` and `false`.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface BoolValue {
/** The bool value. */
@@ -84,6 +105,9 @@ export interface BoolValue {
* Wrapper message for `string`.
*
* The JSON representation for `StringValue` is JSON string.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface StringValue {
/** The string value. */
@@ -94,6 +118,9 @@ export interface StringValue {
* Wrapper message for `bytes`.
*
* The JSON representation for `BytesValue` is JSON string.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface BytesValue {
/** The bytes value. */
diff --git a/frontend/src/types/proto/store/project.ts b/frontend/src/types/proto/store/project.ts
index f1a6145baa..d24f8473d9 100644
--- a/frontend/src/types/proto/store/project.ts
+++ b/frontend/src/types/proto/store/project.ts
@@ -38,7 +38,14 @@ export interface Project {
/** Whether to allow the issue creator to self-approve the issue. */
allowSelfApproval: boolean;
/** Execution retry policy for the task run. */
- executionRetryPolicy: Project_ExecutionRetryPolicy | undefined;
+ executionRetryPolicy:
+ | Project_ExecutionRetryPolicy
+ | undefined;
+ /**
+ * The maximum number of databases to sample during CI data validation.
+ * Without specification, sampling is disabled, resulting in a full validation.
+ */
+ ciSamplingSize: number;
}
export interface Project_ExecutionRetryPolicy {
@@ -150,6 +157,7 @@ function createBaseProject(): Project {
postgresDatabaseTenantMode: false,
allowSelfApproval: false,
executionRetryPolicy: undefined,
+ ciSamplingSize: 0,
};
}
@@ -185,6 +193,9 @@ export const Project: MessageFns<Project> = {
if (message.executionRetryPolicy !== undefined) {
Project_ExecutionRetryPolicy.encode(message.executionRetryPolicy, writer.uint32(90).fork()).join();
}
+ if (message.ciSamplingSize !== 0) {
+ writer.uint32(96).int32(message.ciSamplingSize);
+ }
return writer;
},
@@ -275,6 +286,14 @@ export const Project: MessageFns<Project> = {
message.executionRetryPolicy = Project_ExecutionRetryPolicy.decode(reader, reader.uint32());
continue;
}
+ case 12: {
+ if (tag !== 96) {
+ break;
+ }
+
+ message.ciSamplingSize = reader.int32();
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -304,6 +323,7 @@ export const Project: MessageFns<Project> = {
executionRetryPolicy: isSet(object.executionRetryPolicy)
? Project_ExecutionRetryPolicy.fromJSON(object.executionRetryPolicy)
: undefined,
+ ciSamplingSize: isSet(object.ciSamplingSize) ? globalThis.Number(object.ciSamplingSize) : 0,
};
},
@@ -339,6 +359,9 @@ export const Project: MessageFns<Project> = {
if (message.executionRetryPolicy !== undefined) {
obj.executionRetryPolicy = Project_ExecutionRetryPolicy.toJSON(message.executionRetryPolicy);
}
+ if (message.ciSamplingSize !== 0) {
+ obj.ciSamplingSize = Math.round(message.ciSamplingSize);
+ }
return obj;
},
@@ -359,6 +382,7 @@ export const Project: MessageFns<Project> = {
message.executionRetryPolicy = (object.executionRetryPolicy !== undefined && object.executionRetryPolicy !== null)
? Project_ExecutionRetryPolicy.fromPartial(object.executionRetryPolicy)
: undefined;
+ message.ciSamplingSize = object.ciSamplingSize ?? 0;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/project_service.ts b/frontend/src/types/proto/v1/project_service.ts
index 154f1b4fb4..39b7fec592 100644
--- a/frontend/src/types/proto/v1/project_service.ts
+++ b/frontend/src/types/proto/v1/project_service.ts
@@ -207,7 +207,14 @@ export interface Project {
/** Whether to allow the issue creator to self-approve the issue. */
allowSelfApproval: boolean;
/** Execution retry policy for the task run. */
- executionRetryPolicy: Project_ExecutionRetryPolicy | undefined;
+ executionRetryPolicy:
+ | Project_ExecutionRetryPolicy
+ | undefined;
+ /**
+ * The maximum databases of rows to sample during CI data validation.
+ * Without specification, sampling is disabled, resulting in a full validation.
+ */
+ ciSamplingSize: number;
}
export interface Project_ExecutionRetryPolicy {
@@ -1670,6 +1677,7 @@ function createBaseProject(): Project {
postgresDatabaseTenantMode: false,
allowSelfApproval: false,
executionRetryPolicy: undefined,
+ ciSamplingSize: 0,
};
}
@@ -1720,6 +1728,9 @@ export const Project: MessageFns<Project> = {
if (message.executionRetryPolicy !== undefined) {
Project_ExecutionRetryPolicy.encode(message.executionRetryPolicy, writer.uint32(178).fork()).join();
}
+ if (message.ciSamplingSize !== 0) {
+ writer.uint32(184).int32(message.ciSamplingSize);
+ }
return writer;
},
@@ -1850,6 +1861,14 @@ export const Project: MessageFns<Project> = {
message.executionRetryPolicy = Project_ExecutionRetryPolicy.decode(reader, reader.uint32());
continue;
}
+ case 23: {
+ if (tag !== 184) {
+ break;
+ }
+
+ message.ciSamplingSize = reader.int32();
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -1886,6 +1905,7 @@ export const Project: MessageFns<Project> = {
executionRetryPolicy: isSet(object.executionRetryPolicy)
? Project_ExecutionRetryPolicy.fromJSON(object.executionRetryPolicy)
: undefined,
+ ciSamplingSize: isSet(object.ciSamplingSize) ? globalThis.Number(object.ciSamplingSize) : 0,
};
},
@@ -1936,6 +1956,9 @@ export const Project: MessageFns<Project> = {
if (message.executionRetryPolicy !== undefined) {
obj.executionRetryPolicy = Project_ExecutionRetryPolicy.toJSON(message.executionRetryPolicy);
}
+ if (message.ciSamplingSize !== 0) {
+ obj.ciSamplingSize = Math.round(message.ciSamplingSize);
+ }
return obj;
},
@@ -1961,6 +1984,7 @@ export const Project: MessageFns<Project> = {
message.executionRetryPolicy = (object.executionRetryPolicy !== undefined && object.executionRetryPolicy !== null)
? Project_ExecutionRetryPolicy.fromPartial(object.executionRetryPolicy)
: undefined;
+ message.ciSamplingSize = object.ciSamplingSize ?? 0;
return message;
},
};
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 345cf70898..57964172d3 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -11406,6 +11406,12 @@ components:
allOf:
- $ref: '#/components/schemas/Project_ExecutionRetryPolicy'
description: Execution retry policy for the task run.
+ ciSamplingSize:
+ type: integer
+ description: |-
+ The maximum number of databases to sample during CI data validation.
+ Without specification, sampling is disabled, resulting in a full validation.
+ format: int32
Project_ExecutionRetryPolicy:
type: object
properties:
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 78bd7e6943..7e8684d81d 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -3545,6 +3545,7 @@ RestrictIssueCreationForSQLReviewPolicy is the policy configuration for restrict
| postgres_database_tenant_mode | [bool](#bool) | | Whether to enable the database tenant mode for PostgreSQL. If enabled, the issue will be created with the pre-appended &#34;set role &lt;db_owner&gt;&#34; statement. |
| allow_self_approval | [bool](#bool) | | Whether to allow the issue creator to self-approve the issue. |
| execution_retry_policy | [Project.ExecutionRetryPolicy](#bytebase-store-Project-ExecutionRetryPolicy) | | Execution retry policy for the task run. |
+| ci_sampling_size | [int32](#int32) | | The maximum number of databases to sample during CI data validation. Without specification, sampling is disabled, resulting in a full validation. |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 07bd9d52cf..146eee6ad2 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -9575,6 +9575,14 @@ If enabled, the issue will be created with the pre-appended &#34;set role &lt;db
<td><p>Execution retry policy for the task run. </p></td>
</tr>
+ <tr>
+ <td>ci_sampling_size</td>
+ <td><a href="#int32">int32</a></td>
+ <td></td>
+ <td><p>The maximum number of databases to sample during CI data validation.
+Without specification, sampling is disabled, resulting in a full validation. </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index a53ae771c6..4eb433b1a6 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -8052,6 +8052,7 @@ When paginating, all other parameters provided to `ListProjects` must match the
| postgres_database_tenant_mode | [bool](#bool) | | Whether to enable the database tenant mode for PostgreSQL. If enabled, the issue will be created with the pre-appended &#34;set role &lt;db_owner&gt;&#34; statement. |
| allow_self_approval | [bool](#bool) | | Whether to allow the issue creator to self-approve the issue. |
| execution_retry_policy | [Project.ExecutionRetryPolicy](#bytebase-v1-Project-ExecutionRetryPolicy) | | Execution retry policy for the task run. |
+| ci_sampling_size | [int32](#int32) | | The maximum databases of rows to sample during CI data validation. Without specification, sampling is disabled, resulting in a full validation. |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index d40891af70..2c2559331d 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -22356,6 +22356,14 @@ If enabled, the issue will be created with the pre-appended &#34;set role &lt;db
<td><p>Execution retry policy for the task run. </p></td>
</tr>
+ <tr>
+ <td>ci_sampling_size</td>
+ <td><a href="#int32">int32</a></td>
+ <td></td>
+ <td><p>The maximum databases of rows to sample during CI data validation.
+Without specification, sampling is disabled, resulting in a full validation. </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/generated-go/store/project.pb.go b/proto/generated-go/store/project.pb.go
index 32dc54bf77..039232e413 100644
--- a/proto/generated-go/store/project.pb.go
+++ b/proto/generated-go/store/project.pb.go
@@ -103,8 +103,11 @@ type Project struct {
AllowSelfApproval bool `protobuf:"varint,10,opt,name=allow_self_approval,json=allowSelfApproval,proto3" json:"allow_self_approval,omitempty"`
// Execution retry policy for the task run.
ExecutionRetryPolicy *Project_ExecutionRetryPolicy `protobuf:"bytes,11,opt,name=execution_retry_policy,json=executionRetryPolicy,proto3" json:"execution_retry_policy,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+ // The maximum number of databases to sample during CI data validation.
+ // Without specification, sampling is disabled, resulting in a full validation.
+ CiSamplingSize int32 `protobuf:"varint,12,opt,name=ci_sampling_size,json=ciSamplingSize,proto3" json:"ci_sampling_size,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Project) Reset() {
@@ -207,6 +210,13 @@ func (x *Project) GetExecutionRetryPolicy() *Project_ExecutionRetryPolicy {
return nil
}
+func (x *Project) GetCiSamplingSize() int32 {
+ if x != nil {
+ return x.CiSamplingSize
+ }
+ return 0
+}
+
type Project_ExecutionRetryPolicy struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The maximum number of retries for the lock timeout issue.
@@ -260,7 +270,7 @@ const file_store_project_proto_rawDesc = "" +
"\x05Label\x12\x14\n" +
"\x05value\x18\x01 \x01(\tR\x05value\x12\x14\n" +
"\x05color\x18\x02 \x01(\tR\x05color\x12\x14\n" +
- "\x05group\x18\x03 \x01(\tR\x05group\"\xff\x04\n" +
+ "\x05group\x18\x03 \x01(\tR\x05group\"\xa9\x05\n" +
"\aProject\x128\n" +
"\fissue_labels\x18\x02 \x03(\v2\x15.bytebase.store.LabelR\vissueLabels\x12,\n" +
"\x12force_issue_labels\x18\x03 \x01(\bR\x10forceIssueLabels\x124\n" +
@@ -272,7 +282,8 @@ const file_store_project_proto_rawDesc = "" +
"\x1dpostgres_database_tenant_mode\x18\t \x01(\bR\x1apostgresDatabaseTenantMode\x12.\n" +
"\x13allow_self_approval\x18\n" +
" \x01(\bR\x11allowSelfApproval\x12b\n" +
- "\x16execution_retry_policy\x18\v \x01(\v2,.bytebase.store.Project.ExecutionRetryPolicyR\x14executionRetryPolicy\x1a?\n" +
+ "\x16execution_retry_policy\x18\v \x01(\v2,.bytebase.store.Project.ExecutionRetryPolicyR\x14executionRetryPolicy\x12(\n" +
+ "\x10ci_sampling_size\x18\f \x01(\x05R\x0eciSamplingSize\x1a?\n" +
"\x14ExecutionRetryPolicy\x12'\n" +
"\x0fmaximum_retries\x18\x01 \x01(\x05R\x0emaximumRetriesJ\x04\b\x01\x10\x02B\x14Z\x12generated-go/storeb\x06proto3"
diff --git a/proto/generated-go/v1/project_service.pb.go b/proto/generated-go/v1/project_service.pb.go
index 33a2b75853..e54ede5fad 100644
--- a/proto/generated-go/v1/project_service.pb.go
+++ b/proto/generated-go/v1/project_service.pb.go
@@ -958,8 +958,11 @@ type Project struct {
AllowSelfApproval bool `protobuf:"varint,21,opt,name=allow_self_approval,json=allowSelfApproval,proto3" json:"allow_self_approval,omitempty"`
// Execution retry policy for the task run.
ExecutionRetryPolicy *Project_ExecutionRetryPolicy `protobuf:"bytes,22,opt,name=execution_retry_policy,json=executionRetryPolicy,proto3" json:"execution_retry_policy,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+ // The maximum databases of rows to sample during CI data validation.
+ // Without specification, sampling is disabled, resulting in a full validation.
+ CiSamplingSize int32 `protobuf:"varint,23,opt,name=ci_sampling_size,json=ciSamplingSize,proto3" json:"ci_sampling_size,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Project) Reset() {
@@ -1097,6 +1100,13 @@ func (x *Project) GetExecutionRetryPolicy() *Project_ExecutionRetryPolicy {
return nil
}
+func (x *Project) GetCiSamplingSize() int32 {
+ if x != nil {
+ return x.CiSamplingSize
+ }
+ return 0
+}
+
type AddWebhookRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The name of the project to add the webhook to.
@@ -1638,7 +1648,7 @@ const file_v1_project_service_proto_rawDesc = "" +
"\x05Label\x12\x14\n" +
"\x05value\x18\x01 \x01(\tR\x05value\x12\x14\n" +
"\x05color\x18\x02 \x01(\tR\x05color\x12\x14\n" +
- "\x05group\x18\x03 \x01(\tR\x05group\"\xf1\x06\n" +
+ "\x05group\x18\x03 \x01(\tR\x05group\"\x9b\a\n" +
"\aProject\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12(\n" +
"\x05state\x18\x03 \x01(\x0e2\x12.bytebase.v1.StateR\x05state\x12\x14\n" +
@@ -1654,7 +1664,8 @@ const file_v1_project_service_proto_rawDesc = "" +
"\x12skip_backup_errors\x18\x13 \x01(\bR\x10skipBackupErrors\x12A\n" +
"\x1dpostgres_database_tenant_mode\x18\x14 \x01(\bR\x1apostgresDatabaseTenantMode\x12.\n" +
"\x13allow_self_approval\x18\x15 \x01(\bR\x11allowSelfApproval\x12_\n" +
- "\x16execution_retry_policy\x18\x16 \x01(\v2).bytebase.v1.Project.ExecutionRetryPolicyR\x14executionRetryPolicy\x1a?\n" +
+ "\x16execution_retry_policy\x18\x16 \x01(\v2).bytebase.v1.Project.ExecutionRetryPolicyR\x14executionRetryPolicy\x12(\n" +
+ "\x10ci_sampling_size\x18\x17 \x01(\x05R\x0eciSamplingSize\x1a?\n" +
"\x14ExecutionRetryPolicy\x12'\n" +
"\x0fmaximum_retries\x18\x01 \x01(\x05R\x0emaximumRetries:-\xeaA*\n" +
"\x14bytebase.com/Project\x12\x12projects/{project}J\x04\b\x02\x10\x03\"\x82\x01\n" +
diff --git a/proto/store/project.proto b/proto/store/project.proto
index 5e1ba76421..0343f0e97e 100644
--- a/proto/store/project.proto
+++ b/proto/store/project.proto
@@ -43,4 +43,8 @@ message Project {
// The maximum number of retries for the lock timeout issue.
int32 maximum_retries = 1;
}
+
+ // The maximum number of databases to sample during CI data validation.
+ // Without specification, sampling is disabled, resulting in a full validation.
+ int32 ci_sampling_size = 12;
}
diff --git a/proto/v1/project_service.proto b/proto/v1/project_service.proto
index 12baee27cb..a6a8231311 100644
--- a/proto/v1/project_service.proto
+++ b/proto/v1/project_service.proto
@@ -339,6 +339,10 @@ message Project {
// The maximum number of retries for the lock timeout issue.
int32 maximum_retries = 1;
}
+
+ // The maximum databases of rows to sample during CI data validation.
+ // Without specification, sampling is disabled, resulting in a full validation.
+ int32 ci_sampling_size = 23;
}
message AddWebhookRequest {