-
Notifications
You must be signed in to change notification settings - Fork 185
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
[DO NOT MERGE][WORK IN PROGRESS]kie-issues#1613: Add CI :: Check license headers
GitHub Actions workflow
#2746
base: main
Are you sure you want to change the base?
Conversation
This is partial fix of the issue apache/incubator-kie-issues#1613 as we open one PR per repository.
.rat-excludes
Outdated
**/META-INF/beans.xml | ||
**/licenses/** | ||
|
||
### kie-tools specific excludes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably most complicated repository we have, what I need from reviewers is to help with finalization of the exclude patterns, once done and we are sure all what is needed is excluded from 'apache-rat-check', I will fix those files == add license there.
.github/workflows/pr-rat-check.yml
Outdated
|
||
- name: Download Apache RAT | ||
run: | | ||
curl -LO https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.17-SNAPSHOT/apache-rat-0.17-20241115.065104-374.jar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be using a SNAPSHOT version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, however the stable version 16 does not support glob pattern in the '.rat-excludes' file, that is why I used 17-SNAPSHOT.
My idea was to use this specific snapshot version until there is stable/final 17, we could track this in kie-issues ticket?
If you say we need to use stable/final 16, we need to list every single excluded file in .rat-excludes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.... understand... I'm not a big fan os glob exclusions, to be honest, as I think they make it too easy to add stuff to the excluded list. Idk, first I think we need an assessment of which files we should be excluding from "CI :: Check license headers"
, then I think we can discuss the best approach to do it... WDYT please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will prepare a spreadsheet with files, we need to discuss, FYI, even excluding:
**/target/**
**/node_modules/**
**/dist/**
**/dist-dev/**
**/dist-tests/**
**/dist-tests-e2e/**
**/python-venv/**
we need to discuss ~995 files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shared privately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be necessary to include anything that is in the .gitignore...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I'm not a big fan os glob exclusions, to be honest, as I think they make it too easy to add stuff to the excluded list
apache-rat 0.16 uses filename with regex e.g. .*\.csv
. I think "easy to add" is not so different between apache-rat 0.16 (regex) and 0.17 (glob pattern). Rather, apache-rat 0.17 glob pattern can express file paths, while apache-rat 0.16 cannot express things like **/optaplanner-examples/data/**/import/**
. I'll ask about the preference in dev ML.
I'm not against the assessment of excluding files at all. Thanks!
Apache RAT check
GitHub Actions workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for starting this effort @jomarko ! I made some suggestions for us to focus on the "what" (Checking license headers), instead of the "how" (Apache RAT).
.github/workflows/pr-rat-check.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please name this ci_check_license_headers.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
.github/workflows/pr-rat-check.yml
Outdated
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think making it run on merges to main
would be good too... We can use the same triggers we have for ci_build.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Apache RAT check
GitHub Actions workflowCI :: Check license headers
GitHub Actions workflow
Co-authored-by: Tiago Bento <[email protected]>
Co-authored-by: Tiago Bento <[email protected]>
.rat-excludes
Outdated
packages/stunner-editors/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/impl/StyleImpl.java | ||
packages/stunner-editors/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/util/DiAdapterFactory.java | ||
packages/stunner-editors/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/util/DiSwitch.java | ||
packages/stunner-editors/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/dd/di/util/DiValidator.java |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listing every excluded single file is nice. However, this format (file path) doesn't work with apache-rat 0.16.1. Please confirm.
Per my testing so far, apache-rat 0.16.1 supports file name without its file path (aaa.txt
) or directory name (ccc/*
). So far, my idea is only listing file names to exclude (It means listing like DiValidator.java
, so it would affect all DiValidator.java
in any paths). If you find another way to express file paths, it would be great.
Another idea is to fall back to apache-rat 0.17 and listing every excluded single file as this PR. The problem of "snapshot is pruned" could be resolved by hosting the file somewhere (e.g. incubator-kie-kogito-pipelines)... it may not sound good though.
.rat-excludes
Outdated
packages/serverless-workflow-diagram-editor/uberfire-extensions/uberfire-commons-editor/uberfire-commons-editor-client/src/main/resources/org/uberfire/ext/editor/commons/client/file/exports/js/FileSaver.min.js.back | ||
packages/serverless-workflow-diagram-editor/uberfire-extensions/uberfire-commons-editor/uberfire-commons-editor-client/src/main/resources/org/uberfire/ext/editor/commons/client/file/exports/js/canvas2svg.js.back | ||
packages/stunner-editors/errai-common/src/main/java/org/jboss/errai/common/client/util/TimeUnit.java | ||
packages/stunner-editors/errai-common/src/main/java/org/jboss/errai/common/compat/javax/annotation/processing/Generated.java |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@porcelli Per https://lists.apache.org/thread/nrq50szwx37doopb23wyq33v0t3bbccg , I think Generated.java
needs to be listed in LICENSE
as Category B or X. But if it's one time listing for 10.0.0, it may not be needed in main. Thoughts?
.rat-excludes
Outdated
packages/stunner-editors/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DI.xsd | ||
packages/stunner-editors/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DMN12.xsd | ||
packages/stunner-editors/kie-wb-common-dmn/kie-wb-common-dmn-webapp-kogito-marshaller/src/main/resources/DMNDI12.xsd | ||
packages/stunner-editors/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Activity.java |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI :: Check license headers
GitHub Actions workflowCI :: Check license headers
GitHub Actions workflow
@jomarko Sorry for being picky, but to to make this absolutely perfect (😄), can we rename the workflow to This way, instead of we'll have Thank you! |
This is partial fix of the issue apache/incubator-kie-issues#1613 as we open one PR per repository.