Skip to content

Commit 86b8d92

Browse files
authored
optimize: update license checker (#756)
* optimize: update license checker
1 parent f2587d2 commit 86b8d92

File tree

11 files changed

+120
-70
lines changed

11 files changed

+120
-70
lines changed

.github/workflows/license.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
# limitations under the License.
1616
#
1717

18-
name: CI
18+
name: License checker
1919

2020
on:
2121
pull_request:
22+
branches: [ master ]
2223
schedule:
2324
- cron: "0 18 * * *" # TimeZone: UTC 0
2425

@@ -33,10 +34,13 @@ jobs:
3334
submodules: true
3435
- name: Check license header
3536
uses: apache/skywalking-eyes@985866ce7e324454f61e22eb2db2e998db09d6f3
37+
with:
38+
log: info
39+
config: .licenserc.yaml
40+
mode: check
3641

3742
dependency-license:
3843
name: Dependency licenses
39-
needs: [changes]
4044
runs-on: ubuntu-latest
4145
timeout-minutes: 30
4246
steps:
@@ -46,15 +50,16 @@ jobs:
4650
- name: Setup Go
4751
uses: actions/setup-go@v3
4852
with:
49-
go-version: "1.18"
53+
go-version: "1.20"
5054
- name: Check Dependencies Licenses
5155
run: |
56+
mkdir -p ./dist-material/
57+
cp ./licenses/LICENSE.tpl ./dist-material/LICENSE.tpl
5258
go install github.com/apache/skywalking-eyes/cmd/license-eye@47febf5
53-
license-eye dependency resolve --summary ./dist-material/release-docs/LICENSE.tpl || exit 1
54-
if [ ! -z "$(git diff -U0 ./dist-material/release-docs/LICENSE)" ]; then
55-
echo "LICENSE file is not updated correctly"
56-
git diff -U0 ./dist-material/release-docs/LICENSE
57-
exit 1
59+
license-eye dependency resolve --summary ./dist-material/LICENSE.tpl || exit 1
60+
if [ -f "./dist-material/LICENSE)" ]; then
61+
echo "echo LICENSE check"
62+
cat ./dist-material/LICENSE
5863
fi
5964
- name: Check Dependencies Licenses Invalid
6065
run: |

.licenserc.yaml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,34 +54,20 @@ header: # `header` section is configurations for source codes license header.
5454
- '**'
5555

5656
paths-ignore: # `paths-ignore` are the path list that will be ignored by license-eye.
57-
- 'dist'
57+
- 'dist-material/**'
5858
- 'licenses'
5959
- '**/*.md'
60-
- '**/testdata/**'
6160
- '**/go.mod'
6261
- '**/go.sum'
6362
- 'LICENSE'
6463
- 'NOTICE'
65-
- '**/assets/header-templates/**'
66-
- '**/assets/lcs-templates/**'
67-
- '**/assets/languages.yaml'
68-
- '**/assets/assets.gen.go'
69-
- 'docs/**.svg'
70-
- '.travis.yml'
7164
- '.gitignore'
72-
- '.gitmodules'
7365
- 'makefile'
74-
- 'justfile'
75-
- 'docker'
76-
- 'pkg/resolver/mysql/constants.go' # with two license: apache and Vitess
77-
- 'pkg/resolver/mysql/encoding.go'
78-
- 'pkg/resolver/mysql/sql_error.go'
79-
- 'pkg/resolver/mysql/type.go'
8066
- 'VERSION'
81-
- ".errcheck-exclude"
82-
- ".golangci.yml"
83-
- '.pre-commit-config.yaml'
8467
- '.github'
68+
- 'DISCLAIMER'
69+
- 'pkg/discovery/mock/mock_etcd_client.go'
70+
- 'pkg/datasource/sql/undo/parser/branch_undo_log.pb.go'
8571
comment: on-failure # on what condition license-eye will comment on the pull request, `on-failure`, `always`, `never`.
8672

8773
language:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.1
1+
2.0.0

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/
5454
github.com/Workiva/go-datastructures v1.0.52 h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9abU0yMQt0NI=
5555
github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA=
5656
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
57-
github.com/agiledragon/gomonkey/v2 v2.11.0 h1:5oxSgA+tC1xuGsrIorR+sYiziYltmJyEZ9qA25b6l5U=
58-
github.com/agiledragon/gomonkey/v2 v2.11.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
5957
github.com/agiledragon/gomonkey/v2 v2.12.0 h1:ek0dYu9K1rSV+TgkW5LvNNPRWyDZVIxGMCFI6Pz9o38=
6058
github.com/agiledragon/gomonkey/v2 v2.12.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
6159
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=

licenses/LICENSE.tpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{.LicenseContent }}
2+
{{ range .Groups }}
3+
========================================================================
4+
{{.LicenseID}} licenses
5+
========================================================================
6+
{{range .Deps}}
7+
{{.Name}} {{.Version}} {{.LicenseID}}
8+
{{- end }}
9+
{{ end }}

