-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactors the `src/data.json` to be an object instead of an array, this way the keys are guaranteed to be unique. Separates the notion of the directory vs name, now the directory (key in the top level object) can be different than the name. Ref. https://issues.redhat.com/browse/HACBS-2468
- Loading branch information
Showing
18 changed files
with
91 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
### {{ .name | strings.Title | regexp.Replace "Github" "GitHub" | regexp.Replace "-" " "}} | ||
{{ with .data }} | ||
### {{ .name }} | ||
|
||
{{ .description }} | ||
|
||
* URL for Enterprise Contract: `github.com/enterprise-contract/config//{{ .name }}` | ||
* Source: [{{ .name }}/policy.yaml](https://github.com/enterprise-contract/config/blob/main/{{ .name }}/policy.yaml) | ||
* URL for Enterprise Contract: `github.com/enterprise-contract/config//{{ $.directory }}` | ||
* Source: [{{ $.directory }}/policy.yaml](https://github.com/enterprise-contract/config/blob/main/{{ $.directory }}/policy.yaml) | ||
* Collections:{{ $comma := false }}{{ range .include -}} | ||
{{- if strings.HasPrefix "@" . -}} | ||
{{- if not $comma }}{{ $comma = true }} {{ else }}, {{ end -}} | ||
[{{ . }}](https://enterprisecontract.dev/docs/ec-policies/release_policy.html#{{ strings.TrimPrefix "@" . }}) | ||
{{- end -}} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,68 @@ | ||
[ | ||
{ | ||
"name": "default", | ||
{ | ||
"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", | ||
"include": ["@slsa1", "@slsa2", "@slsa3"], | ||
"exclude": [] | ||
}, | ||
{ | ||
"name": "minimal", | ||
"minimal": { | ||
"name": "Minimal (deprecated)", | ||
"description": "Includes a set of basic checks that are expected to pass for all RHTAP builds.", | ||
"environment": "rhtap", | ||
"include": ["@minimal"], | ||
"exclude": [], | ||
"deprecated": true | ||
}, | ||
{ | ||
"name": "redhat", | ||
"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", | ||
"include": ["@redhat"], | ||
"exclude": [] | ||
}, | ||
{ | ||
"name": "redhat-no-hermetic", | ||
"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", | ||
"include": ["@redhat"], | ||
"exclude": ["hermetic_build_task", "tasks.required_tasks_found:prefetch-dependencies"] | ||
}, | ||
{ | ||
"name": "slsa1", | ||
"slsa1": { | ||
"name": "SLSA1 (deprecated)", | ||
"description": "Rules specifically related to levels 1 of SLSA v0.1, plus a set of basic checks that are expected to pass for all RHTAP builds.", | ||
"environment": "rhtap", | ||
"include": ["@minimal", "@slsa1"], | ||
"exclude": [], | ||
"deprecated": true | ||
}, | ||
{ | ||
"name": "slsa2", | ||
"slsa2": { | ||
"name": "SLSA2 (deprecated)", | ||
"description": "Rules specifically related to levels 1 & 2 of SLSA v0.1, plus a set of basic checks that are expected to pass for all RHTAP builds.", | ||
"environment": "rhtap", | ||
"include": ["@minimal", "@slsa1", "@slsa2"], | ||
"exclude": [], | ||
"deprecated": true | ||
}, | ||
{ | ||
"name": "slsa3", | ||
"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", | ||
"include": ["@minimal", "@slsa1", "@slsa2", "@slsa3"], | ||
"exclude": [] | ||
}, | ||
{ | ||
"name": "everything", | ||
"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", | ||
"include": ["*"], | ||
"exclude": [] | ||
}, | ||
{ | ||
"name": "github-default", | ||
"github-default": { | ||
"name": "GitHub Default", | ||
"description": "Rules for container images built via GitHub Workflows.", | ||
"environment": "github", | ||
"include": ["@github"], | ||
"exclude": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
{{- $name := .Env.NAME -}} | ||
{{- range ds "data" -}} | ||
{{- if eq .name $name -}} | ||
{{- if eq .environment "rhtap" -}} | ||
{{ template "rhtap" . }} | ||
{{- else -}} | ||
{{ template "github" . }} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end }} | ||
{{- range $key, $data := ds "data" }} | ||
{{- if eq $key $name }} | ||
{{- with coll.Dict "directory" $key "data" $data }} | ||
{{- if eq .data.environment "rhtap" }} | ||
{{- template "rhtap" . }} | ||
{{- else }} | ||
{{- template "github" . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |