diff --git a/gitops-promoter/crds/crds.yaml b/gitops-promoter/crds/crds.yaml index 065871f3..769c7830 100644 --- a/gitops-promoter/crds/crds.yaml +++ b/gitops-promoter/crds/crds.yaml @@ -13,7 +13,15 @@ spec: singular: argocdcommitstatus scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .spec.promotionStrategyRef.name + name: Strategy + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + name: v1alpha1 schema: openAPIV3Schema: description: ArgoCDCommitStatus is the Schema for the argocdcommitstatuses API. @@ -137,10 +145,13 @@ spec: description: ApplicationsSelected represents the Argo CD applications that are selected by the commit status. properties: clusterName: - description: ClusterName is the name of the cluster that the application manifest is deployed to. + description: |- + ClusterName is the name of the cluster that the application manifest is deployed to. An empty string indicates + the local cluster. type: string environment: description: Environment is the syncSource.targetBranch of the Argo CD application (in effect, its environment). + minLength: 1 type: string lastTransitionTime: description: LastTransitionTime is the last time the phase transitioned. @@ -160,6 +171,7 @@ spec: type: string required: - clusterName + - environment - name - namespace - phase @@ -254,6 +266,12 @@ spec: - jsonPath: .status.proposed.dry.sha name: Proposed Dry Sha type: string + - jsonPath: .status.pullRequest.state + name: PR State + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string name: v1alpha1 schema: openAPIV3Schema: @@ -362,7 +380,11 @@ spec: type: string url: description: Url is the URL of the commit status + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) required: - key - phase @@ -406,7 +428,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -418,7 +444,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -461,7 +491,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -473,7 +507,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -574,7 +612,11 @@ spec: type: string url: description: Url is the URL of the commit status + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) required: - key - phase @@ -618,7 +660,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -630,7 +676,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -673,7 +723,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -685,7 +739,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -719,7 +777,11 @@ spec: type: string url: description: Url is the URL of the commit status + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) required: - key - phase @@ -760,7 +822,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -772,7 +838,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -791,6 +861,14 @@ spec: description: PRCreationTime is the time when the pull request was created. format: date-time type: string + prMergeTime: + description: |- + PRMergeTime is the time when the pull request was merged. This time can vary slightly from the actual merge time because + it is the time when the ChangeTransferPolicy controller sets the pull requests spec to merge. In the future we plan on making + this time more accurate by fetching the actual merge time from the SCM via the webhook this would then be updated in the git note + for that commit. + format: date-time + type: string state: description: State is the state of the pull request. enum: @@ -800,7 +878,11 @@ spec: type: string url: description: Url is the URL of the pull request. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) type: object type: object type: array @@ -827,7 +909,11 @@ spec: type: string url: description: Url is the URL of the commit status + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) required: - key - phase @@ -871,7 +957,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -883,7 +973,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -926,7 +1020,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -938,7 +1036,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -957,6 +1059,14 @@ spec: description: PRCreationTime is the time when the pull request was created. format: date-time type: string + prMergeTime: + description: |- + PRMergeTime is the time when the pull request was merged. This time can vary slightly from the actual merge time because + it is the time when the ChangeTransferPolicy controller sets the pull requests spec to merge. In the future we plan on making + this time more accurate by fetching the actual merge time from the SCM via the webhook this would then be updated in the git note + for that commit. + format: date-time + type: string state: description: State is the state of the pull request. enum: @@ -966,7 +1076,11 @@ spec: type: string url: description: Url is the URL of the pull request. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) type: object type: object type: object @@ -990,7 +1104,11 @@ spec: singular: clusterscmprovider scope: Cluster versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + name: v1alpha1 schema: openAPIV3Schema: description: ClusterScmProvider is the Schema for the clusterscmproviders API. @@ -1083,8 +1201,71 @@ spec: type: object x-kubernetes-map-type: atomic type: object + x-kubernetes-validations: + - message: exactly one of the fields in [github gitlab forgejo fake] must be set + rule: '[has(self.github),has(self.gitlab),has(self.forgejo),has(self.fake)].filter(x,x==true).size() == 1' status: description: ScmProviderStatus defines the observed state of ScmProvider + properties: + conditions: + description: Conditions Represents the observations of the current state. + items: + description: Condition contains details for one aspect of the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object type: object served: true @@ -1108,12 +1289,23 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: - - jsonPath: .status.sha - name: Sha + - jsonPath: .metadata.labels['promoter\.argoproj\.io/commit-status'] + name: Key type: string - jsonPath: .status.phase name: Phase type: string + - jsonPath: .status.sha + name: Sha + type: string + - jsonPath: .spec.name + name: Name + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + priority: 1 + type: string name: v1alpha1 schema: openAPIV3Schema: @@ -1161,11 +1353,17 @@ spec: - failure type: string sha: + maxLength: 64 + minLength: 1 + pattern: ^[a-fA-F0-9]+$ type: string url: description: Url is a URL that the user can follow to see more details about the status - pattern: ^https?://.*$ + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) required: - description - gitRepositoryRef @@ -1245,6 +1443,7 @@ spec: - pending - success - failure + - "" type: string sha: type: string @@ -2313,165 +2512,432 @@ spec: - template - workQueue type: object - required: - - argocdCommitStatus - - changeTransferPolicy - - commitStatus - - promotionStrategy - - pullRequest - type: object - status: - description: |- - ControllerConfigurationStatus defines the observed state of ControllerConfiguration. - - Currently, this resource does not maintain any status information as it is a configuration-only - resource. Status fields may be added in the future to track configuration validation or - controller health metrics. - type: object - type: object - served: true - storage: true - subresources: - status: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.19.0 - name: gitrepositories.promoter.argoproj.io -spec: - group: promoter.argoproj.io - names: - kind: GitRepository - listKind: GitRepositoryList - plural: gitrepositories - singular: gitrepository - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: GitRepository is the Schema for the gitrepositories API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: GitRepositorySpec defines the desired state of GitRepository - properties: - fake: - description: FakeRepo is a placeholder for a repository in the fake SCM provider, used for testing purposes. - properties: - name: - description: Name is the name of the repository. - type: string - owner: - description: Owner is the owner of the repository. - type: string - required: - - name - - owner - type: object - forgejo: - description: ForgejoRepo is a repository in Forgejo, identified by its owner and name. - properties: - name: - description: Name is the name of the repository. - type: string - owner: - description: Owner is the owner of the repository. - type: string - required: - - name - - owner - type: object - github: - description: GitHubRepo is a repository in GitHub, identified by its owner and name. - properties: - name: - description: Name is the name of the repository. - maxLength: 100 - pattern: ^[a-zA-Z0-9_\-\.]+$ - type: string - owner: - description: Owner is the owner of the repository, which can be a user or an organization. - maxLength: 39 - pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-]*$ - type: string - required: - - name - - owner - type: object - gitlab: - description: GitLabRepo is a repository in GitLab, identified by its namespace, name, and project ID. - properties: - name: - description: Name is the project slug of the repository. - pattern: ^[a-zA-Z0-9_\-\/.]+$ - type: string - namespace: - description: Namespace is the user, group or group with subgroup (e.g. group/subgroup). - pattern: ^[a-zA-Z0-9_\-\/.]+$ - type: string - projectId: - description: ProjectID is the ID of the project in GitLab. - type: integer - required: - - name - - namespace - - projectId - type: object - scmProviderRef: - description: ScmProviderObjectReference is a reference to a SCM provider object. + timedCommitStatus: + description: |- + TimedCommitStatus contains the configuration for the TimedCommitStatus controller, + including WorkQueue settings that control reconciliation behavior. properties: - kind: - default: ScmProvider - description: Kind is the type of resource being referenced - enum: - - ScmProvider - - ClusterScmProvider - type: string - name: - description: Name is the name of the resource being referenced - type: string - required: - - kind - - name - type: object - required: - - scmProviderRef - type: object - status: - description: GitRepositoryStatus defines the observed state of GitRepository - type: object - type: object - served: true - storage: true - subresources: - status: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.19.0 - name: promotionstrategies.promoter.argoproj.io -spec: + workQueue: + description: |- + WorkQueue contains the work queue configuration for the TimedCommitStatus controller. + This includes requeue duration, maximum concurrent reconciles, and rate limiter settings. + properties: + maxConcurrentReconciles: + description: |- + MaxConcurrentReconciles defines the maximum number of concurrent reconcile operations + that can run for this controller. Higher values increase throughput but consume more + resources. Must be at least 1. + type: integer + rateLimiter: + description: |- + RateLimiter defines the rate limiting strategy for the controller's work queue. + Rate limiting controls how quickly failed reconciliations are retried and helps + prevent overwhelming external APIs or systems. + properties: + bucket: + description: |- + Bucket rate limiter uses a token bucket algorithm to control request rate. + Allows bursts while maintaining an average rate limit. + properties: + bucket: + description: |- + Bucket is the maximum number of tokens that can be accumulated in the bucket. + This defines the maximum burst size - how many operations can occur in rapid + succession before rate limiting takes effect. Must be non-negative. + type: integer + qps: + description: |- + Qps (queries per second) is the rate at which tokens are added to the bucket. + This defines the sustained rate limit for operations. Must be non-negative. + type: integer + required: + - bucket + - qps + type: object + exponentialFailure: + description: |- + ExponentialFailure rate limiter increases delay exponentially with each failure. + Standard approach for backing off when operations fail repeatedly. + properties: + baseDelay: + description: |- + BaseDelay is the initial delay after the first failure. Subsequent failures will exponentially + increase this delay (2x, 4x, 8x, etc.) until MaxDelay is reached. + Format follows Go's time.Duration syntax (e.g., "1s" for 1 second). + type: string + maxDelay: + description: |- + MaxDelay is the maximum delay between retry attempts. Once the exponential backoff reaches + this value, all subsequent retries will use this delay. + Format follows Go's time.Duration syntax (e.g., "1m" for 1 minute). + type: string + required: + - baseDelay + - maxDelay + type: object + fastSlow: + description: |- + FastSlow rate limiter provides fast retries initially, then switches to slow retries. + Useful for quickly retrying transient errors while backing off for persistent failures. + properties: + fastDelay: + description: |- + FastDelay is the delay used for the first MaxFastAttempts retry attempts. + Format follows Go's time.Duration syntax (e.g., "100ms" for 100 milliseconds). + type: string + maxFastAttempts: + description: |- + MaxFastAttempts is the number of retry attempts that use FastDelay before switching to SlowDelay. + Must be at least 1. + type: integer + slowDelay: + description: |- + SlowDelay is the delay used for retry attempts after MaxFastAttempts have been exhausted. + Format follows Go's time.Duration syntax (e.g., "10s" for 10 seconds). + type: string + required: + - fastDelay + - maxFastAttempts + - slowDelay + type: object + maxOf: + description: |- + MaxOf allows combining multiple rate limiters, where the maximum delay from all + limiters is used. This enables sophisticated rate limiting that respects multiple + constraints simultaneously (e.g., both per-item exponential backoff and global rate limits). + items: + description: |- + RateLimiterTypes defines the different algorithms available for rate limiting. + + Exactly one of the three rate limiter types must be specified: + - FastSlow: Quick retry for transient errors, then slower retry for persistent failures + - ExponentialFailure: Standard exponential backoff for repeated failures + - Bucket: Token bucket algorithm for controlling overall request rate + + See https://pkg.go.dev/k8s.io/client-go/util/workqueue for implementation details. + properties: + bucket: + description: |- + Bucket rate limiter uses a token bucket algorithm to control request rate. + Allows bursts while maintaining an average rate limit. + properties: + bucket: + description: |- + Bucket is the maximum number of tokens that can be accumulated in the bucket. + This defines the maximum burst size - how many operations can occur in rapid + succession before rate limiting takes effect. Must be non-negative. + type: integer + qps: + description: |- + Qps (queries per second) is the rate at which tokens are added to the bucket. + This defines the sustained rate limit for operations. Must be non-negative. + type: integer + required: + - bucket + - qps + type: object + exponentialFailure: + description: |- + ExponentialFailure rate limiter increases delay exponentially with each failure. + Standard approach for backing off when operations fail repeatedly. + properties: + baseDelay: + description: |- + BaseDelay is the initial delay after the first failure. Subsequent failures will exponentially + increase this delay (2x, 4x, 8x, etc.) until MaxDelay is reached. + Format follows Go's time.Duration syntax (e.g., "1s" for 1 second). + type: string + maxDelay: + description: |- + MaxDelay is the maximum delay between retry attempts. Once the exponential backoff reaches + this value, all subsequent retries will use this delay. + Format follows Go's time.Duration syntax (e.g., "1m" for 1 minute). + type: string + required: + - baseDelay + - maxDelay + type: object + fastSlow: + description: |- + FastSlow rate limiter provides fast retries initially, then switches to slow retries. + Useful for quickly retrying transient errors while backing off for persistent failures. + properties: + fastDelay: + description: |- + FastDelay is the delay used for the first MaxFastAttempts retry attempts. + Format follows Go's time.Duration syntax (e.g., "100ms" for 100 milliseconds). + type: string + maxFastAttempts: + description: |- + MaxFastAttempts is the number of retry attempts that use FastDelay before switching to SlowDelay. + Must be at least 1. + type: integer + slowDelay: + description: |- + SlowDelay is the delay used for retry attempts after MaxFastAttempts have been exhausted. + Format follows Go's time.Duration syntax (e.g., "10s" for 10 seconds). + type: string + required: + - fastDelay + - maxFastAttempts + - slowDelay + type: object + type: object + x-kubernetes-validations: + - message: at most one of the fields in [fastSlow exponentialFailure bucket] may be set + rule: '[has(self.fastSlow),has(self.exponentialFailure),has(self.bucket)].filter(x,x==true).size() <= 1' + maxItems: 3 + type: array + type: object + x-kubernetes-validations: + - message: at most one of the fields in [fastSlow exponentialFailure bucket maxOf] may be set + rule: '[has(self.fastSlow),has(self.exponentialFailure),has(self.bucket),has(self.maxOf)].filter(x,x==true).size() <= 1' + - message: at most one of the fields in [fastSlow exponentialFailure bucket] may be set + rule: '[has(self.fastSlow),has(self.exponentialFailure),has(self.bucket)].filter(x,x==true).size() <= 1' + requeueDuration: + description: |- + RequeueDuration specifies how frequently resources should be requeued for automatic reconciliation. + This creates a periodic reconciliation loop that ensures the desired state is maintained even + without external triggers. Format follows Go's time.Duration syntax (e.g., "5m" for 5 minutes). + type: string + required: + - maxConcurrentReconciles + - rateLimiter + - requeueDuration + type: object + required: + - workQueue + type: object + required: + - argocdCommitStatus + - changeTransferPolicy + - commitStatus + - promotionStrategy + - pullRequest + - timedCommitStatus + type: object + status: + description: |- + ControllerConfigurationStatus defines the observed state of ControllerConfiguration. + + Currently, this resource does not maintain any status information as it is a configuration-only + resource. Status fields may be added in the future to track configuration validation or + controller health metrics. + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.19.0 + name: gitrepositories.promoter.argoproj.io +spec: + group: promoter.argoproj.io + names: + kind: GitRepository + listKind: GitRepositoryList + plural: gitrepositories + singular: gitrepository + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.scmProviderRef.name + name: Provider + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: GitRepository is the Schema for the gitrepositories API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: GitRepositorySpec defines the desired state of GitRepository + properties: + fake: + description: FakeRepo is a placeholder for a repository in the fake SCM provider, used for testing purposes. + properties: + name: + description: Name is the name of the repository. + type: string + owner: + description: Owner is the owner of the repository. + type: string + required: + - name + - owner + type: object + forgejo: + description: ForgejoRepo is a repository in Forgejo, identified by its owner and name. + properties: + name: + description: Name is the name of the repository. + type: string + owner: + description: Owner is the owner of the repository. + type: string + required: + - name + - owner + type: object + github: + description: GitHubRepo is a repository in GitHub, identified by its owner and name. + properties: + name: + description: Name is the name of the repository. + maxLength: 100 + pattern: ^[a-zA-Z0-9_\-\.]+$ + type: string + owner: + description: Owner is the owner of the repository, which can be a user or an organization. + maxLength: 39 + pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-]*$ + type: string + required: + - name + - owner + type: object + gitlab: + description: GitLabRepo is a repository in GitLab, identified by its namespace, name, and project ID. + properties: + name: + description: Name is the project slug of the repository. + pattern: ^[a-zA-Z0-9_\-\/.]+$ + type: string + namespace: + description: Namespace is the user, group or group with subgroup (e.g. group/subgroup). + pattern: ^[a-zA-Z0-9_\-\/.]+$ + type: string + projectId: + description: ProjectID is the ID of the project in GitLab. + type: integer + required: + - name + - namespace + - projectId + type: object + scmProviderRef: + description: ScmProviderObjectReference is a reference to a SCM provider object. + properties: + kind: + default: ScmProvider + description: Kind is the type of resource being referenced + enum: + - ScmProvider + - ClusterScmProvider + type: string + name: + description: Name is the name of the resource being referenced + type: string + required: + - kind + - name + type: object + required: + - scmProviderRef + type: object + x-kubernetes-validations: + - message: exactly one of the fields in [github gitlab forgejo fake] must be set + rule: '[has(self.github),has(self.gitlab),has(self.forgejo),has(self.fake)].filter(x,x==true).size() == 1' + status: + description: GitRepositoryStatus defines the observed state of GitRepository + properties: + conditions: + description: Conditions Represents the observations of the current state. + items: + description: Condition contains details for one aspect of the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.19.0 + name: promotionstrategies.promoter.argoproj.io +spec: group: promoter.argoproj.io names: kind: PromotionStrategy @@ -2481,11 +2947,8 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: - - jsonPath: .status.active.dry.sha - name: Active Dry Sha - type: string - - jsonPath: .status.proposed.dry.sha - name: Proposed Dry Sha + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready type: string name: v1alpha1 schema: @@ -2727,7 +3190,11 @@ spec: type: string url: description: Url is the URL of the commit status + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) required: - key - phase @@ -2771,7 +3238,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -2783,7 +3254,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -2826,7 +3301,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -2838,7 +3317,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -2883,7 +3366,11 @@ spec: type: string url: description: Url is the URL of the commit status + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) required: - key - phase @@ -2927,7 +3414,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -2939,7 +3430,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -2982,7 +3477,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -2994,7 +3493,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -3028,7 +3531,11 @@ spec: type: string url: description: Url is the URL of the commit status + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) required: - key - phase @@ -3069,7 +3576,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -3081,7 +3592,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -3100,6 +3615,14 @@ spec: description: PRCreationTime is the time when the pull request was created. format: date-time type: string + prMergeTime: + description: |- + PRMergeTime is the time when the pull request was merged. This time can vary slightly from the actual merge time because + it is the time when the ChangeTransferPolicy controller sets the pull requests spec to merge. In the future we plan on making + this time more accurate by fetching the actual merge time from the SCM via the webhook this would then be updated in the git note + for that commit. + format: date-time + type: string state: description: State is the state of the pull request. enum: @@ -3109,7 +3632,11 @@ spec: type: string url: description: Url is the URL of the pull request. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) type: object type: object type: array @@ -3153,7 +3680,11 @@ spec: type: string url: description: Url is the URL of the commit status + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) required: - key - phase @@ -3197,7 +3728,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -3209,7 +3744,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -3252,7 +3791,11 @@ spec: type: string repoURL: description: RepoURL is the URL of the repository where the commit is located. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the commit hash. type: string @@ -3264,7 +3807,11 @@ spec: type: array repoURL: description: RepoURL is the URL of the repository where the commit is located + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) sha: description: Sha is the SHA of the commit in the branch type: string @@ -3283,6 +3830,14 @@ spec: description: PRCreationTime is the time when the pull request was created. format: date-time type: string + prMergeTime: + description: |- + PRMergeTime is the time when the pull request was merged. This time can vary slightly from the actual merge time because + it is the time when the ChangeTransferPolicy controller sets the pull requests spec to merge. In the future we plan on making + this time more accurate by fetching the actual merge time from the SCM via the webhook this would then be updated in the git note + for that commit. + format: date-time + type: string state: description: State is the state of the pull request. enum: @@ -3292,7 +3847,11 @@ spec: type: string url: description: Url is the URL of the pull request. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) type: object required: - active @@ -3328,12 +3887,27 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: - - jsonPath: .status.id - name: ID - type: string - jsonPath: .status.state name: State type: string + - jsonPath: .status.ID + name: ID + type: string + - jsonPath: .spec.sourceBranch + name: Source + priority: 1 + type: string + - jsonPath: .spec.targetBranch + name: Target + priority: 1 + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + - jsonPath: .status.url + name: URL + priority: 1 + type: string name: v1alpha1 schema: openAPIV3Schema: @@ -3380,6 +3954,14 @@ spec: required: - name type: object + mergeSha: + description: |- + MergeSha is the commit SHA that the head branch must match before the PR can be merged. + This prevents a race condition where a PR is merged with a different commit than intended. + maxLength: 64 + minLength: 1 + pattern: ^[a-fA-F0-9]+$ + type: string sourceBranch: description: SourceBranch is the base the git reference that we are merging into Head ---> Base type: string @@ -3388,7 +3970,9 @@ spec: rule: self == oldSelf state: default: open - description: State of the merge request closed/merged/open + description: |- + State of the pull request (closed, merged, or open). Must always be "open" when creating a new pull request. + This value may not be changed to "closed" or "merged" unless the pull request status.id is set. enum: - closed - merged @@ -3405,6 +3989,7 @@ spec: type: string required: - gitRepositoryRef + - mergeSha - sourceBranch - state - targetBranch @@ -3489,9 +4074,16 @@ spec: type: string url: description: Url is the URL of the pull request. + pattern: ^(https?://.*)?$ type: string + x-kubernetes-validations: + - message: must be a valid URL + rule: self == '' || isURL(self) type: object type: object + x-kubernetes-validations: + - message: Cannot transition to 'closed' or 'merged' state when status.id is empty + rule: self.spec.state == 'open' || has(self.status.id) && self.status.id != "" served: true storage: true subresources: @@ -3565,7 +4157,11 @@ spec: singular: scmprovider scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + name: v1alpha1 schema: openAPIV3Schema: description: ScmProvider is the Schema for the scmproviders API @@ -3658,9 +4254,264 @@ spec: type: object x-kubernetes-map-type: atomic type: object + x-kubernetes-validations: + - message: exactly one of the fields in [github gitlab forgejo fake] must be set + rule: '[has(self.github),has(self.gitlab),has(self.forgejo),has(self.fake)].filter(x,x==true).size() == 1' status: description: ScmProviderStatus defines the observed state of ScmProvider + properties: + conditions: + description: Conditions Represents the observations of the current state. + items: + description: Condition contains details for one aspect of the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.19.0 + name: timedcommitstatuses.promoter.argoproj.io +spec: + group: promoter.argoproj.io + names: + kind: TimedCommitStatus + listKind: TimedCommitStatusList + plural: timedcommitstatuses + singular: timedcommitstatus + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.promotionStrategyRef.name + name: Strategy + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: Ready + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: TimedCommitStatus is the Schema for the timedcommitstatuses API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec defines the desired state of TimedCommitStatus + properties: + environments: + items: + description: TimedCommitStatusEnvironments defines the branch/environment and duration to wait before reporting the gate as success. + properties: + branch: + description: Branch is the name of the branch/environment you want to gate for the configured duration. + type: string + duration: + description: |- + Duration is the time duration to wait before considering the commit status as success. + The duration should be in a format accepted by Go's time.ParseDuration function, e.g., "5m", "1h30m". + type: string + required: + - branch + - duration + type: object + type: array + promotionStrategyRef: + description: PromotionStrategyRef is a reference to the promotion strategy that this timed commit status applies to. + properties: + name: + description: Name is the name of the object to refer to. + type: string + required: + - name + type: object + required: + - environments + - promotionStrategyRef + type: object + status: + description: status defines the observed state of TimedCommitStatus + properties: + conditions: + description: Conditions represent the latest available observations of an object's state + items: + description: Condition contains details for one aspect of the current state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + environments: + description: Environments holds the status of each environment being tracked. + items: + description: TimedCommitStatusEnvironmentsStatus defines the observed timing status for a specific environment. + properties: + atMostDurationRemaining: + description: |- + AtMostDurationRemaining is the maximum amount of time remaining until the gate is satisfied. + This is calculated at reconciliation time. When the gate is satisfied (phase=success), this will be 0. + type: string + branch: + description: Branch is the name of the branch/environment. + type: string + commitTime: + description: CommitTime is when the commit was deployed to the active environment. + format: date-time + type: string + phase: + description: Phase represents the current phase of the timed gate. + enum: + - pending + - success + type: string + requiredDuration: + description: |- + RequiredDuration is the duration that must elapse before promotion is allowed. + If this is updated in the spec with a pending time. The new duration will be calculated from the original CommitTime. + Allowing you to extend the duration of an already deployed commit, if the time has not yet elapsed. + type: string + sha: + description: Sha is the commit SHA being tracked for this environment. + type: string + required: + - atMostDurationRemaining + - branch + - commitTime + - phase + - requiredDuration + - sha + type: object + type: array + x-kubernetes-list-map-keys: + - branch + x-kubernetes-list-type: map type: object + required: + - spec type: object served: true storage: true diff --git a/gitops-promoter/kcl.mod b/gitops-promoter/kcl.mod index f94ec216..8c46c138 100644 --- a/gitops-promoter/kcl.mod +++ b/gitops-promoter/kcl.mod @@ -1,7 +1,7 @@ [package] name = "gitops-promoter" edition = "v0.11.2" -version = "v0.14.0" +version = "v0.18.3" [dependencies] k8s = "1.32.4" diff --git a/gitops-promoter/update.sh b/gitops-promoter/update.sh index a36bfc8d..ae821258 100755 --- a/gitops-promoter/update.sh +++ b/gitops-promoter/update.sh @@ -4,7 +4,7 @@ set -o errexit set -o nounset set -eoux pipefail -VERSION="v0.14.0" +VERSION="v0.18.3" rm -rf v* mkdir -p crds diff --git a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_argo_c_d_commit_status.k b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_argo_c_d_commit_status.k index 8e09385f..725b0e7b 100644 --- a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_argo_c_d_commit_status.k +++ b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_argo_c_d_commit_status.k @@ -199,8 +199,9 @@ schema PromoterArgoprojIoV1alpha1ArgoCDCommitStatusStatusApplicationsSelectedIte Attributes ---------- clusterName : str, default is Undefined, required - ClusterName is the name of the cluster that the application manifest is deployed to. - environment : str, default is Undefined, optional + ClusterName is the name of the cluster that the application manifest is deployed to. An empty string indicates + the local cluster. + environment : str, default is Undefined, required Environment is the syncSource.targetBranch of the Argo CD application (in effect, its environment). lastTransitionTime : str, default is Undefined, optional LastTransitionTime is the last time the phase transitioned. @@ -217,7 +218,7 @@ schema PromoterArgoprojIoV1alpha1ArgoCDCommitStatusStatusApplicationsSelectedIte clusterName: str - environment?: str + environment: str lastTransitionTime?: str @@ -230,6 +231,10 @@ schema PromoterArgoprojIoV1alpha1ArgoCDCommitStatusStatusApplicationsSelectedIte sha: str + check: + len(environment) >= 1 + + schema PromoterArgoprojIoV1alpha1ArgoCDCommitStatusStatusConditionsItems0: r""" Condition contains details for one aspect of the current state of this API Resource. diff --git a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_change_transfer_policy.k b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_change_transfer_policy.k index 9cdd2b77..547f149d 100644 --- a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_change_transfer_policy.k +++ b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_change_transfer_policy.k @@ -207,6 +207,7 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusActiveCommitStatusesI len(key) <= 63 len(key) >= 1 _regex_match(str(key), r"([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]") + _regex_match(str(url), r"^(https?://.*)?$") if url schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusActiveDry: @@ -247,6 +248,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusActiveDry: subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusActiveDryReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -296,6 +301,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusActiveDryReferencesIt subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusActiveHydrated: r""" Hydrated is the hydrated state of the branch, which is the commit that is currently being worked on. @@ -334,6 +343,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusActiveHydrated: subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusActiveHydratedReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -383,6 +396,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusActiveHydratedReferen subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusConditionsItems0: r""" Condition contains details for one aspect of the current state of this API Resource. @@ -505,6 +522,7 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0ActiveCo len(key) <= 63 len(key) >= 1 _regex_match(str(key), r"([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]") + _regex_match(str(url), r"^(https?://.*)?$") if url schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0ActiveDry: @@ -545,6 +563,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0ActiveDr subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0ActiveDryReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -594,6 +616,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0ActiveDr subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0ActiveHydrated: r""" Hydrated is the hydrated state of the branch, which is the commit that is currently being worked on. @@ -632,6 +658,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0ActiveHy subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0ActiveHydratedReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -681,6 +711,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0ActiveHy subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0Proposed: r""" Proposed is the state of the proposed branch at the time the PR was merged. @@ -726,6 +760,7 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0Proposed len(key) <= 63 len(key) >= 1 _regex_match(str(key), r"([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]") + _regex_match(str(url), r"^(https?://.*)?$") if url schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0ProposedHydrated: @@ -766,6 +801,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0Proposed subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0ProposedHydratedReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -815,6 +854,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0Proposed subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0PullRequest: r""" PullRequest is the state of the pull request that was created for this ChangeTransferPolicy. @@ -825,6 +868,11 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0PullRequ ID is the unique identifier of the pull request, set by the SCM. prCreationTime : str, default is Undefined, optional PRCreationTime is the time when the pull request was created. + prMergeTime : str, default is Undefined, optional + PRMergeTime is the time when the pull request was merged. This time can vary slightly from the actual merge time because + it is the time when the ChangeTransferPolicy controller sets the pull requests spec to merge. In the future we plan on making + this time more accurate by fetching the actual merge time from the SCM via the webhook this would then be updated in the git note + for that commit. state : str, default is Undefined, optional State is the state of the pull request. url : str, default is Undefined, optional @@ -836,11 +884,17 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusHistoryItems0PullRequ prCreationTime?: str + prMergeTime?: str + state?: "closed" | "merged" | "open" url?: str + check: + _regex_match(str(url), r"^(https?://.*)?$") if url + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusProposed: r""" Proposed is the state of the proposed branch. @@ -889,6 +943,7 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusProposedCommitStatuse len(key) <= 63 len(key) >= 1 _regex_match(str(key), r"([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]") + _regex_match(str(url), r"^(https?://.*)?$") if url schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusProposedDry: @@ -929,6 +984,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusProposedDry: subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusProposedDryReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -978,6 +1037,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusProposedDryReferences subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusProposedHydrated: r""" Hydrated is the hydrated state of the branch, which is the commit that is currently being worked on. @@ -1016,6 +1079,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusProposedHydrated: subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusProposedHydratedReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -1065,6 +1132,10 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusProposedHydratedRefer subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusPullRequest: r""" PullRequest is the state of the pull request that was created for this ChangeTransferPolicy. @@ -1075,6 +1146,11 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusPullRequest: ID is the unique identifier of the pull request, set by the SCM. prCreationTime : str, default is Undefined, optional PRCreationTime is the time when the pull request was created. + prMergeTime : str, default is Undefined, optional + PRMergeTime is the time when the pull request was merged. This time can vary slightly from the actual merge time because + it is the time when the ChangeTransferPolicy controller sets the pull requests spec to merge. In the future we plan on making + this time more accurate by fetching the actual merge time from the SCM via the webhook this would then be updated in the git note + for that commit. state : str, default is Undefined, optional State is the state of the pull request. url : str, default is Undefined, optional @@ -1086,8 +1162,14 @@ schema PromoterArgoprojIoV1alpha1ChangeTransferPolicyStatusPullRequest: prCreationTime?: str + prMergeTime?: str + state?: "closed" | "merged" | "open" url?: str + check: + _regex_match(str(url), r"^(https?://.*)?$") if url + + diff --git a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_cluster_scm_provider.k b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_cluster_scm_provider.k index 8f838f49..dc40c7d6 100644 --- a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_cluster_scm_provider.k +++ b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_cluster_scm_provider.k @@ -2,7 +2,9 @@ This file was generated by the KCL auto-gen tool. DO NOT EDIT. Editing this file might prove futile when you re-run the KCL auto-gen generate command. """ +import regex import k8s.apimachinery.pkg.apis.meta.v1 +_regex_match = regex.match schema ClusterScmProvider: @@ -19,8 +21,8 @@ schema ClusterScmProvider: metadata spec : PromoterArgoprojIoV1alpha1ClusterScmProviderSpec, default is Undefined, optional spec - status : any, default is Undefined, optional - ScmProviderStatus defines the observed state of ScmProvider + status : PromoterArgoprojIoV1alpha1ClusterScmProviderStatus, default is Undefined, optional + status """ @@ -32,7 +34,7 @@ schema ClusterScmProvider: spec?: PromoterArgoprojIoV1alpha1ClusterScmProviderSpec - status?: any + status?: PromoterArgoprojIoV1alpha1ClusterScmProviderStatus schema PromoterArgoprojIoV1alpha1ClusterScmProviderSpec: @@ -156,3 +158,69 @@ schema PromoterArgoprojIoV1alpha1ClusterScmProviderSpecSecretRef: name?: str = "" +schema PromoterArgoprojIoV1alpha1ClusterScmProviderStatus: + r""" + ScmProviderStatus defines the observed state of ScmProvider + + Attributes + ---------- + conditions : [PromoterArgoprojIoV1alpha1ClusterScmProviderStatusConditionsItems0], default is Undefined, optional + Conditions Represents the observations of the current state. + """ + + + conditions?: [PromoterArgoprojIoV1alpha1ClusterScmProviderStatusConditionsItems0] + + +schema PromoterArgoprojIoV1alpha1ClusterScmProviderStatusConditionsItems0: + r""" + Condition contains details for one aspect of the current state of this API Resource. + + Attributes + ---------- + lastTransitionTime : str, default is Undefined, required + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + message : str, default is Undefined, required + message is a human readable message indicating details about the transition. + This may be an empty string. + observedGeneration : int, default is Undefined, optional + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + reason : str, default is Undefined, required + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + status : str, default is Undefined, required + status of the condition, one of True, False, Unknown. + $type : str, default is Undefined, required + type of condition in CamelCase or in foo.example.com/CamelCase. + """ + + + lastTransitionTime: str + + message: str + + observedGeneration?: int + + reason: str + + status: "True" | "False" | "Unknown" + + $type: str + + + check: + len(message) <= 32768 + observedGeneration >= 0 if observedGeneration not in [None, Undefined] + len(reason) <= 1024 + len(reason) >= 1 + _regex_match(str(reason), r"^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$") + len($type) <= 316 + _regex_match(str($type), r"^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$") + + diff --git a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_commit_status.k b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_commit_status.k index 862108ab..79312786 100644 --- a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_commit_status.k +++ b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_commit_status.k @@ -72,7 +72,10 @@ schema PromoterArgoprojIoV1alpha1CommitStatusSpec: check: - _regex_match(str(url), r"^https?://.*$") if url + len(sha) <= 64 + len(sha) >= 1 + _regex_match(str(sha), r"^[a-fA-F0-9]+$") + _regex_match(str(url), r"^(https?://.*)?$") if url schema PromoterArgoprojIoV1alpha1CommitStatusSpecGitRepositoryRef: @@ -110,7 +113,7 @@ schema PromoterArgoprojIoV1alpha1CommitStatusStatus: id: str - phase?: "pending" | "success" | "failure" = "pending" + phase?: "pending" | "success" | "failure" | "" = "pending" sha: str diff --git a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_controller_configuration.k b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_controller_configuration.k index d69df995..bc05435e 100644 --- a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_controller_configuration.k +++ b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_controller_configuration.k @@ -60,6 +60,8 @@ schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpec: promotion strategy pullRequest : PromoterArgoprojIoV1alpha1ControllerConfigurationSpecPullRequest, default is Undefined, required pull request + timedCommitStatus : PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatus, default is Undefined, required + timed commit status """ @@ -73,6 +75,8 @@ schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpec: pullRequest: PromoterArgoprojIoV1alpha1ControllerConfigurationSpecPullRequest + timedCommitStatus: PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatus + schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecArgocdCommitStatus: r""" @@ -1341,3 +1345,250 @@ schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecPullRequestWorkQueue slowDelay: str +schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatus: + r""" + TimedCommitStatus contains the configuration for the TimedCommitStatus controller, + including WorkQueue settings that control reconciliation behavior. + + Attributes + ---------- + workQueue : PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueue, default is Undefined, required + work queue + """ + + + workQueue: PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueue + + +schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueue: + r""" + WorkQueue contains the work queue configuration for the TimedCommitStatus controller. + This includes requeue duration, maximum concurrent reconciles, and rate limiter settings. + + Attributes + ---------- + maxConcurrentReconciles : int, default is Undefined, required + MaxConcurrentReconciles defines the maximum number of concurrent reconcile operations + that can run for this controller. Higher values increase throughput but consume more + resources. Must be at least 1. + rateLimiter : PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiter, default is Undefined, required + rate limiter + requeueDuration : str, default is Undefined, required + RequeueDuration specifies how frequently resources should be requeued for automatic reconciliation. + This creates a periodic reconciliation loop that ensures the desired state is maintained even + without external triggers. Format follows Go's time.Duration syntax (e.g., "5m" for 5 minutes). + """ + + + maxConcurrentReconciles: int + + rateLimiter: PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiter + + requeueDuration: str + + +schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiter: + r""" + RateLimiter defines the rate limiting strategy for the controller's work queue. + Rate limiting controls how quickly failed reconciliations are retried and helps + prevent overwhelming external APIs or systems. + + Attributes + ---------- + bucket : PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterBucket, default is Undefined, optional + bucket + exponentialFailure : PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterExponentialFailure, default is Undefined, optional + exponential failure + fastSlow : PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterFastSlow, default is Undefined, optional + fast slow + maxOf : [PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0], default is Undefined, optional + MaxOf allows combining multiple rate limiters, where the maximum delay from all + limiters is used. This enables sophisticated rate limiting that respects multiple + constraints simultaneously (e.g., both per-item exponential backoff and global rate limits). + """ + + + bucket?: PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterBucket + + exponentialFailure?: PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterExponentialFailure + + fastSlow?: PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterFastSlow + + maxOf?: [PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0] + + + check: + len(maxOf) <= 3 if maxOf + + +schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterBucket: + r""" + Bucket rate limiter uses a token bucket algorithm to control request rate. + Allows bursts while maintaining an average rate limit. + + Attributes + ---------- + bucket : int, default is Undefined, required + Bucket is the maximum number of tokens that can be accumulated in the bucket. + This defines the maximum burst size - how many operations can occur in rapid + succession before rate limiting takes effect. Must be non-negative. + qps : int, default is Undefined, required + Qps (queries per second) is the rate at which tokens are added to the bucket. + This defines the sustained rate limit for operations. Must be non-negative. + """ + + + bucket: int + + qps: int + + +schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterExponentialFailure: + r""" + ExponentialFailure rate limiter increases delay exponentially with each failure. + Standard approach for backing off when operations fail repeatedly. + + Attributes + ---------- + baseDelay : str, default is Undefined, required + BaseDelay is the initial delay after the first failure. Subsequent failures will exponentially + increase this delay (2x, 4x, 8x, etc.) until MaxDelay is reached. + Format follows Go's time.Duration syntax (e.g., "1s" for 1 second). + maxDelay : str, default is Undefined, required + MaxDelay is the maximum delay between retry attempts. Once the exponential backoff reaches + this value, all subsequent retries will use this delay. + Format follows Go's time.Duration syntax (e.g., "1m" for 1 minute). + """ + + + baseDelay: str + + maxDelay: str + + +schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterFastSlow: + r""" + FastSlow rate limiter provides fast retries initially, then switches to slow retries. + Useful for quickly retrying transient errors while backing off for persistent failures. + + Attributes + ---------- + fastDelay : str, default is Undefined, required + FastDelay is the delay used for the first MaxFastAttempts retry attempts. + Format follows Go's time.Duration syntax (e.g., "100ms" for 100 milliseconds). + maxFastAttempts : int, default is Undefined, required + MaxFastAttempts is the number of retry attempts that use FastDelay before switching to SlowDelay. + Must be at least 1. + slowDelay : str, default is Undefined, required + SlowDelay is the delay used for retry attempts after MaxFastAttempts have been exhausted. + Format follows Go's time.Duration syntax (e.g., "10s" for 10 seconds). + """ + + + fastDelay: str + + maxFastAttempts: int + + slowDelay: str + + +schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0: + r""" + RateLimiterTypes defines the different algorithms available for rate limiting. + + Exactly one of the three rate limiter types must be specified: + - FastSlow: Quick retry for transient errors, then slower retry for persistent failures + - ExponentialFailure: Standard exponential backoff for repeated failures + - Bucket: Token bucket algorithm for controlling overall request rate + + See https://pkg.go.dev/k8s.io/client-go/util/workqueue for implementation details. + + Attributes + ---------- + bucket : PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0Bucket, default is Undefined, optional + bucket + exponentialFailure : PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0ExponentialFailure, default is Undefined, optional + exponential failure + fastSlow : PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0FastSlow, default is Undefined, optional + fast slow + """ + + + bucket?: PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0Bucket + + exponentialFailure?: PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0ExponentialFailure + + fastSlow?: PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0FastSlow + + +schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0Bucket: + r""" + Bucket rate limiter uses a token bucket algorithm to control request rate. + Allows bursts while maintaining an average rate limit. + + Attributes + ---------- + bucket : int, default is Undefined, required + Bucket is the maximum number of tokens that can be accumulated in the bucket. + This defines the maximum burst size - how many operations can occur in rapid + succession before rate limiting takes effect. Must be non-negative. + qps : int, default is Undefined, required + Qps (queries per second) is the rate at which tokens are added to the bucket. + This defines the sustained rate limit for operations. Must be non-negative. + """ + + + bucket: int + + qps: int + + +schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0ExponentialFailure: + r""" + ExponentialFailure rate limiter increases delay exponentially with each failure. + Standard approach for backing off when operations fail repeatedly. + + Attributes + ---------- + baseDelay : str, default is Undefined, required + BaseDelay is the initial delay after the first failure. Subsequent failures will exponentially + increase this delay (2x, 4x, 8x, etc.) until MaxDelay is reached. + Format follows Go's time.Duration syntax (e.g., "1s" for 1 second). + maxDelay : str, default is Undefined, required + MaxDelay is the maximum delay between retry attempts. Once the exponential backoff reaches + this value, all subsequent retries will use this delay. + Format follows Go's time.Duration syntax (e.g., "1m" for 1 minute). + """ + + + baseDelay: str + + maxDelay: str + + +schema PromoterArgoprojIoV1alpha1ControllerConfigurationSpecTimedCommitStatusWorkQueueRateLimiterMaxOfItems0FastSlow: + r""" + FastSlow rate limiter provides fast retries initially, then switches to slow retries. + Useful for quickly retrying transient errors while backing off for persistent failures. + + Attributes + ---------- + fastDelay : str, default is Undefined, required + FastDelay is the delay used for the first MaxFastAttempts retry attempts. + Format follows Go's time.Duration syntax (e.g., "100ms" for 100 milliseconds). + maxFastAttempts : int, default is Undefined, required + MaxFastAttempts is the number of retry attempts that use FastDelay before switching to SlowDelay. + Must be at least 1. + slowDelay : str, default is Undefined, required + SlowDelay is the delay used for retry attempts after MaxFastAttempts have been exhausted. + Format follows Go's time.Duration syntax (e.g., "10s" for 10 seconds). + """ + + + fastDelay: str + + maxFastAttempts: int + + slowDelay: str + + diff --git a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_git_repository.k b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_git_repository.k index 62044b32..65df2070 100644 --- a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_git_repository.k +++ b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_git_repository.k @@ -21,8 +21,8 @@ schema GitRepository: metadata spec : PromoterArgoprojIoV1alpha1GitRepositorySpec, default is Undefined, optional spec - status : any, default is Undefined, optional - GitRepositoryStatus defines the observed state of GitRepository + status : PromoterArgoprojIoV1alpha1GitRepositoryStatus, default is Undefined, optional + status """ @@ -34,7 +34,7 @@ schema GitRepository: spec?: PromoterArgoprojIoV1alpha1GitRepositorySpec - status?: any + status?: PromoterArgoprojIoV1alpha1GitRepositoryStatus schema PromoterArgoprojIoV1alpha1GitRepositorySpec: @@ -173,3 +173,69 @@ schema PromoterArgoprojIoV1alpha1GitRepositorySpecScmProviderRef: name: str +schema PromoterArgoprojIoV1alpha1GitRepositoryStatus: + r""" + GitRepositoryStatus defines the observed state of GitRepository + + Attributes + ---------- + conditions : [PromoterArgoprojIoV1alpha1GitRepositoryStatusConditionsItems0], default is Undefined, optional + Conditions Represents the observations of the current state. + """ + + + conditions?: [PromoterArgoprojIoV1alpha1GitRepositoryStatusConditionsItems0] + + +schema PromoterArgoprojIoV1alpha1GitRepositoryStatusConditionsItems0: + r""" + Condition contains details for one aspect of the current state of this API Resource. + + Attributes + ---------- + lastTransitionTime : str, default is Undefined, required + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + message : str, default is Undefined, required + message is a human readable message indicating details about the transition. + This may be an empty string. + observedGeneration : int, default is Undefined, optional + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + reason : str, default is Undefined, required + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + status : str, default is Undefined, required + status of the condition, one of True, False, Unknown. + $type : str, default is Undefined, required + type of condition in CamelCase or in foo.example.com/CamelCase. + """ + + + lastTransitionTime: str + + message: str + + observedGeneration?: int + + reason: str + + status: "True" | "False" | "Unknown" + + $type: str + + + check: + len(message) <= 32768 + observedGeneration >= 0 if observedGeneration not in [None, Undefined] + len(reason) <= 1024 + len(reason) >= 1 + _regex_match(str(reason), r"^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$") + len($type) <= 316 + _regex_match(str($type), r"^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$") + + diff --git a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_promotion_strategy.k b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_promotion_strategy.k index dc92c611..c6462987 100644 --- a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_promotion_strategy.k +++ b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_promotion_strategy.k @@ -362,6 +362,7 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Active len(key) <= 63 len(key) >= 1 _regex_match(str(key), r"([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]") + _regex_match(str(url), r"^(https?://.*)?$") if url schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0ActiveDry: @@ -402,6 +403,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Active subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0ActiveDryReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -451,6 +456,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Active subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0ActiveHydrated: r""" Hydrated is the hydrated state of the branch, which is the commit that is currently being worked on. @@ -489,6 +498,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Active subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0ActiveHydratedReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -538,6 +551,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Active subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0HistoryItems0: r""" History describes a particular change that was promoted by the ChangeTransferPolicy. @@ -608,6 +625,7 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Histor len(key) <= 63 len(key) >= 1 _regex_match(str(key), r"([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]") + _regex_match(str(url), r"^(https?://.*)?$") if url schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0HistoryItems0ActiveDry: @@ -648,6 +666,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Histor subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0HistoryItems0ActiveDryReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -697,6 +719,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Histor subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0HistoryItems0ActiveHydrated: r""" Hydrated is the hydrated state of the branch, which is the commit that is currently being worked on. @@ -735,6 +761,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Histor subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0HistoryItems0ActiveHydratedReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -784,6 +814,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Histor subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0HistoryItems0Proposed: r""" Proposed is the state of the proposed branch at the time the PR was merged. @@ -829,6 +863,7 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Histor len(key) <= 63 len(key) >= 1 _regex_match(str(key), r"([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]") + _regex_match(str(url), r"^(https?://.*)?$") if url schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0HistoryItems0ProposedHydrated: @@ -869,6 +904,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Histor subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0HistoryItems0ProposedHydratedReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -918,6 +957,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Histor subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0HistoryItems0PullRequest: r""" PullRequest is the state of the pull request that was created for this ChangeTransferPolicy. @@ -928,6 +971,11 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Histor ID is the unique identifier of the pull request, set by the SCM. prCreationTime : str, default is Undefined, optional PRCreationTime is the time when the pull request was created. + prMergeTime : str, default is Undefined, optional + PRMergeTime is the time when the pull request was merged. This time can vary slightly from the actual merge time because + it is the time when the ChangeTransferPolicy controller sets the pull requests spec to merge. In the future we plan on making + this time more accurate by fetching the actual merge time from the SCM via the webhook this would then be updated in the git note + for that commit. state : str, default is Undefined, optional State is the state of the pull request. url : str, default is Undefined, optional @@ -939,11 +987,17 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Histor prCreationTime?: str + prMergeTime?: str + state?: "closed" | "merged" | "open" url?: str + check: + _regex_match(str(url), r"^(https?://.*)?$") if url + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0LastHealthyDryShasItems0: r""" HealthyDryShas is a list of dry commits that were observed to be healthy in the environment. @@ -1010,6 +1064,7 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Propos len(key) <= 63 len(key) >= 1 _regex_match(str(key), r"([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]") + _regex_match(str(url), r"^(https?://.*)?$") if url schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0ProposedDry: @@ -1050,6 +1105,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Propos subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0ProposedDryReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -1099,6 +1158,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Propos subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0ProposedHydrated: r""" Hydrated is the hydrated state of the branch, which is the commit that is currently being worked on. @@ -1137,6 +1200,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Propos subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0ProposedHydratedReferencesItems0: r""" RevisionReference contains a reference to a some information that is related in some way to another commit. For now, @@ -1186,6 +1253,10 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0Propos subject?: str + check: + _regex_match(str(repoURL), r"^(https?://.*)?$") if repoURL + + schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0PullRequest: r""" PullRequest is the state of the pull request that was created for this environment. @@ -1196,6 +1267,11 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0PullRe ID is the unique identifier of the pull request, set by the SCM. prCreationTime : str, default is Undefined, optional PRCreationTime is the time when the pull request was created. + prMergeTime : str, default is Undefined, optional + PRMergeTime is the time when the pull request was merged. This time can vary slightly from the actual merge time because + it is the time when the ChangeTransferPolicy controller sets the pull requests spec to merge. In the future we plan on making + this time more accurate by fetching the actual merge time from the SCM via the webhook this would then be updated in the git note + for that commit. state : str, default is Undefined, optional State is the state of the pull request. url : str, default is Undefined, optional @@ -1207,8 +1283,14 @@ schema PromoterArgoprojIoV1alpha1PromotionStrategyStatusEnvironmentsItems0PullRe prCreationTime?: str + prMergeTime?: str + state?: "closed" | "merged" | "open" url?: str + check: + _regex_match(str(url), r"^(https?://.*)?$") if url + + diff --git a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_pull_request.k b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_pull_request.k index d8df8c70..080d1350 100644 --- a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_pull_request.k +++ b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_pull_request.k @@ -49,10 +49,14 @@ schema PromoterArgoprojIoV1alpha1PullRequestSpec: Description is the description body of the pull/merge request gitRepositoryRef : PromoterArgoprojIoV1alpha1PullRequestSpecGitRepositoryRef, default is Undefined, required git repository ref + mergeSha : str, default is Undefined, required + MergeSha is the commit SHA that the head branch must match before the PR can be merged. + This prevents a race condition where a PR is merged with a different commit than intended. sourceBranch : str, default is Undefined, required SourceBranch is the base the git reference that we are merging into Head ---> Base state : str, default is "open", required - State of the merge request closed/merged/open + State of the pull request (closed, merged, or open). Must always be "open" when creating a new pull request. + This value may not be changed to "closed" or "merged" unless the pull request status.id is set. targetBranch : str, default is Undefined, required TargetBranch is the head the git reference we are merging from Head ---> Base title : str, default is Undefined, required @@ -66,6 +70,8 @@ schema PromoterArgoprojIoV1alpha1PullRequestSpec: gitRepositoryRef: PromoterArgoprojIoV1alpha1PullRequestSpecGitRepositoryRef + mergeSha: str + sourceBranch: str state: "closed" | "merged" | "open" = "open" @@ -75,6 +81,12 @@ schema PromoterArgoprojIoV1alpha1PullRequestSpec: title: str + check: + len(mergeSha) <= 64 + len(mergeSha) >= 1 + _regex_match(str(mergeSha), r"^[a-fA-F0-9]+$") + + schema PromoterArgoprojIoV1alpha1PullRequestSpecCommit: r""" Commit contains configuration for how we will merge/squash/etc the pull request. @@ -133,6 +145,10 @@ schema PromoterArgoprojIoV1alpha1PullRequestStatus: url?: str + check: + _regex_match(str(url), r"^(https?://.*)?$") if url + + schema PromoterArgoprojIoV1alpha1PullRequestStatusConditionsItems0: r""" Condition contains details for one aspect of the current state of this API Resource. diff --git a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_scm_provider.k b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_scm_provider.k index e395222c..b2ee1c9f 100644 --- a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_scm_provider.k +++ b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_scm_provider.k @@ -2,7 +2,9 @@ This file was generated by the KCL auto-gen tool. DO NOT EDIT. Editing this file might prove futile when you re-run the KCL auto-gen generate command. """ +import regex import k8s.apimachinery.pkg.apis.meta.v1 +_regex_match = regex.match schema ScmProvider: @@ -19,8 +21,8 @@ schema ScmProvider: metadata spec : PromoterArgoprojIoV1alpha1ScmProviderSpec, default is Undefined, optional spec - status : any, default is Undefined, optional - ScmProviderStatus defines the observed state of ScmProvider + status : PromoterArgoprojIoV1alpha1ScmProviderStatus, default is Undefined, optional + status """ @@ -32,7 +34,7 @@ schema ScmProvider: spec?: PromoterArgoprojIoV1alpha1ScmProviderSpec - status?: any + status?: PromoterArgoprojIoV1alpha1ScmProviderStatus schema PromoterArgoprojIoV1alpha1ScmProviderSpec: @@ -156,3 +158,69 @@ schema PromoterArgoprojIoV1alpha1ScmProviderSpecSecretRef: name?: str = "" +schema PromoterArgoprojIoV1alpha1ScmProviderStatus: + r""" + ScmProviderStatus defines the observed state of ScmProvider + + Attributes + ---------- + conditions : [PromoterArgoprojIoV1alpha1ScmProviderStatusConditionsItems0], default is Undefined, optional + Conditions Represents the observations of the current state. + """ + + + conditions?: [PromoterArgoprojIoV1alpha1ScmProviderStatusConditionsItems0] + + +schema PromoterArgoprojIoV1alpha1ScmProviderStatusConditionsItems0: + r""" + Condition contains details for one aspect of the current state of this API Resource. + + Attributes + ---------- + lastTransitionTime : str, default is Undefined, required + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + message : str, default is Undefined, required + message is a human readable message indicating details about the transition. + This may be an empty string. + observedGeneration : int, default is Undefined, optional + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + reason : str, default is Undefined, required + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + status : str, default is Undefined, required + status of the condition, one of True, False, Unknown. + $type : str, default is Undefined, required + type of condition in CamelCase or in foo.example.com/CamelCase. + """ + + + lastTransitionTime: str + + message: str + + observedGeneration?: int + + reason: str + + status: "True" | "False" | "Unknown" + + $type: str + + + check: + len(message) <= 32768 + observedGeneration >= 0 if observedGeneration not in [None, Undefined] + len(reason) <= 1024 + len(reason) >= 1 + _regex_match(str(reason), r"^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$") + len($type) <= 316 + _regex_match(str($type), r"^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$") + + diff --git a/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_timed_commit_status.k b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_timed_commit_status.k new file mode 100644 index 00000000..24a2d269 --- /dev/null +++ b/gitops-promoter/v1alpha1/promoter_argoproj_io_v1alpha1_timed_commit_status.k @@ -0,0 +1,197 @@ +""" +This file was generated by the KCL auto-gen tool. DO NOT EDIT. +Editing this file might prove futile when you re-run the KCL auto-gen generate command. +""" +import regex +import k8s.apimachinery.pkg.apis.meta.v1 +_regex_match = regex.match + + +schema TimedCommitStatus: + r""" + TimedCommitStatus is the Schema for the timedcommitstatuses API + + Attributes + ---------- + apiVersion : str, default is "promoter.argoproj.io/v1alpha1", required + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + kind : str, default is "TimedCommitStatus", required + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + metadata : v1.ObjectMeta, default is Undefined, optional + metadata + spec : PromoterArgoprojIoV1alpha1TimedCommitStatusSpec, default is Undefined, required + spec + status : PromoterArgoprojIoV1alpha1TimedCommitStatusStatus, default is Undefined, optional + status + """ + + + apiVersion: "promoter.argoproj.io/v1alpha1" = "promoter.argoproj.io/v1alpha1" + + kind: "TimedCommitStatus" = "TimedCommitStatus" + + metadata?: v1.ObjectMeta + + spec: PromoterArgoprojIoV1alpha1TimedCommitStatusSpec + + status?: PromoterArgoprojIoV1alpha1TimedCommitStatusStatus + + +schema PromoterArgoprojIoV1alpha1TimedCommitStatusSpec: + r""" + spec defines the desired state of TimedCommitStatus + + Attributes + ---------- + environments : [PromoterArgoprojIoV1alpha1TimedCommitStatusSpecEnvironmentsItems0], default is Undefined, required + environments + promotionStrategyRef : PromoterArgoprojIoV1alpha1TimedCommitStatusSpecPromotionStrategyRef, default is Undefined, required + promotion strategy ref + """ + + + environments: [PromoterArgoprojIoV1alpha1TimedCommitStatusSpecEnvironmentsItems0] + + promotionStrategyRef: PromoterArgoprojIoV1alpha1TimedCommitStatusSpecPromotionStrategyRef + + +schema PromoterArgoprojIoV1alpha1TimedCommitStatusSpecEnvironmentsItems0: + r""" + TimedCommitStatusEnvironments defines the branch/environment and duration to wait before reporting the gate as success. + + Attributes + ---------- + branch : str, default is Undefined, required + Branch is the name of the branch/environment you want to gate for the configured duration. + duration : str, default is Undefined, required + Duration is the time duration to wait before considering the commit status as success. + The duration should be in a format accepted by Go's time.ParseDuration function, e.g., "5m", "1h30m". + """ + + + branch: str + + duration: str + + +schema PromoterArgoprojIoV1alpha1TimedCommitStatusSpecPromotionStrategyRef: + r""" + PromotionStrategyRef is a reference to the promotion strategy that this timed commit status applies to. + + Attributes + ---------- + name : str, default is Undefined, required + Name is the name of the object to refer to. + """ + + + name: str + + +schema PromoterArgoprojIoV1alpha1TimedCommitStatusStatus: + r""" + status defines the observed state of TimedCommitStatus + + Attributes + ---------- + conditions : [PromoterArgoprojIoV1alpha1TimedCommitStatusStatusConditionsItems0], default is Undefined, optional + Conditions represent the latest available observations of an object's state + environments : [PromoterArgoprojIoV1alpha1TimedCommitStatusStatusEnvironmentsItems0], default is Undefined, optional + Environments holds the status of each environment being tracked. + """ + + + conditions?: [PromoterArgoprojIoV1alpha1TimedCommitStatusStatusConditionsItems0] + + environments?: [PromoterArgoprojIoV1alpha1TimedCommitStatusStatusEnvironmentsItems0] + + +schema PromoterArgoprojIoV1alpha1TimedCommitStatusStatusConditionsItems0: + r""" + Condition contains details for one aspect of the current state of this API Resource. + + Attributes + ---------- + lastTransitionTime : str, default is Undefined, required + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + message : str, default is Undefined, required + message is a human readable message indicating details about the transition. + This may be an empty string. + observedGeneration : int, default is Undefined, optional + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + reason : str, default is Undefined, required + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + status : str, default is Undefined, required + status of the condition, one of True, False, Unknown. + $type : str, default is Undefined, required + type of condition in CamelCase or in foo.example.com/CamelCase. + """ + + + lastTransitionTime: str + + message: str + + observedGeneration?: int + + reason: str + + status: "True" | "False" | "Unknown" + + $type: str + + + check: + len(message) <= 32768 + observedGeneration >= 0 if observedGeneration not in [None, Undefined] + len(reason) <= 1024 + len(reason) >= 1 + _regex_match(str(reason), r"^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$") + len($type) <= 316 + _regex_match(str($type), r"^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$") + + +schema PromoterArgoprojIoV1alpha1TimedCommitStatusStatusEnvironmentsItems0: + r""" + TimedCommitStatusEnvironmentsStatus defines the observed timing status for a specific environment. + + Attributes + ---------- + atMostDurationRemaining : str, default is Undefined, required + AtMostDurationRemaining is the maximum amount of time remaining until the gate is satisfied. + This is calculated at reconciliation time. When the gate is satisfied (phase=success), this will be 0. + branch : str, default is Undefined, required + Branch is the name of the branch/environment. + commitTime : str, default is Undefined, required + CommitTime is when the commit was deployed to the active environment. + phase : str, default is Undefined, required + Phase represents the current phase of the timed gate. + requiredDuration : str, default is Undefined, required + RequiredDuration is the duration that must elapse before promotion is allowed. + If this is updated in the spec with a pending time. The new duration will be calculated from the original CommitTime. + Allowing you to extend the duration of an already deployed commit, if the time has not yet elapsed. + sha : str, default is Undefined, required + Sha is the commit SHA being tracked for this environment. + """ + + + atMostDurationRemaining: str + + branch: str + + commitTime: str + + phase: "pending" | "success" + + requiredDuration: str + + sha: str + +