pkg/datasource/sql/undo/parser/branch_undo_log.proto

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
syntax = "proto3";
219
package parser;
320
import "google/protobuf/any.proto";

pkg/discovery/etcd3_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package discovery
219

320
import (

pkg/discovery/mock/test_etcd_client.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package mock
219

320
import "go.etcd.io/etcd/client/v3"

testdata/dockercompose/mysql/mysqld.cnf

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,24 @@
1-
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
27
#
3-
# This program is free software; you can redistribute it and/or modify
4-
# it under the terms of the GNU General Public License, version 2.0,
5-
# as published by the Free Software Foundation.
8+
# http://www.apache.org/licenses/LICENSE-2.0
69
#
7-
# This program is also distributed with certain software (including
8-
# but not limited to OpenSSL) that is licensed under separate terms,
9-
# as designated in a particular file or component or in included license
10-
# documentation. The authors of MySQL hereby grant you an additional
11-
# permission to link the program and your derivative works with the
12-
# separately licensed software that they have included with MySQL.
13-
#
14-
# This program is distributed in the hope that it will be useful,
15-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17-
# GNU General Public License, version 2.0, for more details.
18-
#
19-
# You should have received a copy of the GNU General Public License
20-
# along with this program; if not, write to the Free Software
21-
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
2215

23-
#
24-
# The MySQL Server configuration file.
25-
#
26-
# For explanations see
27-
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
2816

2917
[mysqld]
3018
pid-file = /var/run/mysqld/mysqld.pid
3119
socket = /var/run/mysqld/mysqld.sock
3220
datadir = /var/lib/mysql
33-
#log-error = /var/log/mysql/error.log
21+
log-error = /var/log/mysql/error.log
3422
# By default we only accept connections from localhost
3523
bind-address = 0.0.0.0
3624
# Disabling symbolic-links is recommended to prevent assorted security risks

testdata/sql/all_in_one.sql

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
/*
2-
* Licensed to the Apache Software Foundation (ASF) under one or more
3-
* contributor license agreements. See the NOTICE file distributed with
4-
* this work for additional information regarding copyright ownership.
5-
* The ASF licenses this file to You under the Apache License, Version 2.0
6-
* (the "License"); you may not use this file except in compliance with
7-
* the License. You may obtain a copy of the License at
8-
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
10-
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
16-
*/
1+
-- Licensed to the Apache Software Foundation (ASF) under one or more
2+
-- contributor license agreements. See the NOTICE file distributed with
3+
-- this work for additional information regarding copyright ownership.
4+
-- The ASF licenses this file to You under the Apache License, Version 2.0
5+
-- (the "License"); you may not use this file except in compliance with
6+
-- the License. You may obtain a copy of the License at
7+
--
8+
-- http://www.apache.org/licenses/LICENSE-2.0
9+
--
10+
-- Unless required by applicable law or agreed to in writing, software
11+
-- distributed under the License is distributed on an "AS IS" BASIS,
12+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
-- See the License for the specific language governing permissions and
14+
-- limitations under the License.
1715

1816
DROP TABLE IF EXISTS `stock_tbl`;
1917
CREATE TABLE `stock_tbl`

testdata/sql/undo_log.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
-- Licensed to the Apache Software Foundation (ASF) under one or more
2+
-- contributor license agreements. See the NOTICE file distributed with
3+
-- this work for additional information regarding copyright ownership.
4+
-- The ASF licenses this file to You under the Apache License, Version 2.0
5+
-- (the "License"); you may not use this file except in compliance with
6+
-- the License. You may obtain a copy of the License at
7+
--
8+
-- http://www.apache.org/licenses/LICENSE-2.0
9+
--
10+
-- Unless required by applicable law or agreed to in writing, software
11+
-- distributed under the License is distributed on an "AS IS" BASIS,
12+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
-- See the License for the specific language governing permissions and
14+
-- limitations under the License.
15+
116
DROP TABLE IF EXISTS `undo_log`;
217
CREATE TABLE `undo_log`
318
(

0 commit comments

Comments
 (0)