[bitnami/charts] Automate license checks (#17421)

* [bitnami/charts] Automate license checks

Signed-off-by: Raúl López <rlorpez@vmware.com>
Co-authored-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
This commit is contained in:
Raúl López
2023-07-03 14:21:32 +02:00
committed by GitHub
parent 5492c138a5
commit 8f3d7ef927
5 changed files with 87 additions and 1 deletions

16
.github/workflows/license-headers.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0
---
name: '[License] Check license headers'
on:
pull_request:
jobs:
license-headers-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check license Headers
uses: apache/skywalking-eyes/header@v0.4.0

37
.licenserc.yaml Normal file
View File

@@ -0,0 +1,37 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0
---
header:
# License format for Helm templates
- comment: on-failure
license:
spdx-id: Apache-2.0
copyright-owner: VMware, Inc.
content: |
{{- /*
Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
paths:
- "bitnami/**/templates/**/*.yml"
- "bitnami/**/templates/**/*.yaml"
# License format for all other YAML files
- comment: on-failure
license:
spdx-id: Apache-2.0
copyright-owner: VMware, Inc.
content: |
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0
paths:
- "bitnami/**/*.yml"
- "bitnami/**/*.yaml"
paths-ignore:
- "bitnami/**/templates/**/*.yml"
- "bitnami/**/templates/**/*.yaml"

View File

@@ -18,6 +18,14 @@ When submitting a PR make sure that it:
- Must pass CI jobs for linting and test the changes on top of different k8s platforms. (Automatically done by the Bitnami CI/CD pipeline). - Must pass CI jobs for linting and test the changes on top of different k8s platforms. (Automatically done by the Bitnami CI/CD pipeline).
- Must follow [Helm best practices](https://helm.sh/docs/chart_best_practices/). - Must follow [Helm best practices](https://helm.sh/docs/chart_best_practices/).
- Any change to a chart requires a version bump following [semver](https://semver.org/) principles. This is the version that is going to be merged in the GitHub repository, then our CI/CD system is going to publish in the Helm registry a new patch version including your changes and the latest images and dependencies. - Any change to a chart requires a version bump following [semver](https://semver.org/) principles. This is the version that is going to be merged in the GitHub repository, then our CI/CD system is going to publish in the Helm registry a new patch version including your changes and the latest images and dependencies.
- Any change to a Helm template (especially new templates) must include a license header like the following:
```yaml
{{- /*
Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
```
#### Sign Your Work #### Sign Your Work
@@ -70,10 +78,25 @@ Notice the `Author` and `Signed-off-by` lines match. If they don't your PR will
### Adding a new chart to the repository ### Adding a new chart to the repository
There are three major technical requirements to add a new Helm chart to our catalog: There are five major technical requirements to add a new Helm chart to our catalog:
- The chart should use Bitnami based container images. If they don't exist, you can [open a GitHub issue](https://github.com/bitnami/charts/issues/new/choose) and we will work together to create them. - The chart should use Bitnami based container images. If they don't exist, you can [open a GitHub issue](https://github.com/bitnami/charts/issues/new/choose) and we will work together to create them.
- Follow the same structure/patterns that the rest of the Bitnami charts (you can find a basic scaffolding in the [`template` directory](https://github.com/bitnami/charts/tree/main/template)) and the [Best Practices for Creating Production-Ready Helm charts](https://docs.bitnami.com/tutorials/production-ready-charts/) guide. - Follow the same structure/patterns that the rest of the Bitnami charts (you can find a basic scaffolding in the [`template` directory](https://github.com/bitnami/charts/tree/main/template)) and the [Best Practices for Creating Production-Ready Helm charts](https://docs.bitnami.com/tutorials/production-ready-charts/) guide.
- Use an [OSI approved license](https://opensource.org/licenses) for all the software. - Use an [OSI approved license](https://opensource.org/licenses) for all the software.
- Every new Helm template must include a license header like the following:
```yaml
{{- /*
Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
```
- The exception to the license header rule above are `Chart.yaml` and `values.yaml` files, that use the following format instead:
```yaml
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0
```
Please, note we will need to check internally and evaluate the feasibility of adding the new solution to the catalog. Due to limited resources this step could take some time. Please, note we will need to check internally and evaluate the feasibility of adding the new solution to the catalog. Due to limited resources this step could take some time.

View File

@@ -1,3 +1,8 @@
{{- /*
Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.usersExtraOverrides (not .Values.usersExtraOverridesConfigmap) }} {{- if and .Values.usersExtraOverrides (not .Values.usersExtraOverridesConfigmap) }}
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap

View File

@@ -1,3 +1,8 @@
{{- /*
Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if .Values.proxy.serviceAccount.create }} {{- if .Values.proxy.serviceAccount.create }}
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount