This is an automated email from the ASF dual-hosted git repository. luky116 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-seata-go.git
The following commit(s) were added to refs/heads/master by this push: new 86b8d920 optimize: update license checker (#756) 86b8d920 is described below commit 86b8d920d77c9352ed8f232253116c4927e465c3 Author: jimin <sliev...@163.com> AuthorDate: Mon Jan 6 23:23:20 2025 +0800 optimize: update license checker (#756) * optimize: update license checker --- .github/workflows/license.yml | 21 +++++++----- .licenserc.yaml | 22 +++---------- VERSION | 2 +- go.sum | 2 -- licenses/LICENSE.tpl | 9 +++++ .../sql/undo/parser/branch_undo_log.proto | 17 ++++++++++ pkg/discovery/etcd3_test.go | 17 ++++++++++ pkg/discovery/mock/test_etcd_client.go | 17 ++++++++++ testdata/dockercompose/mysql/mysqld.cnf | 38 ++++++++-------------- testdata/sql/all_in_one.sql | 30 ++++++++--------- testdata/sql/undo_log.sql | 15 +++++++++ 11 files changed, 120 insertions(+), 70 deletions(-) diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml index 68e83a64..4f3195dd 100644 --- a/.github/workflows/license.yml +++ b/.github/workflows/license.yml @@ -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 @@ -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: @@ -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: | diff --git a/.licenserc.yaml b/.licenserc.yaml index 23e96967..0bab631f 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -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: diff --git a/VERSION b/VERSION index 8a9ecc2e..359a5b95 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.1 \ No newline at end of file +2.0.0 \ No newline at end of file diff --git a/go.sum b/go.sum index 6deb6be9..cd6b4f5b 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/licenses/LICENSE.tpl b/licenses/LICENSE.tpl new file mode 100644 index 00000000..7ff3ca71 --- /dev/null +++ b/licenses/LICENSE.tpl @@ -0,0 +1,9 @@ +{{.LicenseContent }} +{{ range .Groups }} +======================================================================== +{{.LicenseID}} licenses +======================================================================== +{{range .Deps}} +{{.Name}} {{.Version}} {{.LicenseID}} +{{- end }} +{{ end }} \ No newline at end of file diff --git a/pkg/datasource/sql/undo/parser/branch_undo_log.proto b/pkg/datasource/sql/undo/parser/branch_undo_log.proto index 9055ea10..56cd39e9 100644 --- a/pkg/datasource/sql/undo/parser/branch_undo_log.proto +++ b/pkg/datasource/sql/undo/parser/branch_undo_log.proto @@ -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"; diff --git a/pkg/discovery/etcd3_test.go b/pkg/discovery/etcd3_test.go index 131cd0bb..7c9c59fb 100644 --- a/pkg/discovery/etcd3_test.go +++ b/pkg/discovery/etcd3_test.go @@ -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 ( diff --git a/pkg/discovery/mock/test_etcd_client.go b/pkg/discovery/mock/test_etcd_client.go index d780e0ea..e7cc5fc0 100644 --- a/pkg/discovery/mock/test_etcd_client.go +++ b/pkg/discovery/mock/test_etcd_client.go @@ -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" diff --git a/testdata/dockercompose/mysql/mysqld.cnf b/testdata/dockercompose/mysql/mysqld.cnf index ba7b3bcb..b2f2584d 100644 --- a/testdata/dockercompose/mysql/mysqld.cnf +++ b/testdata/dockercompose/mysql/mysqld.cnf @@ -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 diff --git a/testdata/sql/all_in_one.sql b/testdata/sql/all_in_one.sql index b9a4e30a..a8374aab 100644 --- a/testdata/sql/all_in_one.sql +++ b/testdata/sql/all_in_one.sql @@ -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` diff --git a/testdata/sql/undo_log.sql b/testdata/sql/undo_log.sql index 7a00b709..d975d1da 100644 --- a/testdata/sql/undo_log.sql +++ b/testdata/sql/undo_log.sql @@ -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` ( --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org