Skip to content

Commit

Permalink
optimize: update license checker (#756)
Browse files Browse the repository at this point in the history
* optimize: update license checker
  • Loading branch information
slievrly authored Jan 6, 2025
1 parent f2587d2 commit 86b8d92
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 70 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
# limitations under the License.
#

name: CI
name: License checker

on:
pull_request:
branches: [ master ]
schedule:
- cron: "0 18 * * *" # TimeZone: UTC 0

Expand All @@ -33,10 +34,13 @@ jobs:
submodules: true
- name: Check license header
uses: apache/skywalking-eyes@985866ce7e324454f61e22eb2db2e998db09d6f3
with:
log: info
config: .licenserc.yaml
mode: check

dependency-license:
name: Dependency licenses
needs: [changes]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand All @@ -46,15 +50,16 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: "1.20"
- name: Check Dependencies Licenses
run: |
mkdir -p ./dist-material/
cp ./licenses/LICENSE.tpl ./dist-material/LICENSE.tpl
go install github.com/apache/skywalking-eyes/cmd/license-eye@47febf5
license-eye dependency resolve --summary ./dist-material/release-docs/LICENSE.tpl || exit 1
if [ ! -z "$(git diff -U0 ./dist-material/release-docs/LICENSE)" ]; then
echo "LICENSE file is not updated correctly"
git diff -U0 ./dist-material/release-docs/LICENSE
exit 1
license-eye dependency resolve --summary ./dist-material/LICENSE.tpl || exit 1
if [ -f "./dist-material/LICENSE)" ]; then
echo "echo LICENSE check"
cat ./dist-material/LICENSE
fi
- name: Check Dependencies Licenses Invalid
run: |
Expand Down
22 changes: 4 additions & 18 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,34 +54,20 @@ header: # `header` section is configurations for source codes license header.
- '**'

paths-ignore: # `paths-ignore` are the path list that will be ignored by license-eye.
- 'dist'
- 'dist-material/**'
- 'licenses'
- '**/*.md'
- '**/testdata/**'
- '**/go.mod'
- '**/go.sum'
- 'LICENSE'
- 'NOTICE'
- '**/assets/header-templates/**'
- '**/assets/lcs-templates/**'
- '**/assets/languages.yaml'
- '**/assets/assets.gen.go'
- 'docs/**.svg'
- '.travis.yml'
- '.gitignore'
- '.gitmodules'
- 'makefile'
- 'justfile'
- 'docker'
- 'pkg/resolver/mysql/constants.go' # with two license: apache and Vitess
- 'pkg/resolver/mysql/encoding.go'
- 'pkg/resolver/mysql/sql_error.go'
- 'pkg/resolver/mysql/type.go'
- 'VERSION'
- ".errcheck-exclude"
- ".golangci.yml"
- '.pre-commit-config.yaml'
- '.github'
- 'DISCLAIMER'
- 'pkg/discovery/mock/mock_etcd_client.go'
- 'pkg/datasource/sql/undo/parser/branch_undo_log.pb.go'
comment: on-failure # on what condition license-eye will comment on the pull request, `on-failure`, `always`, `never`.

language:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
2.0.0
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/
github.com/Workiva/go-datastructures v1.0.52 h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9abU0yMQt0NI=
github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA=
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
github.com/agiledragon/gomonkey/v2 v2.11.0 h1:5oxSgA+tC1xuGsrIorR+sYiziYltmJyEZ9qA25b6l5U=
github.com/agiledragon/gomonkey/v2 v2.11.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
github.com/agiledragon/gomonkey/v2 v2.12.0 h1:ek0dYu9K1rSV+TgkW5LvNNPRWyDZVIxGMCFI6Pz9o38=
github.com/agiledragon/gomonkey/v2 v2.12.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
Expand Down
9 changes: 9 additions & 0 deletions licenses/LICENSE.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{.LicenseContent }}
{{ range .Groups }}
========================================================================
{{.LicenseID}} licenses
========================================================================
{{range .Deps}}
{{.Name}} {{.Version}} {{.LicenseID}}
{{- end }}
{{ end }}
17 changes: 17 additions & 0 deletions pkg/datasource/sql/undo/parser/branch_undo_log.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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.
*/

syntax = "proto3";
package parser;
import "google/protobuf/any.proto";
Expand Down
17 changes: 17 additions & 0 deletions pkg/discovery/etcd3_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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 discovery

import (
Expand Down
17 changes: 17 additions & 0 deletions pkg/discovery/mock/test_etcd_client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* 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 mock

import "go.etcd.io/etcd/client/v3"
Expand Down
38 changes: 13 additions & 25 deletions testdata/dockercompose/mysql/mysqld.cnf
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
# 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
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
# http://www.apache.org/licenses/LICENSE-2.0
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# 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.

#
# The MySQL Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
#log-error = /var/log/mysql/error.log
log-error = /var/log/mysql/error.log
# By default we only accept connections from localhost
bind-address = 0.0.0.0
# Disabling symbolic-links is recommended to prevent assorted security risks
Expand Down
30 changes: 14 additions & 16 deletions testdata/sql/all_in_one.sql
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* 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.
*/
-- 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.

DROP TABLE IF EXISTS `stock_tbl`;
CREATE TABLE `stock_tbl`
Expand Down
15 changes: 15 additions & 0 deletions testdata/sql/undo_log.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
-- 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.

DROP TABLE IF EXISTS `undo_log`;
CREATE TABLE `undo_log`
(
Expand Down

0 comments on commit 86b8d92

Please sign in to comment.