Skip to content

Commit 87625bc

Browse files
chore: more type docs (#69)
* chore: more type docs, fix typo Signed-off-by: Michael Crenshaw <[email protected]> * chore: more type docs, fix typo Signed-off-by: Michael Crenshaw <[email protected]> * codegen Signed-off-by: Michael Crenshaw <[email protected]> * remove unused field Signed-off-by: Michael Crenshaw <[email protected]> * update docs Signed-off-by: Michael Crenshaw <[email protected]> --------- Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Zach Aller <[email protected]>
1 parent 45dd2eb commit 87625bc

File tree

6 files changed

+101
-4
lines changed

6 files changed

+101
-4
lines changed

api/v1alpha1/commitstatus_types.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,18 @@ type CommitStatusSpec struct {
4747
// (Gitlab: pending, running, success, failed, canceled)
4848
// (Bitbucket: INPROGRESS, STOPPED, SUCCESSFUL, FAILED)
4949

50+
// Url is a URL that the user can follow to see more details about the status
5051
Url string `json:"url"`
5152
}
5253

5354
// CommitStatusStatus defines the observed state of CommitStatus
5455
type CommitStatusStatus struct {
5556
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
5657
// Important: Run "make" to regenerate code after modifying this file
57-
ObservedGeneration int64 `json:"observedGeneration"`
58-
Id string `json:"id"`
59-
Sha string `json:"sha"`
58+
ObservedGeneration int64 `json:"observedGeneration"`
59+
// Id is the unique identifier of the commit status, set by the SCM
60+
Id string `json:"id"`
61+
Sha string `json:"sha"`
6062
// +kubebuilder:default:=pending
6163
// +kubebuilder:validation:Enum:=pending;success;failure
6264
Phase CommitStatusPhase `json:"phase"`

api/v1alpha1/promotionstrategy_types.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,54 @@ type PromotionStrategySpec struct {
3131
// +kubebuilder:validation:Required
3232
RepositoryReference ObjectReference `json:"gitRepositoryRef"`
3333

34+
// ActiveCommitStatuses are commit statuses describing an actively running dry commit. If an active commit status
35+
// is failing for an environment, subsequent environments will not deploy the failing commit.
36+
//
37+
// The commit statuses specified in this field apply to all environments in the promotion sequence. You can also
38+
// specify commit statuses for individual environments in the `environments` field.
3439
// +kubebuilder:validation:Optional
3540
ActiveCommitStatuses []CommitStatusSelector `json:"activeCommitStatuses"`
3641

42+
// ProposedCommitStatuses are commit statuses describing a proposed dry commit, i.e. one that is not yet running
43+
// in a live environment. If a proposed commit status is failing for a given environment, the dry commit will not
44+
// be promoted to that environment.
45+
//
46+
// The commit statuses specified in this field apply to all environments in the promotion sequence. You can also
47+
// specify commit statuses for individual environments in the `environments` field.
3748
// +kubebuilder:validation:Optional
3849
ProposedCommitStatuses []CommitStatusSelector `json:"proposedCommitStatuses"`
3950

51+
// Environments is the sequence of environments that a dry commit will be promoted through.
4052
// +kubebuilder:validation:MinItems:=1
4153
Environments []Environment `json:"environments"`
4254
}
4355

4456
type Environment struct {
4557
// +kubebuilder:validation:Required
4658
Branch string `json:"branch"`
59+
// AutoMerge determines whether the dry commit should be automatically merged into the next branch in the sequence.
60+
// If false, the dry commit will be proposed but not merged.
4761
// +kubebuilder:validation:Optional
4862
// +kubebuilder:default:=true
4963
AutoMerge *bool `json:"autoMerge,omitempty"`
64+
// ActiveCommitStatuses are commit statuses describing an actively running dry commit. If an active commit status
65+
// is failing for an environment, subsequent environments will not deploy the failing commit.
66+
//
67+
// The commit statuses specified in this field apply to this environment only. You can also specify commit statuses
68+
// for all environments in the `spec.activeCommitStatuses` field.
5069
// +kubebuilder:validation:Optional
5170
ActiveCommitStatuses []CommitStatusSelector `json:"activeCommitStatuses"`
71+
// ProposedCommitStatuses are commit statuses describing a proposed dry commit, i.e. one that is not yet running
72+
// in a live environment. If a proposed commit status is failing for a given environment, the dry commit will not
73+
// be promoted to that environment.
74+
//
75+
// The commit statuses specified in this field apply to this environment only. You can also specify commit statuses
76+
// for all environments in the `spec.proposedCommitStatuses` field.
5277
// +kubebuilder:validation:Optional
5378
ProposedCommitStatuses []CommitStatusSelector `json:"proposedCommitStatuses"`
5479
}
5580

81+
// GetAutoMerge returns the value of the AutoMerge field, defaulting to true if the field is nil.
5682
func (e *Environment) GetAutoMerge() bool {
5783
if e.AutoMerge == nil {
5884
return true

config/crd/bases/promoter.argoproj.io_commitstatuses.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ spec:
6767
sha:
6868
type: string
6969
url:
70+
description: Url is a URL that the user can follow to see more details
71+
about the status
7072
type: string
7173
required:
7274
- description
@@ -80,6 +82,8 @@ spec:
8082
description: CommitStatusStatus defines the observed state of CommitStatus
8183
properties:
8284
id:
85+
description: Id is the unique identifier of the commit status, set
86+
by the SCM
8387
type: string
8488
observedGeneration:
8589
description: |-

config/crd/bases/promoter.argoproj.io_promotionstrategies.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ spec:
4747
description: PromotionStrategySpec defines the desired state of PromotionStrategy
4848
properties:
4949
activeCommitStatuses:
50+
description: |-
51+
ActiveCommitStatuses are commit statuses describing an actively running dry commit. If an active commit status
52+
is failing for an environment, subsequent environments will not deploy the failing commit.
53+
54+
The commit statuses specified in this field apply to all environments in the promotion sequence. You can also
55+
specify commit statuses for individual environments in the `environments` field.
5056
items:
5157
properties:
5258
key:
@@ -57,9 +63,17 @@ spec:
5763
type: object
5864
type: array
5965
environments:
66+
description: Environments is the sequence of environments that a dry
67+
commit will be promoted through.
6068
items:
6169
properties:
6270
activeCommitStatuses:
71+
description: |-
72+
ActiveCommitStatuses are commit statuses describing an actively running dry commit. If an active commit status
73+
is failing for an environment, subsequent environments will not deploy the failing commit.
74+
75+
The commit statuses specified in this field apply to this environment only. You can also specify commit statuses
76+
for all environments in the `spec.activeCommitStatuses` field.
6377
items:
6478
properties:
6579
key:
@@ -71,10 +85,20 @@ spec:
7185
type: array
7286
autoMerge:
7387
default: true
88+
description: |-
89+
AutoMerge determines whether the dry commit should be automatically merged into the next branch in the sequence.
90+
If false, the dry commit will be proposed but not merged.
7491
type: boolean
7592
branch:
7693
type: string
7794
proposedCommitStatuses:
95+
description: |-
96+
ProposedCommitStatuses are commit statuses describing a proposed dry commit, i.e. one that is not yet running
97+
in a live environment. If a proposed commit status is failing for a given environment, the dry commit will not
98+
be promoted to that environment.
99+
100+
The commit statuses specified in this field apply to this environment only. You can also specify commit statuses
101+
for all environments in the `spec.proposedCommitStatuses` field.
78102
items:
79103
properties:
80104
key:
@@ -97,6 +121,13 @@ spec:
97121
- name
98122
type: object
99123
proposedCommitStatuses:
124+
description: |-
125+
ProposedCommitStatuses are commit statuses describing a proposed dry commit, i.e. one that is not yet running
126+
in a live environment. If a proposed commit status is failing for a given environment, the dry commit will not
127+
be promoted to that environment.
128+
129+
The commit statuses specified in this field apply to all environments in the promotion sequence. You can also
130+
specify commit statuses for individual environments in the `environments` field.
100131
items:
101132
properties:
102133
key:

dist/install.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ spec:
261261
sha:
262262
type: string
263263
url:
264+
description: Url is a URL that the user can follow to see more details
265+
about the status
264266
type: string
265267
required:
266268
- description
@@ -274,6 +276,8 @@ spec:
274276
description: CommitStatusStatus defines the observed state of CommitStatus
275277
properties:
276278
id:
279+
description: Id is the unique identifier of the commit status, set
280+
by the SCM
277281
type: string
278282
observedGeneration:
279283
description: |-
@@ -415,6 +419,12 @@ spec:
415419
description: PromotionStrategySpec defines the desired state of PromotionStrategy
416420
properties:
417421
activeCommitStatuses:
422+
description: |-
423+
ActiveCommitStatuses are commit statuses describing an actively running dry commit. If an active commit status
424+
is failing for an environment, subsequent environments will not deploy the failing commit.
425+
426+
The commit statuses specified in this field apply to all environments in the promotion sequence. You can also
427+
specify commit statuses for individual environments in the `environments` field.
418428
items:
419429
properties:
420430
key:
@@ -425,9 +435,17 @@ spec:
425435
type: object
426436
type: array
427437
environments:
438+
description: Environments is the sequence of environments that a dry
439+
commit will be promoted through.
428440
items:
429441
properties:
430442
activeCommitStatuses:
443+
description: |-
444+
ActiveCommitStatuses are commit statuses describing an actively running dry commit. If an active commit status
445+
is failing for an environment, subsequent environments will not deploy the failing commit.
446+
447+
The commit statuses specified in this field apply to this environment only. You can also specify commit statuses
448+
for all environments in the `spec.activeCommitStatuses` field.
431449
items:
432450
properties:
433451
key:
@@ -439,10 +457,20 @@ spec:
439457
type: array
440458
autoMerge:
441459
default: true
460+
description: |-
461+
AutoMerge determines whether the dry commit should be automatically merged into the next branch in the sequence.
462+
If false, the dry commit will be proposed but not merged.
442463
type: boolean
443464
branch:
444465
type: string
445466
proposedCommitStatuses:
467+
description: |-
468+
ProposedCommitStatuses are commit statuses describing a proposed dry commit, i.e. one that is not yet running
469+
in a live environment. If a proposed commit status is failing for a given environment, the dry commit will not
470+
be promoted to that environment.
471+
472+
The commit statuses specified in this field apply to this environment only. You can also specify commit statuses
473+
for all environments in the `spec.proposedCommitStatuses` field.
446474
items:
447475
properties:
448476
key:
@@ -465,6 +493,13 @@ spec:
465493
- name
466494
type: object
467495
proposedCommitStatuses:
496+
description: |-
497+
ProposedCommitStatuses are commit statuses describing a proposed dry commit, i.e. one that is not yet running
498+
in a live environment. If a proposed commit status is failing for a given environment, the dry commit will not
499+
be promoted to that environment.
500+
501+
The commit statuses specified in this field apply to all environments in the promotion sequence. You can also
502+
specify commit statuses for individual environments in the `environments` field.
468503
items:
469504
properties:
470505
key:

docs/example-resources/PromotionStrategy.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ metadata:
55
spec:
66
gitRepositoryRef:
77
name: example-git-repo
8-
dryBranch: main
98
activeCommitStatuses:
109
- key: argocd-app-health
1110
proposedCommitStatuses:

0 commit comments

Comments
 (0)