Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kie-issues#1613: Add CI :: License headers / check GitHub Actions workflow #2111

Merged
merged 15 commits into from
Nov 30, 2024
Merged
40 changes: 40 additions & 0 deletions .github/workflows/ci_check_license_headers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# 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.
#

name: "CI :: License headers"

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download Apache RAT
run: |
curl -LO https://repo1.maven.org/maven2/org/apache/rat/apache-rat/0.16.1/apache-rat-0.16.1.jar
- name: Run Apache RAT
run: |
java -jar apache-rat-0.16.1.jar -d . -E .rat-excludes | grep "== File:" && echo "The files listed above are missing license headers." && exit 1 || echo "All files have license headers."
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ package-lock.json
/cypress*

.factorypath

# Apache RAT check excludes file
!.rat-excludes
98 changes: 98 additions & 0 deletions .rat-excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# .rat-excludes
.rat-excludes
# DISCLAIMER-WIP
DISCLAIMER-WIP
# apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-common/src/main/resources/approval.bpmn
approval.bpmn
# apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/main/resources/META-INF/processSVG/approvals.svg
approvals.svg
# apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/resources/approval.bpmn
approval.bpmn
# apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/resources/org/acme/processes/MultipleTimerInstancesBoundaryTimerEvent.bpmn
MultipleTimerInstancesBoundaryTimerEvent.bpmn
# apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/resources/org/acme/processes/MultipleTimerInstancesTimerEvent.bpmn
MultipleTimerInstancesTimerEvent.bpmn
# apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/resources/org/acme/travels/async.bpmn
async.bpmn
# apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/resources/org/acme/travels/timer-on-task.bpmn
timer-on-task.bpmn
# apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/resources/org/acme/travels/timers.bpmn
timers.bpmn
# apps-integration-tests/integration-tests-jobs-service/integration-tests-jobs-service-common/src/main/resources/org/acme/travels/timersCycle.bpmn
timersCycle.bpmn
# apps-integration-tests/integration-tests-trusty-service/integration-tests-trusty-service-common/src/main/resources/TrafficViolation.dmn
TrafficViolation.dmn
# data-audit/data-audit-common/src/main/resources/META-INF/data-audit-job-query.graphqls
data-audit-job-query.graphqls
# data-audit/data-audit-common/src/main/resources/META-INF/data-audit-process-query.graphqls
data-audit-process-query.graphqls
# data-audit/data-audit-common/src/main/resources/META-INF/data-audit-types.graphqls
data-audit-types.graphqls
# data-audit/data-audit-common/src/main/resources/META-INF/data-audit-usertask-query.graphqls
data-audit-usertask-query.graphqls
# data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/META-INF/data-audit-orm.xml
data-audit-orm.xml
# data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/META-INF/services/org.kie.kogito.app.audit.spi.DataAuditStore
org.kie.kogito.app.audit.spi.DataAuditStore
# data-audit/kogito-addons-data-audit-jpa/kogito-addons-data-audit-jpa-common/src/main/resources/META-INF/services/org.kie.kogito.app.audit.spi.GraphQLSchemaQueryProvider
org.kie.kogito.app.audit.spi.GraphQLSchemaQueryProvider
# data-audit/kogito-addons-data-audit-springboot/src/test/resources/application.properties
application.properties
# data-index/data-index-graphql/src/main/resources/basic.schema.graphqls
basic.schema.graphqls
# data-index/data-index-service/data-index-service-common/src/main/resources/domain.schema.graphqls
domain.schema.graphqls
# data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-infinispan/integration-tests-process/src/main/resources/hello.bpmn
hello.bpmn
# data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-infinispan/integration-tests-process/src/main/resources/META-INF/processSVG/hello.svg
hello.svg
# data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-inmemory/integration-tests-process/src/main/resources/hello.bpmn
hello.bpmn
# data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-inmemory/integration-tests-process/src/main/resources/META-INF/processSVG/hello.svg
hello.svg
# data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-jpa/integration-tests-process/src/main/resources/hello.bpmn
hello.bpmn
# data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-jpa/integration-tests-process/src/main/resources/META-INF/processSVG/hello.svg
hello.svg
# data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/integration-tests-process/src/main/resources/hello.bpmn
hello.bpmn
# data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-mongodb/integration-tests-process/src/main/resources/META-INF/processSVG/hello.svg
hello.svg
# data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-postgresql/integration-tests-process/src/main/resources/hello.bpmn
hello.bpmn
# data-index/kogito-addons-quarkus-data-index/kogito-addons-quarkus-data-index-postgresql/integration-tests-process/src/main/resources/META-INF/processSVG/hello.svg
hello.svg
# data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-infinispan/integration-tests-process/src/main/resources/hello.bpmn
hello.bpmn
# data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-jpa/integration-tests-process/src/main/resources/hello.bpmn
hello.bpmn
# data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-jpa/integration-tests-process/src/main/resources/META-INF/processSVG/hello.svg
hello.svg
# data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-mongodb/integration-tests-process/src/main/resources/hello.bpmn
hello.bpmn
# data-index/kogito-addons-quarkus-data-index-persistence/kogito-addons-quarkus-data-index-persistence-postgresql/integration-tests-process/src/main/resources/hello.bpmn
hello.bpmn
# explainability/explainability-service/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
org.mockito.plugins.MockMaker
# jitexecutor/jitexecutor-bpmn/src/test/resources/MultipleInvalidModel.bpmn2
MultipleInvalidModel.bpmn2
# jitexecutor/jitexecutor-bpmn/src/test/resources/MultipleProcess.bpmn2
MultipleProcess.bpmn2
# jitexecutor/jitexecutor-bpmn/src/test/resources/SingleInvalidModel.bpmn2
SingleInvalidModel.bpmn2
# jitexecutor/jitexecutor-bpmn/src/test/resources/SingleProcess.bpmn
SingleProcess.bpmn
# jitexecutor/jitexecutor-bpmn/src/test/resources/SingleProcess.bpmn2
SingleProcess.bpmn2
# jitexecutor/jitexecutor-bpmn/src/test/resources/SingleUnparsableModel.bpmn2
SingleUnparsableModel.bpmn2
# jitexecutor/jitexecutor-bpmn/src/test/resources/UnparsableModel.bpmn2
UnparsableModel.bpmn2
# jitexecutor/jitexecutor-bpmn/src/test/resources/ValidModel.bpmn
ValidModel.bpmn
# jobs-service/kogito-addons-jobs-service/kogito-addons-quarkus-jobs/src/test/resources/application.properties
application.properties
# jobs-service/kogito-addons-jobs-service/kogito-addons-quarkus-jobs-service-embedded/runtime/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSource
org.eclipse.microprofile.config.spi.ConfigSource
# trusty/trusty-service/trusty-service-common/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
org.mockito.plugins.MockMaker
5 changes: 5 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,8 @@
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.

