Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitops product crd #1001

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Gitops product crd #1001

wants to merge 26 commits into from

Conversation

NimRegev
Copy link
Contributor

No description provided.

Added first draft of sample CRD with field descriptions
Removed Promotion template CRD
Updated field descriptions
Completed field descriptions
Fixed html syntax and tags
<li><code class="highlighter-rouge">.versionSource.jsonPath</code>: The JSON path expression pointing to the location of the attribute containing the application version within the specified <code class="highlighter-rouge">.file</code>.<br>For example, <code class="highlighter-rouge">$.appVersion</code> indicates the value should be extracted from the field <code class="highlighter-rouge">.appVersion</code> in <code class="highlighter-rouge">chart.yaml</code></li>
</ul>
</li>
<li><code class="highlighter-rouge">.promotion</code>: The top-level element defining the specific changes to be promoted to the target environment, through a single or a list of <code class="highlighter-rouge">&lt;filename&gt;:jsonPaths</code>.<br><code class="highlighter-rouge">jsonPaths</code> can define the path to single or multiple attributes within the same file.<br>If <code class="highlighter-rouge">versionSource</code> is not defined, it must include at least one file and its JSON path containing the product's release version to extract.<br>When empty, <em>all</em> changes in <em>all</em> applications connected to the Product are promoted.<br><br>Examples:<ul><li>Extract <code class="highlighter-rouge">name</code> attribute from <code class="highlighter-rouge">chart.yaml</code><br>JSON path: <code class="highlighter-rouge">$.name</code></li><li>Extract all properties of the <code class="highlighter-rouge">dependencies</code> object from <code class="highlighter-rouge">chart.yaml</code><br>JSON path: <code class="highlighter-rouge">$..dependencies.*</code></li><li>Extract the <code class="highlighter-rouge">repository</code> property from the <code class="highlighter-rouge">image</code> object in <code class="highlighter-rouge">values.yaml</code><br>JSON path: <code class="highlighter-rouge">$..image.repository</code></li>
Copy link

@oleksandr-codefresh oleksandr-codefresh Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If versionSource is not defined, it must include at least one file and its JSON path containing the product's release version to extract. - I don't know such behaviour, did you ask someone of devs ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may have changed; it was the behavior when i documented the first version of Promotion Template CRD - reviewed and approved by Noam. Will clarify

<td>The top-level element defining one or more Promotion Flows to orchestrate the product's promotion from the trigger environment, across all the target environments to the final target environment.<br>When there is more than one Promotion Flow, the first one in the list that matches the product is executed.
<ul>
<li><code class="highlighter-rouge">.promotionFlows.name</code>: The name of the Promotion Flow to execute.</li>
<li><code class="highlighter-rouge">.promotionFlows.gitTriggerSelectors</code>: The criteria or conditions to trigger the Promotion Flow, evaluated according to the payload from the application's Git repository.<br>You can have more than one <code class="highlighter-rouge">gitTriggerSelector</code> for the same Promotion Flow. In such cases, the conditions are matched according to the <code class="highlighter-rouge">key</code>, <code class="highlighter-rouge">operator</code>, and <code class="highlighter-rouge">values</code> fields.<br><ul><li><code class="highlighter-rouge">key</code>: The specific attribute from the Git payload to evaluate, and can be one of the following:<ul><li><code class="highlighter-rouge">commitMessage</code>: Trigger the Promotion Flow based on the text description associated with the commit message. The commit message is matched against the values provided. </li><li><code class="highlighter-rouge">gitRevision</code>: Trigger the Promotion Flow based on the commit hash generated by Git as a unique identifier for the commit. The commit hash is matched against the values provided.</li></ul></li><li><code class="highlighter-rouge">operator</code>: The operator to apply when matching the <code class="highlighter-rouge">key</code>, and can be one of the following:<ul><li><code class="highlighter-rouge">In</code>: Checks if the commit message or Git revision <em>includes</em> the specified value or any value within a set of values. The <code class="highlighter-rouge">In</code> operator matches values by exact match. If asterisks are used as wildcards, it can also perform partial matches.</li><li><code class="highlighter-rouge">NotIn</code>: Checks if the commit message or Git revision <em>does not include</em> the specified value or any value within a set of values. Useful for excluding resources that match any value within a predefined list.<br>The <code class="highlighter-rouge">NotIn</code> operator matches values by exact match, and by partial match when asterisks are used as wildcards.</li></ul></li><li><code class="highlighter-rouge">values</code>: Single or list of comma-separated values used to match or exclude Promotion Flows based on criteria defined by the operator. The values can be strings, numbers, or other data types depending on the context.</li></ul><br>Examples:
Copy link

