Change OpenRewrite task to use rewriteDryRun#15664
Conversation
Review Summary by QodoFix OpenRewrite CI check to use dry-run mode
WalkthroughsDescription• Change OpenRewrite Gradle task from rewriteRun to rewriteDryRun • Fixes CI/CD check to properly fail when code style changes are detected • Aligns CI behavior with local development workflow Diagramflowchart LR
A["rewriteRun<br/>succeeds on changes"] -->|changed to| B["rewriteDryRun<br/>fails on changes"]
B -->|proper CI behavior| C["Detects code style issues"]
File Changes1. .github/workflows/tests-code.yml
|
Code Review by Qodo
1.
|
|
Aha! The changed workflow is triggered here, and you can see it's working now |
| run: | | ||
| gradle --no-configuration-cache :rewriteRun | ||
| gradle --no-configuration-cache :rewriteDryRun | ||
| - name: Output diff |
There was a problem hiding this comment.
Although the idea is nice; the core idea of the change was that the CHANGES were output!!
Thus, the "real" requirement would be to check if there is any code diff. If yes, then do it.
Maybe, it is as simple as check for /home/runner/work/jabref/jabref/build/reports/rewrite/rewrite.patch being present?
I think, additionally, we should do :rewriteDryRun to ensure that the check fails?
There was a problem hiding this comment.
Do you want the action to produce a commit with openrewrite changes?
There was a problem hiding this comment.
No, we want to have a list/the gradle output of the task saying openRewrite failed with....
There was a problem hiding this comment.
For fixing using the CI we have https://github.com/JabRef/jabref/blob/main/.github/workflows/run-openrewrite.yml
But we still want to have a manual trigger - and not automatic fixing... We can discuss on JabCon when we have more experience with all the AI tool usage within JabRef.
There was a problem hiding this comment.
In any case, it would seem strange for an action that has made changes successfully (not taking “there were parsing errors” into account) to fail. This is why I believe there is a dry run, along with an option (somewhere in the build.gradle) to fail the build during the dry run if there are changes to be made
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
|
Main is broken now https://github.com/JabRef/jabref/actions/runs/25287341072/job/74133769926 |
…rity * upstream/main: (204 commits) New Crowdin updates (JabRef#15669) Fix OpenRewrite (JabRef#15670) Udpate heylogs (and fix CHANGELOG.md) (JabRef#15671) Improve security and prevent shell injection for push2applications (JabRef#15628) Fix depdency analysis (JabRef#15668) Always use CI-local "gradle", instead of gradlew (JabRef#15667) Change OpenRewrite task to use rewriteDryRun (JabRef#15664) Add small documentation to parameter (JabRef#15666) Fix markbaseChanged for "imported entries" (JabRef#15610) Add forgotten --fresh chore(deps): update dependency com.github.ben-manes.caffeine:caffeine to v3.2.4 (JabRef#15662) chore(deps): update jackson monorepo to v3.1.3 (JabRef#15659) chore(deps): update dependency org.glassfish.hk2:hk2-utils to v4.0.1 (JabRef#15657) chore(deps): update dependency org.glassfish.hk2:hk2-locator to v4.0.1 (JabRef#15656) fix gemsfx missing icon resolving (JabRef#15655) chore(deps): update dependency org.glassfish.hk2:hk2-api to v4.0.1 (JabRef#15654) chore(deps): update dependency org.postgresql:postgresql to v42.7.11 (JabRef#15634) Chore(deps): Bump tools.jackson:jackson-bom in /versions (JabRef#15653) Chore(deps): Bump dev.langchain4j:langchain4j-bom in /versions (JabRef#15652) Chore(deps): Bump com.dlsc.gemsfx:gemsfx in /versions (JabRef#15651) ...
* upstream/main: (775 commits) Chore(deps): Bump com.konghq:unirest-modules-gson in /versions (#15682) Chore(deps): Bump org.glassfish.jaxb:jaxb-runtime in /versions (#15681) Update dependency com.konghq:unirest-modules-gson to v4.9.0 (#15679) Integrate with SearchRxiv (#15373) Fix requirements (#15600) refactor: less objects during writing (#15677) Fix: suppress WARN for empty or blank column name in MainTableColumnModel#parse() (#15576) New Crowdin updates (#15676) Chore(deps): Bump com.github.ben-manes.caffeine:caffeine in /versions (#15673) Fix Nullwarnings - C (Mark bst package as nonnull by default) (#15663) Chore(deps): Bump com.github.javaparser:javaparser-symbol-solver-core (#15674) Chore(deps): Bump com.github.javaparser:javaparser-core in /versions (#15672) New Crowdin updates (#15669) Fix OpenRewrite (#15670) Udpate heylogs (and fix CHANGELOG.md) (#15671) Improve security and prevent shell injection for push2applications (#15628) Fix depdency analysis (#15668) Always use CI-local "gradle", instead of gradlew (#15667) Change OpenRewrite task to use rewriteDryRun (#15664) Add small documentation to parameter (#15666) ...
Related issues and pull requests
Closes https://github.com/JabRef/jabref-issue-melting-pot/issues/1289
PR Description
Fixes the OpenRewrite check. The problem was that when there are changes, the check is succeded. But if we change the task to the dry run, on changes it will fail (the same also happens locally, so I think on CI/CD it will also work like that).
Steps to test
I don't know how to test the CI/CD changes. But you can locally run
rewriteRunandrewriteDryRun.Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)