Skip to content

Commit

Permalink
feat(RHTAPREL-818): add new releaseNotes keys (#354)
Browse files Browse the repository at this point in the history
This commit adds the releaseNotes.product_name and
releaseNotes.product_version keys. They are both required, so
check-data-keys was modified to check for them. Also, they must come
from the ReleasePlanAdmission, so collect-data was modified to ensure
they are not present in the Release or ReleasePlan.

Signed-off-by: Johnny Bieren <[email protected]>
  • Loading branch information
johnbieren authored Feb 18, 2024
1 parent 00bd00a commit f56c4fd
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tasks/check-data-keys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Currently, `releaseNotes` is the only supported system.
| dataPath | Path to the JSON string of the merged data to use | Yes | data.json |
| systems | The systems to check that all data keys are present for | Yes | [] |

## Changes in 0.4.0
- Add releaseNotes.product_name and releaseNotes.product_version to required keys

## Changes in 0.3.0
- Replace advisory.spec references with releaseNotes key

Expand Down
4 changes: 3 additions & 1 deletion tasks/check-data-keys/check-data-keys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Task
metadata:
name: check-data-keys
labels:
app.kubernetes.io/version: "0.3.0"
app.kubernetes.io/version: "0.4.0"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/tags: release
Expand Down Expand Up @@ -34,6 +34,8 @@ spec:
KEYS_JSON='{
"releaseNotes": [
"product_id",
"product_name",
"product_version",
"cpe",
"type",
"content.images",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ spec:
cat > $(workspaces.data.path)/data.json << EOF
{
"releaseNotes": {
"product_name": "Red Hat Openstack Product",
"product_version": "123",
"cpe": "cpe:/a:example:openstack:el8",
"type": "RHSA",
"content": {
Expand Down
2 changes: 2 additions & 0 deletions tasks/check-data-keys/tests/test-check-data-keys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ spec:
{
"releaseNotes": {
"product_id": 123,
"product_name": "Red Hat Openstack Product",
"product_version": "123",
"cpe": "cpe:/a:example:openstack:el8",
"type": "RHSA",
"issues": {
Expand Down
3 changes: 3 additions & 0 deletions tasks/collect-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ should not be present in the Release data section).
| snapshot | Namespaced name of the Snapshot | No | - |
| subdirectory | Subdirectory inside the workspace to be used. | Yes | - |

## Changes in 2.1.0
* product_name and product_version were added as disallowed keys in Release and ReleasePlan CRs

## Changes in 2.0.0
* A second step was added to the task
* The step lists keys that are disallowed for each of the three release resources
Expand Down
6 changes: 5 additions & 1 deletion tasks/collect-data/collect-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Task
metadata:
name: collect-data
labels:
app.kubernetes.io/version: "2.0.0"
app.kubernetes.io/version: "2.1.0"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/tags: release
Expand Down Expand Up @@ -116,11 +116,15 @@ spec:
DISALLOWED_KEYS_JSON='{
"Release": [
"releaseNotes.product_id",
"releaseNotes.product_name",
"releaseNotes.product_version",
"releaseNotes.cpe",
"releaseNotes.type"
],
"ReleasePlan": [
"releaseNotes.product_id",
"releaseNotes.product_name",
"releaseNotes.product_version",
"releaseNotes.cpe",
"releaseNotes.type"
],
Expand Down

0 comments on commit f56c4fd

Please sign in to comment.