@oleksandr-codefresh oleksandr-codefresh Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trigger the Promotion Flow based on the git branch / tag.

{: .table .table-bordered .table-hover}
| Field | Description | Type | Required/Optional|
| `metadata.name` | The name of the Promotion Template, which can correspond to the name of the Product, or any other meaningful identifier.|Optional|

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "type" should be "string".
and the name is "required", and not "optional"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `metadata.name` | The name of the Promotion Template, which can correspond to the name of the Product, or any other meaningful identifier.|Optional|
| `metadata.name` | The name of the Promotion Template, which can correspond to the name of the Product, or any other meaningful identifier.|string|Reruied|

Comment on lines 50 to 51
| | `versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| | `versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |
Copy link

@ATGardner ATGardner Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| | `versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| | `versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |
| `spec.versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| `spec.versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |

| `spec.versionSource` | The location of the file and the attribute from which to extract the product's application release version. This is the version displayed in the Products and Environments dashboards.| |Required |
| | `versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| | `versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |
|`spec.promotion`| The top-level element defining the specific changes to be promoted to the target environment, through a single or a list of `<filename>:jsonPaths`.<br>`jsonPaths` can define the path to a single or multiple attributes within the same file. <br>When omitted, *all* changes in *all* applications connected to the Product are promoted.<br><br>Examples:<ul><li>Extract `name` attribute from `chart.yaml`<br>JSON path: `$.name`</li><li>Extract all properties of the `dependencies` object from `chart.yaml`<br>JSON path: `$..dependencies.*`</li><li>Extract the `repository` property from the `image` object in `values.yaml`<br>JSON path: `$..image.repository`</li></ul></ul> |array | Optional |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
|`spec.promotion`| The top-level element defining the specific changes to be promoted to the target environment, through a single or a list of `<filename>:jsonPaths`.<br>`jsonPaths` can define the path to a single or multiple attributes within the same file. <br>When omitted, *all* changes in *all* applications connected to the Product are promoted.<br><br>Examples:<ul><li>Extract `name` attribute from `chart.yaml`<br>JSON path: `$.name`</li><li>Extract all properties of the `dependencies` object from `chart.yaml`<br>JSON path: `$..dependencies.*`</li><li>Extract the `repository` property from the `image` object in `values.yaml`<br>JSON path: `$..image.repository`</li></ul></ul> |array | Optional |
|`spec.promotion`| The top-level element defining the specific changes to be promoted to the target environment, through an array of one or more `<filename>:jsonPaths`.<br>`jsonPaths` can define the path to a single or multiple attributes within the same file. <br>When omitted, *all* changes in *all* applications connected to the Product are promoted.<br><br>Examples:<ul><li>Extract `name` attribute from `chart.yaml`<br>JSON path: `$.name`</li><li>Extract all properties of the `dependencies` object from `chart.yaml`<br>JSON path: `$..dependencies.*`</li><li>Extract the `repository` property from the `image` object in `values.yaml`<br>JSON path: `$..image.repository`</li></ul></ul> |array | Optional |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, the html

    does not seem to render correctly in the browser

Comment on lines 53 to 54
| | `promotion.filename`: The file path relative to the application's file path from which to select properties to promote. | string | Optional |
| | `promotion.jsonPath`: The JSON path expression pointing to the location of the attribute with the value to be promoted within the specified `filename`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Optional |
Copy link

@ATGardner ATGardner Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| | `promotion.filename`: The file path relative to the application's file path from which to select properties to promote. | string | Optional |
| | `promotion.jsonPath`: The JSON path expression pointing to the location of the attribute with the value to be promoted within the specified `filename`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Optional |
| `spec.promotion.filename`: The file path relative to the application's file path from which to select properties to promote. | string | Optional |
| `spec.promotion.jsonPath`: The JSON path expression pointing to the location of the attribute with the value to be promoted within the specified `filename`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Optional |

Comment on lines 124 to 125
| | `versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| | `versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| | `versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| | `versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |
| `versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| `versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |

Comment on lines 127 to 128
| | `promotion.filename`: The file path relative to the application's file path from which to select properties to promote. | string | Optional |
| | `promotion.jsonPath`: The JSON path expression pointing to the location of the attribute with the value to be promoted within the specified `filename`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Optional |
Copy link

