Skip to content

Commit

Permalink
feat(RELEASE-400): incorporate check-data-keys task in FBC pipeline
Browse files Browse the repository at this point in the history
This commit adds the check-data-keys task into the
FBC pipeline to ensure validation of required data keys.

Signed-off-by: Sean Conroy <sconroy@redhat.com>
  • Loading branch information
seanconroy2021 committed Dec 3, 2024
1 parent 7d6df9e commit 1c0b8df
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 12 deletions.
3 changes: 3 additions & 0 deletions pipelines/fbc-release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Tekton release pipeline to interact with FBC Pipeline
| taskGitUrl | The url to the git repo where the release-service-catalog tasks to be used are stored | Yes | https://github.com/konflux-ci/release-service-catalog.git |
| taskGitRevision | The revision in the taskGitUrl repo to be used | No | - |

## Changes in 4.1.0
* Implement the `check-data-keys` task to validate the `data.json` file using the JSON schema.

## Changes in 4.0.2
* Drop the `binaryImage` param from the task `add-fbc-contribution-to-index-image`, so IIB can auto resolve it.

Expand Down
26 changes: 25 additions & 1 deletion pipelines/fbc-release/fbc-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Pipeline
metadata:
name: fbc-release
labels:
app.kubernetes.io/version: "4.0.2"
app.kubernetes.io/version: "4.1.0"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/tags: release
Expand Down Expand Up @@ -122,6 +122,30 @@ spec:
workspace: release-workspace
runAfter:
- verify-access-to-resources
- name: check-data-keys
params:
- name: dataPath
value: "$(tasks.collect-data.results.data)"
- name: schema
value: $(params.taskGitUrl)/raw/$(params.taskGitRevision)/schema/dataKeys.json
- name: systems
value:
- fbc
- sign
taskRef:
params:
- name: url
value: $(params.taskGitUrl)
- name: revision
value: $(params.taskGitRevision)
- name: pathInRepo
value: tasks/check-data-keys/check-data-keys.yaml
resolver: git
workspaces:
- name: data
workspace: release-workspace
runAfter:
- collect-data
- name: validate-single-component
taskRef:
resolver: "git"
Expand Down
70 changes: 59 additions & 11 deletions schema/dataKeys.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "array",
"items": {
"type": "string",
"enum": ["releaseNotes", "cdn"],
"enum": ["releaseNotes", "cdn", "fbc", "sign"],
"description": "List of systems that are supported to be required in the data"
}
},
Expand Down Expand Up @@ -520,9 +520,7 @@
}
},
"then": {
"required": [
"releaseNotes"
],
"required": ["releaseNotes"],
"properties": {
"releaseNotes": {
"required": [
Expand All @@ -540,9 +538,7 @@
],
"properties": {
"content": {
"required": [
"images"
]
"required": ["images"]
}
}
}
Expand All @@ -560,14 +556,66 @@
}
},
"then": {
"required": [
"cdn"
],
"required": ["cdn"],
"properties": {
"cdn": {
"required": ["env"]
}
}
}
},
{
"if": {
"properties": {
"systems": {
"contains": {
"const": "fbc"
}
}
}
},
"then": {
"required": ["fbc"],
"properties": {
"fbc": {
"required": [
"env"
"allowedPackages",
"fromIndex",
"targetIndex",
"publishingCredentials",
"buildTimeoutSeconds",
"issueId",
"preGA",
"productName",
"productVersion"
]
},
"properties": {
"allowedPackages": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
{
"if": {
"properties": {
"systems": {
"contains": {
"const": "sign"
}
}
}
},
"then": {
"required": ["sign"],
"properties": {
"sign": {
"required": ["configMapName"]
}
}
}
Expand Down

0 comments on commit 1c0b8df

Please sign in to comment.