Skip to content

Commit

Permalink
Merge pull request #83 from enterprise-contract/more-konflux-renames
Browse files Browse the repository at this point in the history
Replace RHTAP with Konflux
  • Loading branch information
simonbaird authored Feb 26, 2024
2 parents d663f7e + 421f17e commit eb2da5b
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 64 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ _default: all
DATA_JSON=src/data.json

POLICY_TEMPLATE=src/policy.yaml.tmpl
POLICY_RHTAP_TEMPLATE=src/policy-rhtap.yaml.tmpl
POLICY_RHTAP_TASKS_TEMPLATE=src/policy-rhtap-tasks.yaml.tmpl
POLICY_KONFLUX_TEMPLATE=src/policy-konflux.yaml.tmpl
POLICY_KONFLUX_TASKS_TEMPLATE=src/policy-konflux-tasks.yaml.tmpl
POLICY_GITHUB_TEMPLATE=src/policy-github.yaml.tmpl

ifndef GOMPLATE
GOMPLATE=gomplate
endif

%/policy.yaml: $(POLICY_TEMPLATE) $(DATA_JSON) $(POLICY_RHTAP_TEMPLATE) $(POLICY_RHTAP_TASKS_TEMPLATE) $(POLICY_GITHUB_TEMPLATE) Makefile
%/policy.yaml: $(POLICY_TEMPLATE) $(DATA_JSON) $(POLICY_KONFLUX_TEMPLATE) $(POLICY_KONFLUX_TASKS_TEMPLATE) $(POLICY_GITHUB_TEMPLATE) Makefile
@mkdir -p $(*)
@env NAME=$(*) $(GOMPLATE) -d data=$(DATA_JSON) --file $< \
-t rhtap=$(POLICY_RHTAP_TEMPLATE) -t rhtap-tasks=$(POLICY_RHTAP_TASKS_TEMPLATE) -t github=$(POLICY_GITHUB_TEMPLATE) \
-t konflux=$(POLICY_KONFLUX_TEMPLATE) -t konflux-tasks=$(POLICY_KONFLUX_TASKS_TEMPLATE) -t github=$(POLICY_GITHUB_TEMPLATE) \
-o $@

POLICY_FILES=$(shell jq -r '"\(keys | .[])/policy.yaml"' src/data.json)

README_TEMPLATE=src/README.md.tmpl
README_RHTAP_TEMPLATE=src/README-rhtap.md.tmpl
README_RHTAP_TASKS_TEMPLATE=src/README-rhtap-tasks.md.tmpl
README_KONFLUX_TEMPLATE=src/README-konflux.md.tmpl
README_KONFLUX_TASKS_TEMPLATE=src/README-konflux-tasks.md.tmpl
README_GITHUB_TEMPLATE=src/README-github.md.tmpl
README_FILE=README.md

$(README_FILE): $(README_TEMPLATE) $(DATA_JSON) $(README_RHTAP_TEMPLATE) $(README_RHTAP_TASKS_TEMPLATE) $(README_GITHUB_TEMPLATE) Makefile
$(README_FILE): $(README_TEMPLATE) $(DATA_JSON) $(README_KONFLUX_TEMPLATE) $(README_KONFLUX_TASKS_TEMPLATE) $(README_GITHUB_TEMPLATE) Makefile
@$(GOMPLATE) -d data=$(DATA_JSON) --file $< \
-t rhtap=$(README_RHTAP_TEMPLATE) -t rhtap-tasks=$(README_RHTAP_TASKS_TEMPLATE) -t github=$(README_GITHUB_TEMPLATE) \
-t konflux=$(README_KONFLUX_TEMPLATE) -t konflux-tasks=$(README_KONFLUX_TASKS_TEMPLATE) -t github=$(README_GITHUB_TEMPLATE) \
> $@

all: $(POLICY_FILES) $(README_FILE)
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@ This repo contains a set of `policy.yaml` files which can be used by the [Enterp
Command Line Interface](https://github.com/enterprise-contract/ec-cli) with a variety of
environments.

## Red Hat Trusted Application Pipeline
## Konflux CI

When using the [Red Hat Trusted Application
Pipeline](https://developers.redhat.com/products/trusted-software-supply-chain/overview)
When using Red Hat's [Konflux CI](https://github.com/konflux-ci/), (formerly
[Red Hat App Studio](https://github.com/redhat-appstudio/)),
environment, there is a predefined Integration Test pipeline definition for each of the configs in
this section. They can be used when creating an Integration Test in RHTAP as per the [documentation
this section. They can be used when creating an Integration Test in Konflux as per the [documentation
here](https://redhat-appstudio.github.io/docs.appstudio.io/Documentation/main/how-to-guides/proc_managing-compliance-with-the-enterprise-contract/).

The policy configuration files are:

### Default

Includes rules for levels 1, 2 & 3 of SLSA v0.1. This is the default config used for new RHTAP applications.
Includes rules for levels 1, 2 & 3 of SLSA v0.1. This is the default config used for new Konflux applications.

* URL for Enterprise Contract: `github.com/enterprise-contract/config//default`
* Source: [default/policy.yaml](https://github.com/enterprise-contract/config/blob/main/default/policy.yaml)
* Collections: [@slsa3](https://enterprisecontract.dev/docs/ec-policies/release_policy.html#slsa3)
* RHTAP Integration Test pipeline definition:
* Konflux Integration Test pipeline definition:
* Github URL: `https://github.com/redhat-appstudio/build-definitions`
* Path in repository: [`pipelines/enterprise-contract.yaml`](https://github.com/redhat-appstudio/build-definitions/blob/main/pipelines/enterprise-contract.yaml)

### Everything (experimental)

Include every rule in the default policy source. For experiments only. This is not expected to pass for RHTAP builds without excluding some rules.
Include every rule in the default policy source. For experiments only. This is not expected to pass for Konflux builds without excluding some rules.

* URL for Enterprise Contract: `github.com/enterprise-contract/config//everything`
* Source: [everything/policy.yaml](https://github.com/enterprise-contract/config/blob/main/everything/policy.yaml)
* Collections:
* RHTAP Integration Test pipeline definition:
* Konflux Integration Test pipeline definition:
* Github URL: `https://github.com/redhat-appstudio/build-definitions`
* Path in repository: [`pipelines/enterprise-contract-everything.yaml`](https://github.com/redhat-appstudio/build-definitions/blob/main/pipelines/enterprise-contract-everything.yaml)

Expand All @@ -43,7 +43,7 @@ Includes the full set of rules and policies required internally by Red Hat when
* URL for Enterprise Contract: `github.com/enterprise-contract/config//redhat`
* Source: [redhat/policy.yaml](https://github.com/enterprise-contract/config/blob/main/redhat/policy.yaml)
* Collections: [@redhat](https://enterprisecontract.dev/docs/ec-policies/release_policy.html#redhat)
* RHTAP Integration Test pipeline definition:
* Konflux Integration Test pipeline definition:
* Github URL: `https://github.com/redhat-appstudio/build-definitions`
* Path in repository: [`pipelines/enterprise-contract-redhat.yaml`](https://github.com/redhat-appstudio/build-definitions/blob/main/pipelines/enterprise-contract-redhat.yaml)

Expand All @@ -54,23 +54,23 @@ Includes most of the rules and policies required internally by Red Hat when buil
* URL for Enterprise Contract: `github.com/enterprise-contract/config//redhat-no-hermetic`
* Source: [redhat-no-hermetic/policy.yaml](https://github.com/enterprise-contract/config/blob/main/redhat-no-hermetic/policy.yaml)
* Collections: [@redhat](https://enterprisecontract.dev/docs/ec-policies/release_policy.html#redhat)
* RHTAP Integration Test pipeline definition:
* Konflux Integration Test pipeline definition:
* Github URL: `https://github.com/redhat-appstudio/build-definitions`
* Path in repository: [`pipelines/enterprise-contract-redhat-no-hermetic.yaml`](https://github.com/redhat-appstudio/build-definitions/blob/main/pipelines/enterprise-contract-redhat-no-hermetic.yaml)

### SLSA3

Rules specifically related to levels 1, 2 & 3 of SLSA v0.1, plus a set of basic checks that are expected to pass for all RHTAP builds.
Rules specifically related to levels 1, 2 & 3 of SLSA v0.1, plus a set of basic checks that are expected to pass for all Konflux builds.

* URL for Enterprise Contract: `github.com/enterprise-contract/config//slsa3`
* Source: [slsa3/policy.yaml](https://github.com/enterprise-contract/config/blob/main/slsa3/policy.yaml)
* Collections: [@minimal](https://enterprisecontract.dev/docs/ec-policies/release_policy.html#minimal), [@slsa3](https://enterprisecontract.dev/docs/ec-policies/release_policy.html#slsa3)
* RHTAP Integration Test pipeline definition:
* Konflux Integration Test pipeline definition:
* Github URL: `https://github.com/redhat-appstudio/build-definitions`
* Path in repository: [`pipelines/enterprise-contract-slsa3.yaml`](https://github.com/redhat-appstudio/build-definitions/blob/main/pipelines/enterprise-contract-slsa3.yaml)


## Red Hat Trusted Application Pipeline - Tasks
## Konflux CI & Red Hat Trusted Application Pipeline (RHTAP) - Tasks

These are policy rules used to verify Tekton Task definitions meet the Red Hat guidelines for being
considered trusted.
Expand Down Expand Up @@ -101,4 +101,4 @@ Rules for container images built via GitHub Workflows.
## See also

* [Policy Rule Documentation](https://enterprisecontract.dev/docs/ec-policies/release_policy.html)
* [Getting Started with Enterprise Contract &amp; Red Hat Trusted Application Pipeline](https://enterprisecontract.dev/docs/user-guide/main/getting-started.html)
* [Getting Started with Enterprise Contract &amp; Konflux CI](https://enterprisecontract.dev/docs/user-guide/main/getting-started.html)
4 changes: 2 additions & 2 deletions default/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# --public-key key.pub \
# --policy github.com/enterprise-contract/config//default
#
# To use with an RHTAP Enterprise Contract Integration Test CR:
# To use with an Konflux Enterprise Contract Integration Test CR:
# ...
# spec:
# params:
Expand All @@ -15,7 +15,7 @@
#
name: Default
description: >-
Includes rules for levels 1, 2 & 3 of SLSA v0.1. This is the default config used for new RHTAP applications.
Includes rules for levels 1, 2 & 3 of SLSA v0.1. This is the default config used for new Konflux applications.
Available collections are defined in
https://redhat-appstudio.github.io/docs.stonesoup.io/ec-policies/release_policy.html#_available_rule_collections.
If a different policy configuration is desired, this resource can serve as a starting point.
Expand Down
4 changes: 2 additions & 2 deletions everything/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# --public-key key.pub \
# --policy github.com/enterprise-contract/config//everything
#
# To use with an RHTAP Enterprise Contract Integration Test CR:
# To use with an Konflux Enterprise Contract Integration Test CR:
# ...
# spec:
# params:
Expand All @@ -15,7 +15,7 @@
#
name: Everything (experimental)
description: >-
Include every rule in the default policy source. For experiments only. This is not expected to pass for RHTAP builds without excluding some rules.
Include every rule in the default policy source. For experiments only. This is not expected to pass for Konflux builds without excluding some rules.
Available collections are defined in
https://redhat-appstudio.github.io/docs.stonesoup.io/ec-policies/release_policy.html#_available_rule_collections.
If a different policy configuration is desired, this resource can serve as a starting point.
Expand Down
10 changes: 5 additions & 5 deletions hack/update-infra-deployments.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# SPDX-License-Identifier: Apache-2.0

# Updates a local clone of redhat-appstudio/infra-deployments to use the RHTAP
# Updates a local clone of redhat-appstudio/infra-deployments to use the Konflux
# configs defined in this repo.
# Usage:
# update-infra-deployments.sh <PATH_TO_INFRA_DEPLOYMENTS>
Expand Down Expand Up @@ -85,18 +85,18 @@ echo "Task policy URL: ${task_policy_url}"

# Always generate the output file from scratch and add some helper text on the generated file.
echo '#
# The contents of this file are automatically generated based on the RHTAP configs defined in the
# The contents of this file are automatically generated based on the Konflux configs defined in the
# github.com/enterprise-contract/config repo. Any manual modifications will be overridden.
#
' > "${OUTPUT}"

if [[ ! -z $release_policy_url ]]; then
# Figure out which release policy config files to use.
policy_configs="$(get_policy_configs "rhtap")"
policy_configs="$(get_policy_configs "konflux")"

for policy_config in $policy_configs; do
name="$(dirname $policy_config)"
# For legacy reasons, the everything config is called "all" in RHTAP
# For legacy reasons, the everything config is called "all" in Konflux
if [[ "${name}" == 'everything' ]]; then
name='all'
fi
Expand All @@ -120,7 +120,7 @@ fi

if [[ ! -z $task_policy_url ]]; then
# Figure out which task policy config files to use.
task_policy_configs="$(get_policy_configs "rhtap-tasks")"
task_policy_configs="$(get_policy_configs "konflux-tasks")"

for policy_config in $task_policy_configs; do
name="$(dirname $policy_config)"
Expand Down
4 changes: 2 additions & 2 deletions minimal/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# --public-key key.pub \
# --policy github.com/enterprise-contract/config//minimal
#
# To use with an RHTAP Enterprise Contract Integration Test CR:
# To use with an Konflux Enterprise Contract Integration Test CR:
# ...
# spec:
# params:
Expand All @@ -17,7 +17,7 @@
#
name: Minimal (deprecated)
description: >-
Includes a set of basic checks that are expected to pass for all RHTAP builds.
Includes a set of basic checks that are expected to pass for all Konflux builds.
Available collections are defined in
https://redhat-appstudio.github.io/docs.stonesoup.io/ec-policies/release_policy.html#_available_rule_collections.
If a different policy configuration is desired, this resource can serve as a starting point.
Expand Down
2 changes: 1 addition & 1 deletion redhat-no-hermetic/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# --public-key key.pub \
# --policy github.com/enterprise-contract/config//redhat-no-hermetic
#
# To use with an RHTAP Enterprise Contract Integration Test CR:
# To use with an Konflux Enterprise Contract Integration Test CR:
# ...
# spec:
# params:
Expand Down
2 changes: 1 addition & 1 deletion redhat/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# --public-key key.pub \
# --policy github.com/enterprise-contract/config//redhat
#
# To use with an RHTAP Enterprise Contract Integration Test CR:
# To use with an Konflux Enterprise Contract Integration Test CR:
# ...
# spec:
# params:
Expand Down
4 changes: 2 additions & 2 deletions slsa3/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# --public-key key.pub \
# --policy github.com/enterprise-contract/config//slsa3
#
# To use with an RHTAP Enterprise Contract Integration Test CR:
# To use with an Konflux Enterprise Contract Integration Test CR:
# ...
# spec:
# params:
Expand All @@ -15,7 +15,7 @@
#
name: SLSA3
description: >-
Rules specifically related to levels 1, 2 & 3 of SLSA v0.1, plus a set of basic checks that are expected to pass for all RHTAP builds.
Rules specifically related to levels 1, 2 & 3 of SLSA v0.1, plus a set of basic checks that are expected to pass for all Konflux builds.
Available collections are defined in
https://redhat-appstudio.github.io/docs.stonesoup.io/ec-policies/release_policy.html#_available_rule_collections.
If a different policy configuration is desired, this resource can serve as a starting point.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/README-rhtap.md.tmpl → src/README-konflux.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[{{ . }}](https://enterprisecontract.dev/docs/ec-policies/release_policy.html#{{ strings.TrimPrefix "@" . }})
{{- end -}}
{{- end }}
* RHTAP Integration Test pipeline definition:
* Konflux Integration Test pipeline definition:
* Github URL: `https://github.com/redhat-appstudio/build-definitions`
* Path in repository: [`pipelines/enterprise-contract{{ if ne $.directory "default" }}-{{ $.directory }}{{ end }}.yaml`](https://github.com/redhat-appstudio/build-definitions/blob/main/pipelines/enterprise-contract{{ if ne $.directory "default" }}-{{ $.directory }}{{ end }}.yaml)
{{- end }}
20 changes: 10 additions & 10 deletions src/README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ This repo contains a set of `policy.yaml` files which can be used by the [Enterp
Command Line Interface](https://github.com/enterprise-contract/ec-cli) with a variety of
environments.

## Red Hat Trusted Application Pipeline
## Konflux CI

When using the [Red Hat Trusted Application
Pipeline](https://developers.redhat.com/products/trusted-software-supply-chain/overview)
When using Red Hat's [Konflux CI](https://github.com/konflux-ci/), (formerly
[Red Hat App Studio](https://github.com/redhat-appstudio/)),
environment, there is a predefined Integration Test pipeline definition for each of the configs in
this section. They can be used when creating an Integration Test in RHTAP as per the [documentation
this section. They can be used when creating an Integration Test in Konflux as per the [documentation
here](https://redhat-appstudio.github.io/docs.appstudio.io/Documentation/main/how-to-guides/proc_managing-compliance-with-the-enterprise-contract/).

The policy configuration files are:
{{ range $k, $v := ds "data" }}
{{- with coll.Dict "directory" $k "data" $v }}
{{- if not (index .data "deprecated") }}
{{- if eq .data.environment "rhtap" }}
{{- template "rhtap" . }}
{{- if eq .data.environment "konflux" }}
{{- template "konflux" . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

## Red Hat Trusted Application Pipeline - Tasks
## Konflux CI & Red Hat Trusted Application Pipeline (RHTAP) - Tasks

These are policy rules used to verify Tekton Task definitions meet the Red Hat guidelines for being
considered trusted.
Expand All @@ -32,8 +32,8 @@ The policy configuration files are:
{{ range $k, $v := ds "data" }}
{{- with coll.Dict "directory" $k "data" $v }}
{{- if not (index .data "deprecated") }}
{{- if eq .data.environment "rhtap-tasks" }}
{{- template "rhtap-tasks" . }}
{{- if eq .data.environment "konflux-tasks" }}
{{- template "konflux-tasks" . }}
{{- end }}
{{- end }}
{{- end }}
Expand All @@ -55,4 +55,4 @@ the following policy configurations.
## See also

* [Policy Rule Documentation](https://enterprisecontract.dev/docs/ec-policies/release_policy.html)
* [Getting Started with Enterprise Contract &amp; Red Hat Trusted Application Pipeline](https://enterprisecontract.dev/docs/user-guide/main/getting-started.html)
* [Getting Started with Enterprise Contract &amp; Konflux CI](https://enterprisecontract.dev/docs/user-guide/main/getting-started.html)
22 changes: 11 additions & 11 deletions src/data.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"default": {
"name": "Default",
"description": "Includes rules for levels 1, 2 & 3 of SLSA v0.1. This is the default config used for new RHTAP applications.",
"environment": "rhtap",
"description": "Includes rules for levels 1, 2 & 3 of SLSA v0.1. This is the default config used for new Konflux applications.",
"environment": "konflux",
"include": ["@slsa3"],
"exclude": []
},
"minimal": {
"name": "Minimal (deprecated)",
"description": "Includes a set of basic checks that are expected to pass for all RHTAP builds.",
"environment": "rhtap",
"description": "Includes a set of basic checks that are expected to pass for all Konflux builds.",
"environment": "konflux",
"include": ["@minimal"],
"exclude": [],
"deprecated": true
},
"redhat": {
"name": "Red Hat",
"description": "Includes the full set of rules and policies required internally by Red Hat when building Red Hat products.",
"environment": "rhtap",
"environment": "konflux",
"include": ["@redhat"],
"exclude": []
},
"redhat-no-hermetic": {
"name": "Red Hat (non hermetic)",
"description": "Includes most of the rules and policies required internally by Red Hat when building Red Hat products. It excludes the requirement of hermetic builds.",
"environment": "rhtap",
"environment": "konflux",
"include": ["@redhat"],
"exclude": [
"hermetic_build_task",
Expand All @@ -33,22 +33,22 @@
},
"slsa3": {
"name": "SLSA3",
"description": "Rules specifically related to levels 1, 2 & 3 of SLSA v0.1, plus a set of basic checks that are expected to pass for all RHTAP builds.",
"environment": "rhtap",
"description": "Rules specifically related to levels 1, 2 & 3 of SLSA v0.1, plus a set of basic checks that are expected to pass for all Konflux builds.",
"environment": "konflux",
"include": ["@minimal", "@slsa3"],
"exclude": []
},
"everything": {
"name": "Everything (experimental)",
"description": "Include every rule in the default policy source. For experiments only. This is not expected to pass for RHTAP builds without excluding some rules.",
"environment": "rhtap",
"description": "Include every rule in the default policy source. For experiments only. This is not expected to pass for Konflux builds without excluding some rules.",
"environment": "konflux",
"include": ["*"],
"exclude": []
},
"redhat-trusted-tasks": {
"name": "Red Hat Trusted Tasks",
"description": "Rules used to verify Tekton Task definitions comply to Red Hat's standards.",
"environment": "rhtap-tasks",
"environment": "konflux-tasks",
"include": ["kind"],
"exclude": []
},
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# --public-key key.pub \
# --policy github.com/enterprise-contract/config//{{ $.directory }}
#
# To use with an RHTAP Enterprise Contract Integration Test CR:
# To use with an Konflux Enterprise Contract Integration Test CR:
# ...
# spec:
# params:
Expand Down
Loading

0 comments on commit eb2da5b

Please sign in to comment.