@ATGardner ATGardner Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| | `promotion.filename`: The file path relative to the application's file path from which to select properties to promote. | string | Optional |
| | `promotion.jsonPath`: The JSON path expression pointing to the location of the attribute with the value to be promoted within the specified `filename`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Optional |
| `spec.promotionTemplate.promotion.filename`: The file path relative to the application's file path from which to select properties to promote. | string | Optional |
| `spec.promotionTemplate.promotion.jsonPath`: The JSON path expression pointing to the location of the attribute with the value to be promoted within the specified `filename`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Optional |

Comment on lines 133 to 134
| | `gitTriggerSelector.key`: The specific attribute from the Git payload to evaluate, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">commitMessage</code>: Trigger the Promotion Flow based on the text description associated with the commit message. The commit message is matched against the values provided.</li><li><code class="highlighter-rouge">gitRevision</code>: Trigger the Promotion Flow based on the commit hash generated by Git as a unique identifier for the commit. The commit hash is matched against the values provided.</li></ul>{:/} | | |
| | `gitTriggerSelector.operator`: The operator to apply when matching the `key`, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">In</code>: Checks if the commit message or Git revision <i>includes</i> the specified value or any value within a set of values. The <code class="highlighter-rouge">In</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li><li><code class="highlighter-rouge">NotIn</code>: Checks if the commit message or Git revision <i>does not include</i> the specified value or any value within a set of values. Useful for excluding resources that match any value within a predefined list.<br>The <code class="highlighter-rouge">NotIn</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li></ul></li>{:/} | | |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| | `gitTriggerSelector.key`: The specific attribute from the Git payload to evaluate, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">commitMessage</code>: Trigger the Promotion Flow based on the text description associated with the commit message. The commit message is matched against the values provided.</li><li><code class="highlighter-rouge">gitRevision</code>: Trigger the Promotion Flow based on the commit hash generated by Git as a unique identifier for the commit. The commit hash is matched against the values provided.</li></ul>{:/} | | |
| | `gitTriggerSelector.operator`: The operator to apply when matching the `key`, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">In</code>: Checks if the commit message or Git revision <i>includes</i> the specified value or any value within a set of values. The <code class="highlighter-rouge">In</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li><li><code class="highlighter-rouge">NotIn</code>: Checks if the commit message or Git revision <i>does not include</i> the specified value or any value within a set of values. Useful for excluding resources that match any value within a predefined list.<br>The <code class="highlighter-rouge">NotIn</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li></ul></li>{:/} | | |
| `gitTriggerSelector.key`: The specific attribute from the Git payload to evaluate, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">commitMessage</code>: Trigger the Promotion Flow based on the text description associated with the commit message. The commit message is matched against the values provided.</li><li><code class="highlighter-rouge">gitRevision</code>: Trigger the Promotion Flow based on the commit hash generated by Git as a unique identifier for the commit. The commit hash is matched against the values provided.</li></ul>{:/} | | |
| `gitTriggerSelector.operator`: The operator to apply when matching the `key`, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">In</code>: Checks if the commit message or Git revision <i>includes</i> the specified value or any value within a set of values. The <code class="highlighter-rouge">In</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li><li><code class="highlighter-rouge">NotIn</code>: Checks if the commit message or Git revision <i>does not include</i> the specified value or any value within a set of values. Useful for excluding resources that match any value within a predefined list.<br>The <code class="highlighter-rouge">NotIn</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li></ul></li>{:/} | | |

Comment on lines 123 to 125
| `.promotionTemplate.versionSource` | The location of the file and the attribute from which to extract the product's application release version. This is the version displayed in the Products and Environments dashboards.| |Optional |
| | `versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| | `versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |
Copy link

@ATGardner ATGardner Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `.promotionTemplate.versionSource` | The location of the file and the attribute from which to extract the product's application release version. This is the version displayed in the Products and Environments dashboards.| |Optional |
| | `versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| | `versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |
| `spec.promotionTemplate.versionSource` | The location of the file and the attribute from which to extract the product's application release version. This is the version displayed in the Products and Environments dashboards.| |Optional |
| `spec.promotionTemplate.versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| `spec.promotionTemplate.versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |

