-
Notifications
You must be signed in to change notification settings - Fork 131
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
Issue #529: Deprecate launch.groovy and merge functionality into diff.groovy #546
Conversation
f4101ed
to
1a82e83
Compare
You need to review that one I pointed out not too long ago that was converted from launch to diff prematurely before this PR. |
Yes, you are right, that one can be changed to single mode too, as all no-exceptions testing can. Thanks for the reminder. |
df2cb36
to
0321c09
Compare
At this point CI is green for all PR's related to this change in Checkstyle and Sevntu:
|
Difference in Maven commands between master and this PRAppVeyor:DESC= maven command from PR: DESC= maven command from PR: Travis:CMD= CMD="./.ci/travis.sh checkstyle-tester-diff-groovy-patch" CMD= maven command from PR: |
71def16
to
57ff5b6
Compare
checkstyle-tester/README.md
Outdated
**allowExcludes** (g) - this option tells `diff.groovy` to allow paths and files defined in a | ||
`projects*.properties` file to be excluded from report generation (optional, default is false). | ||
|
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.
Now we can allow excludes in diff.groovy execution
Does it make sense to remove launch.groovy ? |
Probably. I can do it as a separate commit (with corresponding documentation change) in case we need to revert it. @rnveach what do you think? |
This was covered in issue. Removal is a breaking change.
Even if the PR in all repos are ready to be merged now, not even accounting for time for other admins to review, I think it would be safer to have it in it's own PR to be sure it is ready to be removed. Once removed, any CIs/PRs trying to use it will fail since it is gone... |
No complaints here, I can just submit a PR for launch removal once this is merged. |
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.
First pass questions. Haven't looked at code in depth.
@@ -69,6 +71,69 @@ checkstyle-tester-diff-groovy-patch-only) | |||
-pc my_check.xml -p patch-branch -r ../.ci-temp/checkstyle -m single | |||
;; | |||
|
|||
checkstyle-tester-diff-groovy-regression-single) |
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.
The way i understand this, you run regression using Contribution Master and Contribution PR and check if the 2 separate runs produce the same or different files. I assume difference will fail the CI (and are we sure of that?).
If the above is correct, is this planned to be merged in? What happens if we make diff-report-util change the layout. This will then always fail CI even though it is an expected change.
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 assume difference will fail the CI (and are we sure of that?).
Yes. https://travis-ci.org/github/checkstyle/contribution/jobs/763804426
If the above is correct, is this planned to be merged in? What happens if we make diff-report-util change the layout. This will then always fail CI even though it is an expected change.
I would guess at that point we would need to use some sort of more complicated awk or perl command to verify that violations match up; right now, this CI job confirms that both the violations and format of the report are consistent.
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 wouldn't do anything too complicated. Should we not merge it or is there some alternative for this to not cause issues easily?
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 we should keep these, I have pushed several times in this PR, and these jobs haven't been flaky. It is the best way that I can think of to easily check that the violations, reports, and report formats are all consistent.
I think it is ok to wait and see what the future brings regarding changes to patch-diff-util
before doing anything different here.
checkstyle-tester/README.md
Outdated
`projects*.properties` file to be excluded from report generation (optional, default is false). | ||
|
||
**checkstyleVersion** (cv) - used to set the Checkstyle version to be used by maven during report | ||
generation; this option should mainly be used by satiellite projects |
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.
Maybe I lost track. Why do we need to pass in a checkstyle version to override what is being used automatically? Point to example if there is one.
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.
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, this is just for no exception testing in sevntu.
These 2 properties are pretty dangerous to use. If the wrong version is set, maven won't fail normally. It will try to find this version installed in the repo or pulled from the server. If it finds a version to use, it will use that and not be noticeable to the user that the wrong version is being regressed on.
Take our own regression, someone active in the repo will always be running local regression. So it is possible they have previous versions installed. If the use this and set an old version, the report will be generated, however, it will not be hitting their new code at all and only hitting old code. This will give a false sense of testing, especially if no changes are to be expected.
I would add some verbage to this to make it clear it is not to be used in normal circumstances. It is for internal use only. It should be close to the first thing read on the property.
Ideally, I think these should be removed but I don't see an alternative to get no exception testing to work in sevntu. If support is added for sevntu, these properties should then be removed.
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 can add a check to make sure that these are only used in single mode, too.
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.
Added a check for this:
➜ checkstyle-tester git:(issue-529) ✗ groovy diff.groovy -l projects-to-test-on.properties -r ../../checkstyle -p my-issue --checkstyleVersion "8.41.1"
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp -Dawt.useSystemAAFontSettings=gasp
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/share/groovy/lib/groovy-2.5.13.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Error: Diff mode may not use '--sevntuVersion' or '--checkstyleVersion' arguments!
Caught: java.lang.IllegalArgumentException: Error: invalid command line arguments!
...
➜ checkstyle-tester git:(issue-529) ✗ groovy diff.groovy -l projects-to-test-on.properties -r ../../checkstyle -p my-issue --sevntuVersion "8.41.1"
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp -Dawt.useSystemAAFontSettings=gasp
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/share/groovy/lib/groovy-2.5.13.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Error: Diff mode may not use '--sevntuVersion' or '--checkstyleVersion' arguments!
Caught: java.lang.IllegalArgumentException: Error: invalid command line arguments!
...
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.
These options have been removed now.
checkstyle-tester/README.md
Outdated
generation; this option should mainly be used by satiellite projects | ||
(optional, default is the latest snapshot). | ||
|
||
**sevntuVersion** (sv) - used to set the Sevntu-Checkstyle version to be used by maven during |
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.
Same here. We are not saying this supports sevntu regression, right?
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.
We are not saying this supports sevntu regression, right?
Only for single mode, so just for no-exception testing.
https://github.com/sevntu-checkstyle/sevntu.checkstyle/pull/828/files#r599509434
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.
Same here.
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.
Same here.
What is this comment referring to?
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 option has been removed now.
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.
2 more connected to documentation as I go through code.
checkstyle-tester/diff.groovy
Outdated
r(longOpt: 'localGitRepo', args: 1, required: true, argName: 'path', | ||
'Path to local git repository (required)') | ||
r(longOpt: 'localGitRepo', args: 1, required: false, argName: 'path', | ||
'Path to local git repository for regression testing (optional)') |
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.
Documentation still says this is required. Why did we change this to optional?
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.
Fixed, see
https://gist.github.com/nmancus1/bae2ef94de5d0457c8c59631d5192b88 for new behavior (added checking for both of the mentioned args in diff mode).
This is optional now because of sevntu usage.
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 optional now because of sevntu usage.
I understand but I don't fully agree. This is only because of no sevntu support. We would have to flop this if support is ever given as repo is always required.
Can we change sevntu usage to give sevntu repo and just not do anything with it? Edit: I was thinking branch could be left optional, but it was the other item that was required. I am not seeing anything else right now.
Maybe a different alternative. If not, then we will keep it.
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.
sevntu usage should NOT change design on diff.groovy
it is just extension of maven config, if user add something in config he need to make sure that versions are overidable by maven variables.
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.
Reverted this.
checkstyle-tester/diff.groovy
Outdated
p(longOpt: 'patchBranch', args: 1, required: true, argName: 'branch_name', | ||
'Name of the patch branch in local git repository (required)') | ||
p(longOpt: 'patchBranch', args: 1, required: false, argName: 'branch_name', | ||
'Name of the patch branch in local git repository for regression testing (optional)') |
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.
Same.
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.
Same as above.
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.
Reverted.
This comment has been minimized.
This comment has been minimized.
7545f11
to
877c016
Compare
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.
items:
845a9ad
to
f0b4cde
Compare
All items have been addressed up to this point, we need to make sure that all CI in other projects is passing. I will share results here. |
f515a2f
to
11d81e9
Compare
I had to remove the diff report CI job; every time that we change a check we would have to update this job to a new commit, or it will fail. I am leaving the other job, since we are only generating a report for a single commit so that it will be consistent. |
… into diff.groovy
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 update is huge leap forward, there a lot items to make better, but lets not spend bunch of time on this polishing now, we can improve later on in other PRs.
I got offline approval from @rnveach to move forward |
Issue #529: Deprecate launch.groovy and merge functionality into diff.groovy
Notes:
launch.groovy
withdiff.groovy
in single mode, using 'patchBranch' and 'patchConfig' . This isn't a big deal, we are just saving an extra checkstyle run usingmaster
branch.launch
that are being replaced withdiff
that DO NOT use-i
need to specify--allowExcludes
now.diff.groovy
usage needs to be reviewed;no-exception
tests can be done in single mode.Related PRs that must be merged after this for CI in other projects:
checkstyle/checkstyle#9278
sevntu-checkstyle/sevntu.checkstyle#828
A good example of
no-exception
testing and replacinglaunch.groovy
for many cases is:https://github.com/checkstyle/checkstyle/blob/492dd22e4730b7902e0af91819da840c2dac7b23/.ci/no-exception-test.sh#L68