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

EPIC - Replace copyright headers and comments to compliance with ASF policy #413

Closed
20 tasks done
Tracked by #707
eduardocerqueira opened this issue Aug 11, 2023 · 13 comments
Closed
20 tasks done
Tracked by #707
Assignees
Labels
apache:compliance apache:migration Related to Apache Migration

Comments

@eduardocerqueira
Copy link
Member

eduardocerqueira commented Aug 11, 2023

For the full list of repos pls see #428

TASKS

Read the instructions below and find the tasks on this epic.

What is the goal?
As part of migration kie repos to Apache, we need to remove Red Hat's copyrights and apply the ASF header [1], replacing the code header for all files, ideally all files should have ASF header, no matter the file extension.

How?
For Java maven based project, the best alternative is using license-maven-plugin [3] if the repo doesn't follow a maven base project then it is up to you, let your inspiration to drive it, perhaps creating a script would work.

sharing some tips:

  • check the checkstyle configuration from your repo, it might be using the old version header so you may need to update it or update the parent version, see [4] and [5].
  • some of kie.* projects were using the old maven license plugin from codehaus
  • some commands to help:
mvn com.mycila:license-maven-plugin:remove
mvn com.mycila:license-maven-plugin:format
mvn checkstyle:check
grep -R --exclude-dir=target -i "Red Hat" *
grep -R --exclude-dir=target -i -E "copyright|Red Hat"

mvn license:format -Dlicense.header=licensesheader.txt
mvn -Dtest=ServerlessWorkflowCodestartTest test -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -Dsnap

Things to check before submitting your PR

  1. Before changing anyting, ensure you can build and run all tests in your local environment and they pass!
  2. After replacing the headers to ASF [1] and removing Red Hat copyrights ensure your project builds and all tests are passing, so your changes didn't introduce a bug.
  3. Verify checkstyle and do a last check seeking for Red Hat in your project root folder.
mvn checkstyle:check
grep -R --exclude-dir=target -i "Red Hat" *
grep -R --exclude-dir=target -i -E "copyright|Red Hat"

[1] https://www.apache.org/legal/src-headers.html#headers
[2] https://github.com/orgs/apache/projects/295/views/1?pane=issue&itemId=40502472
[3] https://mycila.carbou.me/license-maven-plugin/reports/4.2/license-maven-plugin/plugin-info.html
[4] https://github.com/apache/incubator-kie-kogito-runtimes/blob/main/kogito-build/kogito-build-no-bom-parent/pom.xml#L49
[5] https://github.com/apache/incubator-kie-kogito-runtimes/blob/main/kogito-build/kogito-build-no-bom-parent/pom.xml#L491

@porcelli
Copy link
Contributor

Apache headers reference: https://www.apache.org/legal/src-headers.html

@porcelli porcelli moved this from Todo to In Progress in APACHE migration Aug 15, 2023
@ederign
Copy link
Member

ederign commented Aug 15, 2023

First dry run for ts and js files : https://github.com/kiegroup/kie-tools/pull/1919

@ederign
Copy link
Member

ederign commented Aug 16, 2023

Second round. TS/JS/Java/GO done https://github.com/kiegroup/kie-tools/pull/1920

KIE tools is the most complicated one. As soon as we wrap up it, we can easily do others repositories.

@porcelli splitting in small around of files/projects would mean that we would need 10's of PRs. So I've talked with Tiago, and we will do at least on KIE tools as a single shot.

@porcelli
Copy link
Contributor

It's fine to me;

my concern is that a single PR will be very hard to do a proper review, so basically will end up having to trust the script at some extent.

eduardocerqueira added a commit to eduardocerqueira/kogito-examples that referenced this issue Aug 18, 2023
* added parent pom for all examples under serveless-workflow-examples folder
* temporally renamed pip to pip3
work related to apache/incubator-kie-issues#413
eduardocerqueira added a commit to eduardocerqueira/kogito-examples that referenced this issue Aug 18, 2023
@eduardocerqueira
Copy link
Member Author

Perhaps we need more discussion to find them a better alternative for the code-review. IMO we should rely on CI for validating the changes where I assume it will run checkstyle check, compile and smoke tests

Here is the work I got completed for Kogito-examples repo. I haven't sent a PR yet as I want to get some initial feedback, pls check the commit into my forked/branch:

eduardocerqueira/kogito-examples@4055c97

summary: 1544 files changed

steps:

update licensesheader.txt with content from https://www.apache.org/legal/src-headers.html
mvn com.mycila:license-maven-plugin:remove
mvn com.mycila:license-maven-plugin:format -Dlicense.header=licensesheader.txt

@tiagobento
Copy link

On the KIE Tools side, I'm fine with a huge PR, as long as the CI is green... looking at the CI logs might be a good way to verify that everything is running as intended and the uploaded artifacts are performing as expected...

If someone really wants to skim through the files, I think downloading Eder's branch and opening a local Git tool to see the changes is a valid alternative... With that said, this is NOT how I think code reviews should be done, but since this is a one-time thing, I don't see many problems with it.

@tiagobento tiagobento changed the title Write scripts to replace headers and comments that contains copyrights EPIC - Write scripts to replace copyright headers/comments to Apache Aug 21, 2023
@ederign
Copy link
Member

ederign commented Aug 24, 2023

@eduardocerqueira @porcelli, one topic for the call tomorrow: shall I migrate other repos? Or we are going to split somehow? I saw that @eduardocerqueira started some.

@eduardocerqueira
Copy link
Member Author

Hi @ederign

I got the work done -- but just need to send the PR -- for these repos below:

I was planning to start https://github.com/kiegroup/drools for the next week which my plan is to submit all those PRs by begin of the week.

@ederign
Copy link
Member

ederign commented Aug 25, 2023

ok, I'll take optaplanner and kie benchmarks (Going from the list from bottom )

@ederign
Copy link
Member

ederign commented Aug 30, 2023

FYI: optaplanner doesn't have RHT apache headers: ederign/optaplanner@5868098

@porcelli
Copy link
Contributor

@ederign but optaplanner is moving - @mdproctor correct me if I'm wrong.

@ederign
Copy link
Member

ederign commented Aug 30, 2023

Yes it's moving! I wonder if we should add Apache header for all java files to keep consistency. @mdproctor wdyt?

@eduardocerqueira eduardocerqueira changed the title EPIC - Write scripts to replace copyright headers/comments to Apache EPIC - Replace copyright headers and comments to complain with ASF Sep 15, 2023
@eduardocerqueira eduardocerqueira changed the title EPIC - Replace copyright headers and comments to complain with ASF EPIC - Replace copyright headers and comments to compliance with ASF policy Sep 15, 2023
@eduardocerqueira eduardocerqueira moved this to In Progress in 🦉 KIE Podling Board Oct 3, 2023
@eduardocerqueira eduardocerqueira moved this from In Progress to EPIC in 🦉 KIE Podling Board Oct 3, 2023
@yesamer
Copy link

yesamer commented Jan 17, 2024

All subtasks completed!

@yesamer yesamer closed this as completed Jan 17, 2024
@github-project-automation github-project-automation bot moved this from ⏳ In Progress to 🎯 Done in 🦉 KIE Podling Board Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apache:compliance apache:migration Related to Apache Migration
Projects
Status: 🎯 Done
Development

No branches or pull requests

5 participants