| `.promotionTemplate.versionSource` | The location of the file and the attribute from which to extract the product's application release version. This is the version displayed in the Products and Environments dashboards.| |Optional |
| | `versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| | `versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |
|`.promotionTemplate.promotion`| The top-level element defining the specific changes to be promoted to the target environment, through a single or a list of `<filename>:jsonPaths`.<br>`jsonPaths` can define the path to single or multiple attributes within the same file. <br>When omitted, *all* changes in *all* applications connected to the Product are promoted. |array | Optional |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
|`.promotionTemplate.promotion`| The top-level element defining the specific changes to be promoted to the target environment, through a single or a list of `<filename>:jsonPaths`.<br>`jsonPaths` can define the path to single or multiple attributes within the same file. <br>When omitted, *all* changes in *all* applications connected to the Product are promoted. |array | Optional |
|`spec.promotionTemplate.promotion`| The top-level element defining the specific changes to be promoted to the target environment, through a single or a list of `<filename>:jsonPaths`.<br>`jsonPaths` can define the path to single or multiple attributes within the same file. <br>When omitted, *all* changes in *all* applications connected to the Product are promoted. |array | Optional |

Comment on lines 132 to 134
| `promotionFlows.gitTriggerSelectors` |The criteria or conditions to trigger the Promotion Flow, evaluated according to the payload from the application's Git repository.<br>You can have more than one `gitTriggerSelector` for the same Promotion Flow. In such cases, the conditions are matched according to the `key`, `operator`, and `values` fields.
| | `gitTriggerSelector.key`: The specific attribute from the Git payload to evaluate, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">commitMessage</code>: Trigger the Promotion Flow based on the text description associated with the commit message. The commit message is matched against the values provided.</li><li><code class="highlighter-rouge">gitRevision</code>: Trigger the Promotion Flow based on the commit hash generated by Git as a unique identifier for the commit. The commit hash is matched against the values provided.</li></ul>{:/} | | |
| | `gitTriggerSelector.operator`: The operator to apply when matching the `key`, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">In</code>: Checks if the commit message or Git revision <i>includes</i> the specified value or any value within a set of values. The <code class="highlighter-rouge">In</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li><li><code class="highlighter-rouge">NotIn</code>: Checks if the commit message or Git revision <i>does not include</i> the specified value or any value within a set of values. Useful for excluding resources that match any value within a predefined list.<br>The <code class="highlighter-rouge">NotIn</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li></ul></li>{:/} | | |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `promotionFlows.gitTriggerSelectors` |The criteria or conditions to trigger the Promotion Flow, evaluated according to the payload from the application's Git repository.<br>You can have more than one `gitTriggerSelector` for the same Promotion Flow. In such cases, the conditions are matched according to the `key`, `operator`, and `values` fields.
| | `gitTriggerSelector.key`: The specific attribute from the Git payload to evaluate, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">commitMessage</code>: Trigger the Promotion Flow based on the text description associated with the commit message. The commit message is matched against the values provided.</li><li><code class="highlighter-rouge">gitRevision</code>: Trigger the Promotion Flow based on the commit hash generated by Git as a unique identifier for the commit. The commit hash is matched against the values provided.</li></ul>{:/} | | |
| | `gitTriggerSelector.operator`: The operator to apply when matching the `key`, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">In</code>: Checks if the commit message or Git revision <i>includes</i> the specified value or any value within a set of values. The <code class="highlighter-rouge">In</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li><li><code class="highlighter-rouge">NotIn</code>: Checks if the commit message or Git revision <i>does not include</i> the specified value or any value within a set of values. Useful for excluding resources that match any value within a predefined list.<br>The <code class="highlighter-rouge">NotIn</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li></ul></li>{:/} | | |
| `spec.promotionFlows.gitTriggerSelectors` |The criteria or conditions to trigger the Promotion Flow, evaluated according to the payload from the application's Git repository.<br>You can have more than one `gitTriggerSelector` for the same Promotion Flow. In such cases, the conditions are matched according to the `key`, `operator`, and `values` fields.
| `spec.promotionFlows.gitTriggerSelector.key`: The specific attribute from the Git payload to evaluate, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">commitMessage</code>: Trigger the Promotion Flow based on the text description associated with the commit message. The commit message is matched against the values provided.</li><li><code class="highlighter-rouge">gitRevision</code>: Trigger the Promotion Flow based on the commit hash generated by Git as a unique identifier for the commit. The commit hash is matched against the values provided.</li></ul>{:/} | | |
| `spec.promotionFlows.gitTriggerSelector.operator`: The operator to apply when matching the `key`, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">In</code>: Checks if the commit message or Git revision <i>includes</i> the specified value or any value within a set of values. The <code class="highlighter-rouge">In</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li><li><code class="highlighter-rouge">NotIn</code>: Checks if the commit message or Git revision <i>does not include</i> the specified value or any value within a set of values. Useful for excluding resources that match any value within a predefined list.<br>The <code class="highlighter-rouge">NotIn</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li></ul></li>{:/} | | |