---------------------------------------------------------------------------------
for ./jitexecutor/jitexecutor-dmn/src/main/resources/META-INF/resources/bundle.js

TODO check facebook thing
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really not sure about this file, it contains so much:

/*
 * 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.
 */
 
/*!
  Copyright (c) 2017 Jed Watson.
  Licensed under the MIT License (MIT), see
  http://jedwatson.github.io/classnames
  
/*
object-assign
(c) Sindre Sorhus
@license MIT

/** @license React v16.14.0
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 
/** @license React v16.14.0
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 
/** @license React v0.19.1
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.

** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.

/** @license URI.js v4.4.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */

Copy link
Contributor

@tkobayas tkobayas Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be a combined js. I don't know what reviewers will say, but I hope it's not a blocker.

I think you can list the copyright [Sindre Sorhus, Jed Watson, Meta(Facebook), Gary Court] and license [MIT, BSD 2-clause].

FYI)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on what @tkobayas said about Facebook -> Meta Platforms

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I'm not too deep into this project ... generally the "Licensed to the Apache Software" foundation header should only be used if it contains a significant amount of content from an Apache project and not simply stuff that's licensed under the Apache 2.0 license.

Do I understand it correctly, that ./jitexecutor/jitexecutor-dmn/src/main/resources/META-INF/resources/bundle.js contains resources from various sources? Usually in such a case it would be good to mention which parts are taken from which project and which license they are under. Would that be possible? Because otherwise it's not really possible to correctly find out which code is licensed under which license.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you all for inputs and comments. before we proceed with adding the bundle.js entry into LICENSE, I opened internal slack conversation about dropping it from the codebase. It is basically used in small demo webapp, that has actually an alternative in using curl commands or swagger-ui endpoints documentation. From my point of view, there is a chance we drop it.

If slack conversation will give me a green light for it, I can inform about it also using Apache mailing list, and if there is no objection, we can remove it.

If not, yes, we will need to figure out proper licensing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jomarko please use public channels, ML is supposed for that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great if we can drop it.

Btw, @pjfanning @chrisdutz Am I right to assume that this bundle.js issue is not a blocker for 10.0.0 because the file is MIT and BSD which are Category A, so not hitting "Blocker" in https://issues.apache.org/jira/browse/LEGAL-469 ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not blocker but the getting the LICENSE text right is needed eventually

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the LICENSE entry for the bundle.js

Potential bundle.js removal will be handled in a separate ticket.

2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

The Initial Developer of some parts of the framework, which are copied from, derived from, or
inspired by KIE (Knowledge Is Everthing) group, is Red Hat, Inc (https://www.redhat.com/).
inspired by KIE (Knowledge Is Everything) group, is Red Hat, Inc (https://www.redhat.com/).
Copyright Red Hat, Inc. and/or its affiliates.. All Rights Reserved.
Loading