diff --git a/app/artifact-cas/api/cas/v1/resource.pb.go b/app/artifact-cas/api/cas/v1/resource.pb.go index 69fb6a09f..6773304eb 100644 --- a/app/artifact-cas/api/cas/v1/resource.pb.go +++ b/app/artifact-cas/api/cas/v1/resource.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: cas/v1/resource.proto diff --git a/app/artifact-cas/api/cas/v1/status.pb.go b/app/artifact-cas/api/cas/v1/status.pb.go index 6c3b00313..3e5bae98a 100644 --- a/app/artifact-cas/api/cas/v1/status.pb.go +++ b/app/artifact-cas/api/cas/v1/status.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: cas/v1/status.proto diff --git a/app/cli/api/attestation/v1/crafting_state.pb.go b/app/cli/api/attestation/v1/crafting_state.pb.go index a0ac3364a..a62027582 100644 --- a/app/cli/api/attestation/v1/crafting_state.pb.go +++ b/app/cli/api/attestation/v1/crafting_state.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: attestation/v1/crafting_state.proto diff --git a/app/cli/internal/action/workflow_run_list.go b/app/cli/internal/action/workflow_run_list.go index d40b8b1fb..3bd5d1048 100644 --- a/app/cli/internal/action/workflow_run_list.go +++ b/app/cli/internal/action/workflow_run_list.go @@ -115,6 +115,8 @@ func humanizedRunnerType(in v1.CraftingSchema_Runner_RunnerType) string { return "GitHub" case *v1.CraftingSchema_Runner_GITLAB_PIPELINE.Enum(): return "GitLab" + case *v1.CraftingSchema_Runner_AZURE_PIPELINE.Enum(): + return "Azure Pipeline" default: return "Unspecified" } diff --git a/app/controlplane/api/controlplane/v1/auth.pb.go b/app/controlplane/api/controlplane/v1/auth.pb.go index 7c6e7d017..4e7e4cbf8 100644 --- a/app/controlplane/api/controlplane/v1/auth.pb.go +++ b/app/controlplane/api/controlplane/v1/auth.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/auth.proto diff --git a/app/controlplane/api/controlplane/v1/cas_backends.pb.go b/app/controlplane/api/controlplane/v1/cas_backends.pb.go index 5045750a7..64ade8919 100644 --- a/app/controlplane/api/controlplane/v1/cas_backends.pb.go +++ b/app/controlplane/api/controlplane/v1/cas_backends.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/cas_backends.proto diff --git a/app/controlplane/api/controlplane/v1/cas_credentials.pb.go b/app/controlplane/api/controlplane/v1/cas_credentials.pb.go index 287dab2d2..3ccf5ed0b 100644 --- a/app/controlplane/api/controlplane/v1/cas_credentials.pb.go +++ b/app/controlplane/api/controlplane/v1/cas_credentials.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/cas_credentials.proto diff --git a/app/controlplane/api/controlplane/v1/context.pb.go b/app/controlplane/api/controlplane/v1/context.pb.go index 729f448c4..d5404c63c 100644 --- a/app/controlplane/api/controlplane/v1/context.pb.go +++ b/app/controlplane/api/controlplane/v1/context.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/context.proto diff --git a/app/controlplane/api/controlplane/v1/integrations.pb.go b/app/controlplane/api/controlplane/v1/integrations.pb.go index 1b79661fe..62f83a420 100644 --- a/app/controlplane/api/controlplane/v1/integrations.pb.go +++ b/app/controlplane/api/controlplane/v1/integrations.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/integrations.proto diff --git a/app/controlplane/api/controlplane/v1/org_metrics.pb.go b/app/controlplane/api/controlplane/v1/org_metrics.pb.go index c81d15197..324bc1fb2 100644 --- a/app/controlplane/api/controlplane/v1/org_metrics.pb.go +++ b/app/controlplane/api/controlplane/v1/org_metrics.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/org_metrics.proto diff --git a/app/controlplane/api/controlplane/v1/organization.pb.go b/app/controlplane/api/controlplane/v1/organization.pb.go index f272933f1..6f1c8ec04 100644 --- a/app/controlplane/api/controlplane/v1/organization.pb.go +++ b/app/controlplane/api/controlplane/v1/organization.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/organization.proto diff --git a/app/controlplane/api/controlplane/v1/pagination.pb.go b/app/controlplane/api/controlplane/v1/pagination.pb.go index 81b4158a8..9631c5dbf 100644 --- a/app/controlplane/api/controlplane/v1/pagination.pb.go +++ b/app/controlplane/api/controlplane/v1/pagination.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/pagination.proto diff --git a/app/controlplane/api/controlplane/v1/response_messages.pb.go b/app/controlplane/api/controlplane/v1/response_messages.pb.go index 74b82bc8c..4ba87b150 100644 --- a/app/controlplane/api/controlplane/v1/response_messages.pb.go +++ b/app/controlplane/api/controlplane/v1/response_messages.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/response_messages.proto diff --git a/app/controlplane/api/controlplane/v1/robot_accounts.pb.go b/app/controlplane/api/controlplane/v1/robot_accounts.pb.go index 6f7a87b7d..c503a1a85 100644 --- a/app/controlplane/api/controlplane/v1/robot_accounts.pb.go +++ b/app/controlplane/api/controlplane/v1/robot_accounts.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/robot_accounts.proto diff --git a/app/controlplane/api/controlplane/v1/status.pb.go b/app/controlplane/api/controlplane/v1/status.pb.go index 78a72d596..443b2eb2d 100644 --- a/app/controlplane/api/controlplane/v1/status.pb.go +++ b/app/controlplane/api/controlplane/v1/status.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/status.proto diff --git a/app/controlplane/api/controlplane/v1/workflow.pb.go b/app/controlplane/api/controlplane/v1/workflow.pb.go index d788bb7d8..bef63fd1d 100644 --- a/app/controlplane/api/controlplane/v1/workflow.pb.go +++ b/app/controlplane/api/controlplane/v1/workflow.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/workflow.proto diff --git a/app/controlplane/api/controlplane/v1/workflow_contract.pb.go b/app/controlplane/api/controlplane/v1/workflow_contract.pb.go index fa7ce2cb4..845601a17 100644 --- a/app/controlplane/api/controlplane/v1/workflow_contract.pb.go +++ b/app/controlplane/api/controlplane/v1/workflow_contract.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/workflow_contract.proto diff --git a/app/controlplane/api/controlplane/v1/workflow_run.pb.go b/app/controlplane/api/controlplane/v1/workflow_run.pb.go index 44f872e7a..75ae5a373 100644 --- a/app/controlplane/api/controlplane/v1/workflow_run.pb.go +++ b/app/controlplane/api/controlplane/v1/workflow_run.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: controlplane/v1/workflow_run.proto diff --git a/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts b/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts index b961385bd..71df319e6 100644 --- a/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts +++ b/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts @@ -42,9 +42,13 @@ export interface FileDescriptorProto { sourceCodeInfo?: SourceCodeInfo; /** * The syntax of the proto file. - * The supported values are "proto2" and "proto3". + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". */ syntax: string; + /** The edition of the proto file, which is an opaque string. */ + edition: string; } /** Describes a message type. */ @@ -619,6 +623,10 @@ export interface MessageOptions { */ deprecated: boolean; /** + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * * Whether the message is an automatically generated map entry type for the * maps field. * @@ -636,12 +644,23 @@ export interface MessageOptions { * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. - * - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. */ mapEntry: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO(b/261750190) This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts: boolean; /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } @@ -705,11 +724,8 @@ export interface FieldOptions { * check its required fields, regardless of whether or not the message has * been parsed. * - * As of 2021, lazy does no correctness checks on the byte stream during - * parsing. This may lead to crashes if and when an invalid byte stream is - * finally parsed upon access. - * - * TODO(b/211906113): Enable validation on lazy fields. + * As of May 2022, lazy verifies the contents of the byte stream during + * parsing. An invalid byte stream will cause the overall parsing to fail. */ lazy: boolean; /** @@ -727,6 +743,13 @@ export interface FieldOptions { deprecated: boolean; /** For Google-internal migration only. Do not use. */ weak: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + */ + debugRedact: boolean; + retention: FieldOptions_OptionRetention; + target: FieldOptions_OptionTargetType; /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } @@ -813,6 +836,137 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { } } +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * Note: as of January 2023, support for this is in progress and does not yet + * have an effect (b/264593489). + */ +export enum FieldOptions_OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_OptionRetentionFromJSON(object: any): FieldOptions_OptionRetention { + switch (object) { + case 0: + case "RETENTION_UNKNOWN": + return FieldOptions_OptionRetention.RETENTION_UNKNOWN; + case 1: + case "RETENTION_RUNTIME": + return FieldOptions_OptionRetention.RETENTION_RUNTIME; + case 2: + case "RETENTION_SOURCE": + return FieldOptions_OptionRetention.RETENTION_SOURCE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_OptionRetention.UNRECOGNIZED; + } +} + +export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRetention): string { + switch (object) { + case FieldOptions_OptionRetention.RETENTION_UNKNOWN: + return "RETENTION_UNKNOWN"; + case FieldOptions_OptionRetention.RETENTION_RUNTIME: + return "RETENTION_RUNTIME"; + case FieldOptions_OptionRetention.RETENTION_SOURCE: + return "RETENTION_SOURCE"; + case FieldOptions_OptionRetention.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. Note: as of January 2023, support for this is + * in progress and does not yet have an effect (b/264593489). + */ +export enum FieldOptions_OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9, + UNRECOGNIZED = -1, +} + +export function fieldOptions_OptionTargetTypeFromJSON(object: any): FieldOptions_OptionTargetType { + switch (object) { + case 0: + case "TARGET_TYPE_UNKNOWN": + return FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN; + case 1: + case "TARGET_TYPE_FILE": + return FieldOptions_OptionTargetType.TARGET_TYPE_FILE; + case 2: + case "TARGET_TYPE_EXTENSION_RANGE": + return FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE; + case 3: + case "TARGET_TYPE_MESSAGE": + return FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE; + case 4: + case "TARGET_TYPE_FIELD": + return FieldOptions_OptionTargetType.TARGET_TYPE_FIELD; + case 5: + case "TARGET_TYPE_ONEOF": + return FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF; + case 6: + case "TARGET_TYPE_ENUM": + return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM; + case 7: + case "TARGET_TYPE_ENUM_ENTRY": + return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY; + case 8: + case "TARGET_TYPE_SERVICE": + return FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE; + case 9: + case "TARGET_TYPE_METHOD": + return FieldOptions_OptionTargetType.TARGET_TYPE_METHOD; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_OptionTargetType.UNRECOGNIZED; + } +} + +export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionTargetType): string { + switch (object) { + case FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN: + return "TARGET_TYPE_UNKNOWN"; + case FieldOptions_OptionTargetType.TARGET_TYPE_FILE: + return "TARGET_TYPE_FILE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE: + return "TARGET_TYPE_EXTENSION_RANGE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE: + return "TARGET_TYPE_MESSAGE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_FIELD: + return "TARGET_TYPE_FIELD"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF: + return "TARGET_TYPE_ONEOF"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM: + return "TARGET_TYPE_ENUM"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY: + return "TARGET_TYPE_ENUM_ENTRY"; + case FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE: + return "TARGET_TYPE_SERVICE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_METHOD: + return "TARGET_TYPE_METHOD"; + case FieldOptions_OptionTargetType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; @@ -831,6 +985,17 @@ export interface EnumOptions { * is a formalization for deprecating enums. */ deprecated: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO(b/261750190) Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts: boolean; /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } @@ -1122,10 +1287,57 @@ export interface GeneratedCodeInfo_Annotation { begin: number; /** * Identifies the ending offset in bytes in the generated code that - * relates to the identified offset. The end offset should be one past + * relates to the identified object. The end offset should be one past * the last relevant byte (so the length of the text = end - begin). */ end: number; + semantic: GeneratedCodeInfo_Annotation_Semantic; +} + +/** + * Represents the identified object's effect on the element in the original + * .proto file. + */ +export enum GeneratedCodeInfo_Annotation_Semantic { + /** NONE - There is no effect or the effect is indescribable. */ + NONE = 0, + /** SET - The element is set or otherwise mutated. */ + SET = 1, + /** ALIAS - An alias to the element is returned. */ + ALIAS = 2, + UNRECOGNIZED = -1, +} + +export function generatedCodeInfo_Annotation_SemanticFromJSON(object: any): GeneratedCodeInfo_Annotation_Semantic { + switch (object) { + case 0: + case "NONE": + return GeneratedCodeInfo_Annotation_Semantic.NONE; + case 1: + case "SET": + return GeneratedCodeInfo_Annotation_Semantic.SET; + case 2: + case "ALIAS": + return GeneratedCodeInfo_Annotation_Semantic.ALIAS; + case -1: + case "UNRECOGNIZED": + default: + return GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED; + } +} + +export function generatedCodeInfo_Annotation_SemanticToJSON(object: GeneratedCodeInfo_Annotation_Semantic): string { + switch (object) { + case GeneratedCodeInfo_Annotation_Semantic.NONE: + return "NONE"; + case GeneratedCodeInfo_Annotation_Semantic.SET: + return "SET"; + case GeneratedCodeInfo_Annotation_Semantic.ALIAS: + return "ALIAS"; + case GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } } function createBaseFileDescriptorSet(): FileDescriptorSet { @@ -1202,6 +1414,7 @@ function createBaseFileDescriptorProto(): FileDescriptorProto { options: undefined, sourceCodeInfo: undefined, syntax: "", + edition: "", }; } @@ -1247,6 +1460,9 @@ export const FileDescriptorProto = { if (message.syntax !== "") { writer.uint32(98).string(message.syntax); } + if (message.edition !== "") { + writer.uint32(106).string(message.edition); + } return writer; }, @@ -1361,6 +1577,13 @@ export const FileDescriptorProto = { message.syntax = reader.string(); continue; + case 13: + if (tag !== 106) { + break; + } + + message.edition = reader.string(); + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -1390,6 +1613,7 @@ export const FileDescriptorProto = { options: isSet(object.options) ? FileOptions.fromJSON(object.options) : undefined, sourceCodeInfo: isSet(object.sourceCodeInfo) ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) : undefined, syntax: isSet(object.syntax) ? String(object.syntax) : "", + edition: isSet(object.edition) ? String(object.edition) : "", }; }, @@ -1436,6 +1660,7 @@ export const FileDescriptorProto = { message.sourceCodeInfo !== undefined && (obj.sourceCodeInfo = message.sourceCodeInfo ? SourceCodeInfo.toJSON(message.sourceCodeInfo) : undefined); message.syntax !== undefined && (obj.syntax = message.syntax); + message.edition !== undefined && (obj.edition = message.edition); return obj; }, @@ -1461,6 +1686,7 @@ export const FileDescriptorProto = { ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) : undefined; message.syntax = object.syntax ?? ""; + message.edition = object.edition ?? ""; return message; }, }; @@ -3061,6 +3287,7 @@ function createBaseMessageOptions(): MessageOptions { noStandardDescriptorAccessor: false, deprecated: false, mapEntry: false, + deprecatedLegacyJsonFieldConflicts: false, uninterpretedOption: [], }; } @@ -3079,6 +3306,9 @@ export const MessageOptions = { if (message.mapEntry === true) { writer.uint32(56).bool(message.mapEntry); } + if (message.deprecatedLegacyJsonFieldConflicts === true) { + writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts); + } for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } @@ -3120,6 +3350,13 @@ export const MessageOptions = { message.mapEntry = reader.bool(); continue; + case 11: + if (tag !== 88) { + break; + } + + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + continue; case 999: if (tag !== 7994) { break; @@ -3144,6 +3381,9 @@ export const MessageOptions = { : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, mapEntry: isSet(object.mapEntry) ? Boolean(object.mapEntry) : false, + deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) + ? Boolean(object.deprecatedLegacyJsonFieldConflicts) + : false, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], @@ -3157,6 +3397,8 @@ export const MessageOptions = { (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + message.deprecatedLegacyJsonFieldConflicts !== undefined && + (obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts); if (message.uninterpretedOption) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { @@ -3175,6 +3417,7 @@ export const MessageOptions = { message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; message.deprecated = object.deprecated ?? false; message.mapEntry = object.mapEntry ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, @@ -3189,6 +3432,9 @@ function createBaseFieldOptions(): FieldOptions { unverifiedLazy: false, deprecated: false, weak: false, + debugRedact: false, + retention: 0, + target: 0, uninterpretedOption: [], }; } @@ -3216,6 +3462,15 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } + if (message.debugRedact === true) { + writer.uint32(128).bool(message.debugRedact); + } + if (message.retention !== 0) { + writer.uint32(136).int32(message.retention); + } + if (message.target !== 0) { + writer.uint32(144).int32(message.target); + } for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } @@ -3278,6 +3533,27 @@ export const FieldOptions = { message.weak = reader.bool(); continue; + case 16: + if (tag !== 128) { + break; + } + + message.debugRedact = reader.bool(); + continue; + case 17: + if (tag !== 136) { + break; + } + + message.retention = reader.int32() as any; + continue; + case 18: + if (tag !== 144) { + break; + } + + message.target = reader.int32() as any; + continue; case 999: if (tag !== 7994) { break; @@ -3303,6 +3579,9 @@ export const FieldOptions = { unverifiedLazy: isSet(object.unverifiedLazy) ? Boolean(object.unverifiedLazy) : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, weak: isSet(object.weak) ? Boolean(object.weak) : false, + debugRedact: isSet(object.debugRedact) ? Boolean(object.debugRedact) : false, + retention: isSet(object.retention) ? fieldOptions_OptionRetentionFromJSON(object.retention) : 0, + target: isSet(object.target) ? fieldOptions_OptionTargetTypeFromJSON(object.target) : 0, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], @@ -3318,6 +3597,9 @@ export const FieldOptions = { message.unverifiedLazy !== undefined && (obj.unverifiedLazy = message.unverifiedLazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); + message.debugRedact !== undefined && (obj.debugRedact = message.debugRedact); + message.retention !== undefined && (obj.retention = fieldOptions_OptionRetentionToJSON(message.retention)); + message.target !== undefined && (obj.target = fieldOptions_OptionTargetTypeToJSON(message.target)); if (message.uninterpretedOption) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { @@ -3339,6 +3621,9 @@ export const FieldOptions = { message.unverifiedLazy = object.unverifiedLazy ?? false; message.deprecated = object.deprecated ?? false; message.weak = object.weak ?? false; + message.debugRedact = object.debugRedact ?? false; + message.retention = object.retention ?? 0; + message.target = object.target ?? 0; message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, @@ -3409,7 +3694,7 @@ export const OneofOptions = { }; function createBaseEnumOptions(): EnumOptions { - return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; + return { allowAlias: false, deprecated: false, deprecatedLegacyJsonFieldConflicts: false, uninterpretedOption: [] }; } export const EnumOptions = { @@ -3420,6 +3705,9 @@ export const EnumOptions = { if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } + if (message.deprecatedLegacyJsonFieldConflicts === true) { + writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts); + } for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } @@ -3447,6 +3735,13 @@ export const EnumOptions = { message.deprecated = reader.bool(); continue; + case 6: + if (tag !== 48) { + break; + } + + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + continue; case 999: if (tag !== 7994) { break; @@ -3467,6 +3762,9 @@ export const EnumOptions = { return { allowAlias: isSet(object.allowAlias) ? Boolean(object.allowAlias) : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) + ? Boolean(object.deprecatedLegacyJsonFieldConflicts) + : false, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], @@ -3477,6 +3775,8 @@ export const EnumOptions = { const obj: any = {}; message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.deprecatedLegacyJsonFieldConflicts !== undefined && + (obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts); if (message.uninterpretedOption) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { @@ -3493,6 +3793,7 @@ export const EnumOptions = { const message = createBaseEnumOptions(); message.allowAlias = object.allowAlias ?? false; message.deprecated = object.deprecated ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, @@ -4242,7 +4543,7 @@ export const GeneratedCodeInfo = { }; function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { - return { path: [], sourceFile: "", begin: 0, end: 0 }; + return { path: [], sourceFile: "", begin: 0, end: 0, semantic: 0 }; } export const GeneratedCodeInfo_Annotation = { @@ -4261,6 +4562,9 @@ export const GeneratedCodeInfo_Annotation = { if (message.end !== 0) { writer.uint32(32).int32(message.end); } + if (message.semantic !== 0) { + writer.uint32(40).int32(message.semantic); + } return writer; }, @@ -4309,6 +4613,13 @@ export const GeneratedCodeInfo_Annotation = { message.end = reader.int32(); continue; + case 5: + if (tag !== 40) { + break; + } + + message.semantic = reader.int32() as any; + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -4324,6 +4635,7 @@ export const GeneratedCodeInfo_Annotation = { sourceFile: isSet(object.sourceFile) ? String(object.sourceFile) : "", begin: isSet(object.begin) ? Number(object.begin) : 0, end: isSet(object.end) ? Number(object.end) : 0, + semantic: isSet(object.semantic) ? generatedCodeInfo_Annotation_SemanticFromJSON(object.semantic) : 0, }; }, @@ -4337,6 +4649,7 @@ export const GeneratedCodeInfo_Annotation = { message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile); message.begin !== undefined && (obj.begin = Math.round(message.begin)); message.end !== undefined && (obj.end = Math.round(message.end)); + message.semantic !== undefined && (obj.semantic = generatedCodeInfo_Annotation_SemanticToJSON(message.semantic)); return obj; }, @@ -4350,6 +4663,7 @@ export const GeneratedCodeInfo_Annotation = { message.sourceFile = object.sourceFile ?? ""; message.begin = object.begin ?? 0; message.end = object.end ?? 0; + message.semantic = object.semantic ?? 0; return message; }, }; diff --git a/app/controlplane/api/gen/frontend/workflowcontract/v1/crafting_schema.ts b/app/controlplane/api/gen/frontend/workflowcontract/v1/crafting_schema.ts index 85414c910..fdfbaf18a 100644 --- a/app/controlplane/api/gen/frontend/workflowcontract/v1/crafting_schema.ts +++ b/app/controlplane/api/gen/frontend/workflowcontract/v1/crafting_schema.ts @@ -23,6 +23,7 @@ export enum CraftingSchema_Runner_RunnerType { RUNNER_TYPE_UNSPECIFIED = 0, GITHUB_ACTION = 1, GITLAB_PIPELINE = 2, + AZURE_PIPELINE = 3, UNRECOGNIZED = -1, } @@ -37,6 +38,9 @@ export function craftingSchema_Runner_RunnerTypeFromJSON(object: any): CraftingS case 2: case "GITLAB_PIPELINE": return CraftingSchema_Runner_RunnerType.GITLAB_PIPELINE; + case 3: + case "AZURE_PIPELINE": + return CraftingSchema_Runner_RunnerType.AZURE_PIPELINE; case -1: case "UNRECOGNIZED": default: @@ -52,6 +56,8 @@ export function craftingSchema_Runner_RunnerTypeToJSON(object: CraftingSchema_Ru return "GITHUB_ACTION"; case CraftingSchema_Runner_RunnerType.GITLAB_PIPELINE: return "GITLAB_PIPELINE"; + case CraftingSchema_Runner_RunnerType.AZURE_PIPELINE: + return "AZURE_PIPELINE"; case CraftingSchema_Runner_RunnerType.UNRECOGNIZED: default: return "UNRECOGNIZED"; diff --git a/app/controlplane/api/workflowcontract/v1/crafting_schema.pb.go b/app/controlplane/api/workflowcontract/v1/crafting_schema.pb.go index 5d1688041..a71e20e87 100644 --- a/app/controlplane/api/workflowcontract/v1/crafting_schema.pb.go +++ b/app/controlplane/api/workflowcontract/v1/crafting_schema.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: workflowcontract/v1/crafting_schema.proto @@ -42,6 +42,7 @@ const ( CraftingSchema_Runner_RUNNER_TYPE_UNSPECIFIED CraftingSchema_Runner_RunnerType = 0 CraftingSchema_Runner_GITHUB_ACTION CraftingSchema_Runner_RunnerType = 1 CraftingSchema_Runner_GITLAB_PIPELINE CraftingSchema_Runner_RunnerType = 2 + CraftingSchema_Runner_AZURE_PIPELINE CraftingSchema_Runner_RunnerType = 3 ) // Enum value maps for CraftingSchema_Runner_RunnerType. @@ -50,11 +51,13 @@ var ( 0: "RUNNER_TYPE_UNSPECIFIED", 1: "GITHUB_ACTION", 2: "GITLAB_PIPELINE", + 3: "AZURE_PIPELINE", } CraftingSchema_Runner_RunnerType_value = map[string]int32{ "RUNNER_TYPE_UNSPECIFIED": 0, "GITHUB_ACTION": 1, "GITLAB_PIPELINE": 2, + "AZURE_PIPELINE": 3, } ) @@ -413,7 +416,7 @@ var file_workflowcontract_v1_crafting_schema_proto_rawDesc = []byte{ 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x06, 0x0a, 0x0e, 0x43, 0x72, + 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdd, 0x06, 0x0a, 0x0e, 0x43, 0x72, 0x61, 0x66, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x30, 0x0a, 0x0e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x0a, 0x02, 0x76, 0x31, 0x52, @@ -429,54 +432,55 @@ var file_workflowcontract_v1_crafting_schema_proto_rawDesc = []byte{ 0x32, 0x2a, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x61, 0x66, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x52, 0x06, 0x72, 0x75, - 0x6e, 0x6e, 0x65, 0x72, 0x1a, 0xb0, 0x01, 0x0a, 0x06, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x12, + 0x6e, 0x6e, 0x65, 0x72, 0x1a, 0xc4, 0x01, 0x0a, 0x06, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x53, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x61, 0x66, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x20, 0x00, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x22, 0x51, 0x0a, 0x0a, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x79, + 0x74, 0x79, 0x70, 0x65, 0x22, 0x65, 0x0a, 0x0a, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x55, 0x4e, 0x4e, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x47, 0x49, 0x54, 0x4c, 0x41, 0x42, 0x5f, 0x50, 0x49, 0x50, - 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x1a, 0x9b, 0x03, 0x0a, 0x08, 0x4d, 0x61, 0x74, 0x65, - 0x72, 0x69, 0x61, 0x6c, 0x12, 0x57, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x39, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x61, 0x66, 0x74, 0x69, 0x6e, - 0x67, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, - 0x2e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, - 0x42, 0x05, 0x82, 0x01, 0x02, 0x20, 0x00, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xfa, 0x42, 0x0d, - 0x72, 0x0b, 0x32, 0x09, 0x5e, 0x5b, 0x5c, 0x77, 0x7c, 0x2d, 0x5d, 0x2b, 0x24, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x12, - 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x41, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x77, - 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x98, 0x01, 0x0a, 0x0c, 0x4d, - 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x4d, - 0x41, 0x54, 0x45, 0x52, 0x49, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, - 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, - 0x4e, 0x45, 0x52, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x41, - 0x52, 0x54, 0x49, 0x46, 0x41, 0x43, 0x54, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x42, 0x4f, - 0x4d, 0x5f, 0x43, 0x59, 0x43, 0x4c, 0x4f, 0x4e, 0x45, 0x44, 0x58, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, - 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x42, 0x4f, 0x4d, 0x5f, 0x53, 0x50, 0x44, 0x58, 0x5f, - 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x55, 0x4e, 0x49, 0x54, 0x5f, - 0x58, 0x4d, 0x4c, 0x10, 0x06, 0x22, 0x46, 0x0a, 0x0a, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x72, 0x09, 0x32, 0x07, 0x5e, 0x5b, 0x5c, 0x77, 0x5d, 0x2b, - 0x24, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x4d, 0x5a, - 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, - 0x6f, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, - 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x5a, 0x55, 0x52, 0x45, + 0x5f, 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x03, 0x1a, 0x9b, 0x03, 0x0a, 0x08, + 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x12, 0x57, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x39, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, + 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x61, + 0x66, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x4d, 0x61, 0x74, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, + 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x20, 0x00, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x10, 0xfa, 0x42, 0x0d, 0x72, 0x0b, 0x32, 0x09, 0x5e, 0x5b, 0x5c, 0x77, 0x7c, 0x2d, 0x5d, 0x2b, + 0x24, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x41, 0x0a, 0x0b, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x98, + 0x01, 0x0a, 0x0c, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1d, 0x0a, 0x19, 0x4d, 0x41, 0x54, 0x45, 0x52, 0x49, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, + 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x4f, + 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x02, 0x12, + 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x54, 0x49, 0x46, 0x41, 0x43, 0x54, 0x10, 0x03, 0x12, 0x17, 0x0a, + 0x13, 0x53, 0x42, 0x4f, 0x4d, 0x5f, 0x43, 0x59, 0x43, 0x4c, 0x4f, 0x4e, 0x45, 0x44, 0x58, 0x5f, + 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x42, 0x4f, 0x4d, 0x5f, 0x53, + 0x50, 0x44, 0x58, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x55, + 0x4e, 0x49, 0x54, 0x5f, 0x58, 0x4d, 0x4c, 0x10, 0x06, 0x22, 0x46, 0x0a, 0x0a, 0x41, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x72, 0x09, 0x32, 0x07, 0x5e, 0x5b, + 0x5c, 0x77, 0x5d, 0x2b, 0x24, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x42, 0x4d, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x77, 0x6f, 0x72, + 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/controlplane/api/workflowcontract/v1/crafting_schema.proto b/app/controlplane/api/workflowcontract/v1/crafting_schema.proto index aea2baeb3..eb8a1f946 100644 --- a/app/controlplane/api/workflowcontract/v1/crafting_schema.proto +++ b/app/controlplane/api/workflowcontract/v1/crafting_schema.proto @@ -37,6 +37,7 @@ message CraftingSchema { RUNNER_TYPE_UNSPECIFIED = 0; GITHUB_ACTION = 1; GITLAB_PIPELINE = 2; + AZURE_PIPELINE = 3; } } diff --git a/app/controlplane/plugins/sdk/v1/plugin/api/fanout.pb.go b/app/controlplane/plugins/sdk/v1/plugin/api/fanout.pb.go index 04fe4b45b..281c3b903 100644 --- a/app/controlplane/plugins/sdk/v1/plugin/api/fanout.pb.go +++ b/app/controlplane/plugins/sdk/v1/plugin/api/fanout.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: fanout.proto diff --git a/internal/attestation/crafter/runner.go b/internal/attestation/crafter/runner.go index d79ab75cb..a052c179b 100644 --- a/internal/attestation/crafter/runner.go +++ b/internal/attestation/crafter/runner.go @@ -42,6 +42,8 @@ func NewRunner(t schemaapi.CraftingSchema_Runner_RunnerType) supportedRunner { return &runners.GitHubAction{} case schemaapi.CraftingSchema_Runner_GITLAB_PIPELINE: return &runners.GitlabPipeline{} + case schemaapi.CraftingSchema_Runner_AZURE_PIPELINE: + return &runners.AzurePipeline{} default: return &runners.Generic{} } diff --git a/internal/attestation/crafter/runners/azurepipeline.go b/internal/attestation/crafter/runners/azurepipeline.go new file mode 100644 index 000000000..8609128ec --- /dev/null +++ b/internal/attestation/crafter/runners/azurepipeline.go @@ -0,0 +1,86 @@ +// +// Copyright 2023 The Chainloop Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runners + +import ( + neturl "net/url" + "os" + "path" +) + +type AzurePipeline struct{} + +const AzurePipelineID = "azure-pipeline" + +func NewAzurePipeline() *AzurePipeline { + return &AzurePipeline{} +} + +// Figure out if we are in a Azure Pipeline job or not +func (r *AzurePipeline) CheckEnv() bool { + for _, varName := range []string{"TF_BUILD", "BUILD_BUILDURI"} { + if os.Getenv(varName) == "" { + return false + } + } + + return true +} + +func (r *AzurePipeline) ListEnvVars() []string { + return []string{ + "BUILD_REQUESTEDFOREMAIL", + "BUILD_REQUESTEDFOR", + "BUILD_REPOSITORY_URI", + "BUILD_REPOSITORY_NAME", + "BUILD_BUILDID", + "BUILD_BUILDNUMBER", + "BUILD_BUILDURI", + "BUILD_REASON", + "AGENT_VERSION", + "TF_BUILD", + } +} + +func (r *AzurePipeline) ResolveEnvVars() map[string]string { + return resolveEnvVars(r.ListEnvVars()) +} + +func (r *AzurePipeline) String() string { + return AzurePipelineID +} + +func (r *AzurePipeline) RunURI() (url string) { + teamFoundationServerURI := os.Getenv("SYSTEM_TEAMFOUNDATIONSERVERURI") + definitionName := os.Getenv("SYSTEM_DEFINITIONNAME") + buildID := os.Getenv("BUILD_BUILDID") + jobID := os.Getenv("SYSTEM_JOBID") + + uri, err := neturl.Parse(teamFoundationServerURI) + if err != nil { + return "" + } + + query := neturl.Values{} + query.Set("buildId", buildID) + query.Set("view", "logs") + query.Set("j", jobID) + + uri.Path = path.Join(uri.Path, definitionName, "_build/results") + uri.RawQuery = query.Encode() + + return uri.String() +} diff --git a/internal/attestation/crafter/runners/azurepipeline_test.go b/internal/attestation/crafter/runners/azurepipeline_test.go new file mode 100644 index 000000000..eabbffd79 --- /dev/null +++ b/internal/attestation/crafter/runners/azurepipeline_test.go @@ -0,0 +1,152 @@ +// +// Copyright 2023 The Chainloop Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package runners + +import ( + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" +) + +type azurePipelineSuite struct { + suite.Suite + runner *AzurePipeline +} + +func (s *azurePipelineSuite) TestCheckEnv() { + testCases := []struct { + name string + env map[string]string + want bool + }{ + { + name: "empty", + env: map[string]string{}, + want: false, + }, + { + name: "missing CI", + env: map[string]string{ + "CI_JOB_URL": "chainloop/chainloop", + }, + want: false, + }, + { + name: "missing JOB_URL", + env: map[string]string{ + "TF_BUILD": "true", + }, + want: false, + }, + { + name: "all present", + env: map[string]string{ + "TF_BUILD": "true", + "BUILD_BUILDURI": "chainloop/chainloop", + }, + want: true, + }, + } + + for _, tc := range testCases { + s.T().Run(tc.name, func(t *testing.T) { + os.Unsetenv("TF_BUILD") + os.Unsetenv("BUILD_BUILDURI") + + for k, v := range tc.env { + t.Setenv(k, v) + } + + s.Equal(tc.want, s.runner.CheckEnv()) + }) + } +} + +func (s *azurePipelineSuite) TestListEnvVars() { + assert.Equal(s.T(), []string{ + "BUILD_REQUESTEDFOREMAIL", + "BUILD_REQUESTEDFOR", + "BUILD_REPOSITORY_URI", + "BUILD_REPOSITORY_NAME", + "BUILD_BUILDID", + "BUILD_BUILDNUMBER", + "BUILD_BUILDURI", + "BUILD_REASON", + "AGENT_VERSION", + "TF_BUILD", + }, s.runner.ListEnvVars()) +} + +func (s *azurePipelineSuite) TestResolveEnvVars() { + s.Equal(map[string]string{ + "AGENT_VERSION": "3.220.5", + "BUILD_BUILDID": "6", + "BUILD_BUILDNUMBER": "20230726.5", + "BUILD_BUILDURI": "vstfs:///Build/Build/6", + "BUILD_REASON": "IndividualCI", + "BUILD_REPOSITORY_NAME": "chainloop-tests", + "BUILD_REPOSITORY_URI": "https://chainlooptest@dev.azure.com/chainloop-test/chainloop-tests/_git/chainloop-tests", + "BUILD_REQUESTEDFOR": "Jan Kowalsky", + "BUILD_REQUESTEDFOREMAIL": "jan@kowalscy.onmicrosoft.com", + "TF_BUILD": "True", + }, s.runner.ResolveEnvVars()) +} + +func (s *azurePipelineSuite) TestRunURI() { + s.Equal("https://dev.azure.com/chainloop-test/chainloop-tests/_build/results?buildId=6&j=12f1170f-0000-0000-20dd-22fc7dff55f9&view=logs", s.runner.RunURI()) +} + +func (s *azurePipelineSuite) TestRunnerName() { + s.Equal("azure-pipeline", s.runner.String()) +} + +// Run before each test +func (s *azurePipelineSuite) SetupTest() { + s.runner = NewAzurePipeline() + t := s.T() + t.Setenv("TF_BUILD", "True") + t.Setenv("BUILD_REPOSITORY_ID", "5e5bf8eb-0000-0000-801b-0a5bc4b4011a") + t.Setenv("BUILD_REPOSITORY_URI", "https://chainlooptest@dev.azure.com/chainloop-test/chainloop-tests/_git/chainloop-tests") + t.Setenv("BUILD_REPOSITORY_NAME", "chainloop-tests") + t.Setenv("BUILD_SOURCEVERSIONAUTHOR", "Jan Kowalsky") + t.Setenv("BUILD_REQUESTEDFOR", "Jan Kowalsky") + t.Setenv("BUILD_REQUESTEDFOREMAIL", "jan@kowalscy.onmicrosoft.com") + t.Setenv("BUILD_SOURCEVERSION", "612a6f172be5fcca249b02ae0c3bbab09d59a0f5") + t.Setenv("BUILD_BUILDID", "6") + t.Setenv("BUILD_BUILDNUMBER", "20230726.5") + t.Setenv("BUILD_BUILDURI", "vstfs:///Build/Build/6") + t.Setenv("BUILD_CONTAINERID", "170183") + t.Setenv("ENDPOINT_URL_SYSTEMVSSCONNECTION", "https://dev.azure.com/chainloop-test/") + t.Setenv("BUILD_REASON", "IndividualCI") + t.Setenv("AGENT_VERSION", "3.220.5") + t.Setenv("SYSTEM_COLLECTIONID", "e2dadf5b-9a6d-0000-0000-89ad0786f16e") + t.Setenv("SYSTEM_TEAMPROJECTID", "e0730109-da00-0000-0000-80abab2033a2") + t.Setenv("SYSTEM_TEAMFOUNDATIONSERVERURI", "https://dev.azure.com/chainloop-test/") + t.Setenv("SYSTEM_DEFINITIONNAME", "chainloop-tests") + t.Setenv("SYSTEM_STAGEID", "96ac2280-0000-0000-99de-dd2da759617d") + t.Setenv("BUILD_REQUESTEDFORID", "4962d626-0000-0000-ae45-95ea268aa3e8") + t.Setenv("SYSTEM_JOBID", "12f1170f-0000-0000-20dd-22fc7dff55f9") + t.Setenv("AGENT_ID", "9") + t.Setenv("SYSTEM_ISAZUREVM", "0") + t.Setenv("SYSTEM_TASKINSTANCEID", "f8ed7bd8-0000-0000-9385-7fc29a8b5b7b") +} + +// Run the tests +func TestAzurePipelineRunner(t *testing.T) { + suite.Run(t, new(azurePipelineSuite)) +}