| `promotionFlows.gitTriggerSelectors` |The criteria or conditions to trigger the Promotion Flow, evaluated according to the payload from the application's Git repository.<br>You can have more than one `gitTriggerSelector` for the same Promotion Flow. In such cases, the conditions are matched according to the `key`, `operator`, and `values` fields.
| | `gitTriggerSelector.key`: The specific attribute from the Git payload to evaluate, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">commitMessage</code>: Trigger the Promotion Flow based on the text description associated with the commit message. The commit message is matched against the values provided.</li><li><code class="highlighter-rouge">gitRevision</code>: Trigger the Promotion Flow based on the commit hash generated by Git as a unique identifier for the commit. The commit hash is matched against the values provided.</li></ul>{:/} | | |
| | `gitTriggerSelector.operator`: The operator to apply when matching the `key`, and can be one of the following:{::nomarkdown}<ul><li><code class="highlighter-rouge">In</code>: Checks if the commit message or Git revision <i>includes</i> the specified value or any value within a set of values. The <code class="highlighter-rouge">In</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li><li><code class="highlighter-rouge">NotIn</code>: Checks if the commit message or Git revision <i>does not include</i> the specified value or any value within a set of values. Useful for excluding resources that match any value within a predefined list.<br>The <code class="highlighter-rouge">NotIn</code> operator matches values by exact match, or by partial match when asterisks are used as wildcards.</li></ul></li>{:/} | | |
| |`gitTriggerSelector.values`: Single or list of comma-separated values used to match or exclude Promotion Flows based on criteria defined by the operator. The values can be strings, numbers, or other data types depending on the context.| | |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| |`gitTriggerSelector.values`: Single or list of comma-separated values used to match or exclude Promotion Flows based on criteria defined by the operator. The values can be strings, numbers, or other data types depending on the context.| | |
|`spec.promotionFlows.gitTriggerSelector.values`: Single or list of comma-separated values used to match or exclude Promotion Flows based on criteria defined by the operator. The values can be strings, numbers, or other data types depending on the context.| | |

| Field | Description | Type | Required/Optional|
| `metadata.name` | The name of the Promotion Template, which can correspond to the name of the Product, or any other meaningful identifier.|Optional|
| `spec.applicationSourceSelector` | The label used to match the application to which to apply the Promotion Template. Application selectors conform to Kubernetes _label selectors_, defined as `matchLabels` with `key-value` pairs, `matchExpressions` with `key-operator-value` arrays, or a combination of both. The values identify all the Promotion Template manifests that match the specific application or applications within the target environment.| | Required|
| `.applicationSourceSelector.matchLabels` | One or more `key-value` pairs. <br>For example:{::nomarkdown}<ul><li><code class="highlighter-rouge">codefresh.io/environment: production</code> applies the Promotion Template to all applications within the Production Environment.</li><li><code class="highlighter-rouge">codefresh.io/product: loans</code> applies the Promotion Template only to applications belonging to the Loans Product.</li></ul>{:/}| object | Optional |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `.applicationSourceSelector.matchLabels` | One or more `key-value` pairs. <br>For example:{::nomarkdown}<ul><li><code class="highlighter-rouge">codefresh.io/environment: production</code> applies the Promotion Template to all applications within the Production Environment.</li><li><code class="highlighter-rouge">codefresh.io/product: loans</code> applies the Promotion Template only to applications belonging to the Loans Product.</li></ul>{:/}| object | Optional |
| `spec.applicationSourceSelector.matchLabels` | One or more `key-value` pairs. <br>For example:{::nomarkdown}<ul><li><code class="highlighter-rouge">codefresh.io/environment: production</code> applies the Promotion Template to all applications within the Production Environment.</li><li><code class="highlighter-rouge">codefresh.io/product: loans</code> applies the Promotion Template only to applications belonging to the Loans Product.</li></ul>{:/}| object | Optional |

