Closed koppor closed 10 months ago
Hi @koppor ; fun to see how you've integrated OpenRewrite into your build pipelines there. From what I gather you do a dry run, and fail on dry run results, correct?
There's a few different messages showing up in your screenshot:
First there's the ones in yellow: https://github.com/openrewrite/rewrite-gradle-plugin/blob/903faa813c8061f2ac97f72b430f22ccf0e42122/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java#L356-L357
Then there's the exception thrown here
https://github.com/openrewrite/rewrite-gradle-plugin/blob/903faa813c8061f2ac97f72b430f22ccf0e42122/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java#L385
And info logged through org.gradle.api.logging
in
https://github.com/openrewrite/rewrite-gradle-plugin/blob/903faa813c8061f2ac97f72b430f22ccf0e42122/plugin/src/main/java/org/openrewrite/gradle/RewriteDryRunTask.java#L49
The yellow ones seem to intermix with some Gradle logs regarding the use of --stacktrace.
Not quite sure what would be needed to not have those messages intermixed; perhaps consistently using logger.warn
or logger.info
could help, but even then I'm unsure if we have any influence over the Gradle internal messages appearing there.
From what I gather you do a dry run, and fail on dry run results, correct?
Yes, correct!
Not quite sure what would be needed
Me neither ^^. Maybe it is possible to tell the logging framework to flush after each line?
So personally this smells of stdout VS stderr synchronization. I know Gradle internally already does synchronized writes to the console, so there isn't any way for it to get jumbled from Gradle land. I believe both error and warn are routed to the stderr stream while everything else is routed to stdout. Based on a couple of other searches, I'm guessing that GitHub doesn't guarantee order between the streams when it comes to actions and rapid writes.
Thanks for that context @shanman190 ! Looks like there's not much we can do on this front then, or at least out of scope for this project. Hope you agree with me closing this one then @koppor , in an effort to clear our backlog from items that are not directly actionable.
That said, if you see this locally and feel that it is related to OpenRewrite's use of the Gradle and logging APIs, then perhaps we can have another look. Closing until then, but the commments below remain open for additional input.
The
RuntimeException
is put inbetween the output in GitHub actions making it unreadable.Maybe a flush helps?
Running on GitHub CI
Running on command line
What version of OpenRewrite are you using?
(Not quite sure, it is hard to determine - see https://github.com/openrewrite/rewrite-gradle-plugin/issues/199)
I am using
id 'org.openrewrite.rewrite' version '6.3.3'
How are you running OpenRewrite?
./gradlew rewriteDryRun
Commit at JabRef/jabref@
a11cb9d
(#10347)