This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-helm-chart.git
The following commit(s) were added to refs/heads/master by this push:
new 3a6c811 Replace go based license check with Apache RAT
3a6c811 is described below
commit 3a6c811671d0631d814b44c2291eb7aad5dee887
Author: Lari Hotari <[email protected]>
AuthorDate: Tue Apr 21 09:39:50 2026 +0300
Replace go based license check with Apache RAT
---
.github/workflows/pulsar-helm-chart-ci.yaml | 14 ++--
.rat-excludes | 4 +-
license_test.go | 114 ----------------------------
3 files changed, 10 insertions(+), 122 deletions(-)
diff --git a/.github/workflows/pulsar-helm-chart-ci.yaml
b/.github/workflows/pulsar-helm-chart-ci.yaml
index 65b87fb..8cd9489 100644
--- a/.github/workflows/pulsar-helm-chart-ci.yaml
+++ b/.github/workflows/pulsar-helm-chart-ci.yaml
@@ -67,18 +67,18 @@ jobs:
timeout-minutes: 10
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
steps:
- - name: Set up Go 1.12
- uses: actions/setup-go@v6
+ - name: Set up Java
+ uses: actions/setup-java@v5
with:
- go-version: 1.12
- id: go
+ distribution: 'temurin'
+ java-version: '21'
- - name: Check out code into the Go module directory
+ - name: Check out code
uses: actions/checkout@v6
- - name: Check license
+ - name: Check license headers with Apache RAT
run: |
- go test license_test.go
+ curl -Ls https://sh.jbang.dev | bash -s - run
org.apache.rat:apache-rat:0.18 . -E .rat-excludes
# run "ct lint"
https://github.com/helm/chart-testing/blob/main/doc/ct_lint.md
ct-lint:
diff --git a/.rat-excludes b/.rat-excludes
index e1eaa79..fe25007 100644
--- a/.rat-excludes
+++ b/.rat-excludes
@@ -17,4 +17,6 @@
.gitignore
# Generated Helm file
-Chart.lock
+charts/pulsar/Chart.lock
+# installation notice file
+charts/pulsar/templates/NOTES.txt
diff --git a/license_test.go b/license_test.go
deleted file mode 100644
index 54ae128..0000000
--- a/license_test.go
+++ /dev/null
@@ -1,114 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package main
-
-import (
- "io/ioutil"
- "os"
- "path/filepath"
- "regexp"
- "testing"
-)
-
-var goFileCheck = regexp.MustCompile(`// Licensed to the Apache Software
Foundation \(ASF\) under one
-// or more contributor license agreements\. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership\. The ASF licenses this file
-// to you under the Apache License, Version 2\.0 \(the
-// "License"\); you may not use this file except in compliance
-// with the License\. You may obtain a copy of the License at
-//
-// http://www\.apache\.org/licenses/LICENSE-2\.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied\. See the License for the
-// specific language governing permissions and limitations
-// under the License\.
-
-`)
-
-var otherCheck = regexp.MustCompile(`#
-# Licensed to the Apache Software Foundation \(ASF\) under one
-# or more contributor license agreements\. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership\. The ASF licenses this file
-# to you under the Apache License, Version 2\.0 \(the
-# "License"\); you may not use this file except in compliance
-# with the License\. You may obtain a copy of the License at
-#
-# http://www\.apache\.org/licenses/LICENSE-2\.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied\. See the License for the
-# specific language governing permissions and limitations
-# under the License\.
-#
-`)
-
-var skip = map[string]bool{}
-
-func TestLicense(t *testing.T) {
- err := filepath.Walk(".", func(path string, fi os.FileInfo, err error)
error {
- if skip[path] {
- return nil
- }
-
- if err != nil {
- return err
- }
-
- switch filepath.Ext(path) {
- case ".go":
- src, err := ioutil.ReadFile(path)
- if err != nil {
- return nil
- }
-
- // Find license
- if !goFileCheck.Match(src) {
- t.Errorf("%v: license header not present", path)
- return nil
- }
- case ".yaml":
- fallthrough
- case ".conf":
- src, err := ioutil.ReadFile(path)
- if err != nil {
- return nil
- }
-
- // Find license
- if !otherCheck.Match(src) {
- t.Errorf("%v: license header not present", path)
- return nil
- }
-
- default:
- return nil
- }
-
- return nil
- })
- if err != nil {
- t.Fatal(err)
- }
-}