| `metadata.name` | The name of the Promotion Template, which can correspond to the name of the Product, or any other meaningful identifier.|Optional|
| `spec.applicationSourceSelector` | The label used to match the application to which to apply the Promotion Template. Application selectors conform to Kubernetes _label selectors_, defined as `matchLabels` with `key-value` pairs, `matchExpressions` with `key-operator-value` arrays, or a combination of both. The values identify all the Promotion Template manifests that match the specific application or applications within the target environment.| | Required|
| `.applicationSourceSelector.matchLabels` | One or more `key-value` pairs. <br>For example:{::nomarkdown}<ul><li><code class="highlighter-rouge">codefresh.io/environment: production</code> applies the Promotion Template to all applications within the Production Environment.</li><li><code class="highlighter-rouge">codefresh.io/product: loans</code> applies the Promotion Template only to applications belonging to the Loans Product.</li></ul>{:/}| object | Optional |
| `.applicationSourceSelector.matchExpressions` | List of expressions, each with a `key`, an `operator`, and a set of `values`. <br>The `operator` defines the relationship between the `key` and its `values`, and can be one of the following: {::nomarkdown}<ul><li><code class="highlighter-rouge">In</code>: The value _must match_ one of those specified in the <code class="highlighter-rouge">values</code> array.</li> <li><code class="highlighter-rouge">NotIn</code>: The value _must NOT match_ any of those in the <code class="highlighter-rouge">values</code> array.</li><li><code class="highlighter-rouge">Exists</code>: Only the <code class="highlighter-rouge">key</code> must exist regardless of its values.<br>The <code class="highlighter-rouge">values</code> array must be empty. </li><li><code class="highlighter-rouge">DoesNotExist</code>: The <code class="highlighter-rouge">key</code> must not exist.<br>The <code class="highlighter-rouge">values</code> array must be empty.</li></ul>{:/}For example:<br>`key: codefresh.io/product` and `operator: Exists` applies the Promotion Template to any application containing the label `codefresh.io/product`.| string | Optional |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `.applicationSourceSelector.matchExpressions` | List of expressions, each with a `key`, an `operator`, and a set of `values`. <br>The `operator` defines the relationship between the `key` and its `values`, and can be one of the following: {::nomarkdown}<ul><li><code class="highlighter-rouge">In</code>: The value _must match_ one of those specified in the <code class="highlighter-rouge">values</code> array.</li> <li><code class="highlighter-rouge">NotIn</code>: The value _must NOT match_ any of those in the <code class="highlighter-rouge">values</code> array.</li><li><code class="highlighter-rouge">Exists</code>: Only the <code class="highlighter-rouge">key</code> must exist regardless of its values.<br>The <code class="highlighter-rouge">values</code> array must be empty. </li><li><code class="highlighter-rouge">DoesNotExist</code>: The <code class="highlighter-rouge">key</code> must not exist.<br>The <code class="highlighter-rouge">values</code> array must be empty.</li></ul>{:/}For example:<br>`key: codefresh.io/product` and `operator: Exists` applies the Promotion Template to any application containing the label `codefresh.io/product`.| string | Optional |
| `spec.applicationSourceSelector.matchExpressions` | List of expressions, each with a `key`, an `operator`, and a set of `values`. <br>The `operator` defines the relationship between the `key` and its `values`, and can be one of the following: {::nomarkdown}<ul><li><code class="highlighter-rouge">In</code>: The value _must match_ one of those specified in the <code class="highlighter-rouge">values</code> array.</li> <li><code class="highlighter-rouge">NotIn</code>: The value _must NOT match_ any of those in the <code class="highlighter-rouge">values</code> array.</li><li><code class="highlighter-rouge">Exists</code>: Only the <code class="highlighter-rouge">key</code> must exist regardless of its values.<br>The <code class="highlighter-rouge">values</code> array must be empty. </li><li><code class="highlighter-rouge">DoesNotExist</code>: The <code class="highlighter-rouge">key</code> must not exist.<br>The <code class="highlighter-rouge">values</code> array must be empty.</li></ul>{:/}For example:<br>`key: codefresh.io/product` and `operator: Exists` applies the Promotion Template to any application containing the label `codefresh.io/product`.| string | Optional |

| | `versionSource.file`: The file path relative to the application's file path from which to extract the application's release version. For example, `chart.yaml` indicates that the release version should be extracted from this file.| string | Required |
| | `versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |
|`spec.promotion`| The top-level element defining the specific changes to be promoted to the target environment, through a single or a list of `<filename>:jsonPaths`.<br>`jsonPaths` can define the path to a single or multiple attributes within the same file. <br>When omitted, *all* changes in *all* applications connected to the Product are promoted.<br><br>Examples:<ul><li>Extract `name` attribute from `chart.yaml`<br>JSON path: `$.name`</li><li>Extract all properties of the `dependencies` object from `chart.yaml`<br>JSON path: `$..dependencies.*`</li><li>Extract the `repository` property from the `image` object in `values.yaml`<br>JSON path: `$..image.repository`</li></ul></ul> |array | Optional |
| | `promotion.filename`: The file path relative to the application's file path from which to select properties to promote. | string | Optional |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| | `promotion.filename`: The file path relative to the application's file path from which to select properties to promote. | string | Optional |
| | `spec.promotion.filename`: The file path relative to the application's file path from which to select properties to promote. | string | Optional |

| | `versionSource.jsonPath`: The JSON path expression pointing to the location of the attribute containing the application version within the specified `file`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Required |
|`spec.promotion`| The top-level element defining the specific changes to be promoted to the target environment, through a single or a list of `<filename>:jsonPaths`.<br>`jsonPaths` can define the path to a single or multiple attributes within the same file. <br>When omitted, *all* changes in *all* applications connected to the Product are promoted.<br><br>Examples:<ul><li>Extract `name` attribute from `chart.yaml`<br>JSON path: `$.name`</li><li>Extract all properties of the `dependencies` object from `chart.yaml`<br>JSON path: `$..dependencies.*`</li><li>Extract the `repository` property from the `image` object in `values.yaml`<br>JSON path: `$..image.repository`</li></ul></ul> |array | Optional |
| | `promotion.filename`: The file path relative to the application's file path from which to select properties to promote. | string | Optional |
| | `promotion.jsonPath`: The JSON path expression pointing to the location of the attribute with the value to be promoted within the specified `filename`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Optional |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| | `promotion.jsonPath`: The JSON path expression pointing to the location of the attribute with the value to be promoted within the specified `filename`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Optional |
| `spec.promotion.jsonPath`: The JSON path expression pointing to the location of the attribute with the value to be promoted within the specified `filename`.<br>For example, `$.appVersion` indicates the value should be extracted from the field `appVersion` in `chart.yaml`.| string| Optional |

_data/nav.yml Outdated
url: "/promotion-template-crd"
- title: Promotion Flow CRD
url: "/promotion-flow-crd"
- title: Promotion Flow CRD

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- title: Promotion Flow CRD
- title: Promotion Policy CRD

Comment on lines +41 to +42
| |`steps[].environment`: The name of the specific environment for which to trigger the promotion. | string | Required |
| | `steps[].dependsOn`: One or more environments that must be successfully promoted before this step can be triggered. | array | Required |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| |`steps[].environment`: The name of the specific environment for which to trigger the promotion. | string | Required |
| | `steps[].dependsOn`: One or more environments that must be successfully promoted before this step can be triggered. | array | Required |
|`spec.steps[].environment`: The name of the specific environment for which to trigger the promotion. | string | Required |
| `spec.steps[].dependsOn`: One or more environments that must be successfully promoted before this step can be triggered. | array | Required |

@codefresh-git-integration
Copy link

```
## Promotion Policy CRD field descriptions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Table layout is broken. 2 empty columns at the end.
Also some of the values are not in correct columns.

_docs/promotions/promotion-policy-crd.md Outdated Show resolved Hide resolved
_docs/promotions/promotion-policy-crd.md Outdated Show resolved Hide resolved
_docs/promotions/promotion-policy-crd.md Outdated Show resolved Hide resolved
_docs/promotions/promotion-policy-crd.md Outdated Show resolved Hide resolved
_docs/promotions/promotion-policy-crd.md Outdated Show resolved Hide resolved
_docs/promotions/promotion-policy-crd.md Outdated Show resolved Hide resolved
_docs/promotions/promotion-policy-crd.md Outdated Show resolved Hide resolved
_docs/promotions/promotion-policy-crd.md Outdated Show resolved Hide resolved
_docs/promotions/promotion-policy-crd.md Outdated Show resolved Hide resolved
Implemented review comments from Denis for PP CRD; added related article links to all CRDs
@codefresh-git-integration
Copy link

@codefresh-git-integration
Copy link

@codefresh-git-integration
Copy link

@codefresh-git-integration
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants