chore(ci): run dependency:analyze in its own parallel job#24044
Merged
Conversation
The unit-test job ran 'mvn dependency:analyze' as a second step after the unit tests. That goal forks its own build up to test-compile, so it recompiled the whole reactor a second time inside unit-test (~1m35s) for a check that has nothing to do with unit tests. Move it into its own 'dependency-analysis' job that runs in parallel on its own runner, off the critical path. The dependency check still runs on every PR and push with the same fail-on-warning behaviour (configured in dhis-2/pom.xml), and the unit-test job no longer pays for the extra recompile. The new job is added to the Slack-on-failure notification's needs so a failure on master is still reported.
|
Contributor
The analysis job is faster than 3~4 minutes, right? Because it is true that it will run in parallel so the overall time do not change, but if we add a new job with that big overhead, it could be a shot in the feet when there are multiple PRs running. |
enricocolasante
approved these changes
Jun 1, 2026
Contributor
enricocolasante
left a comment
There was a problem hiding this comment.
Are you going to make dependency-analysis job required after the PR is merged?
jbee
approved these changes
Jun 1, 2026
Contributor
Author
|
Yeah, I'll make it required after! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Why
The
unit-testjob runs two Maven invocations back to back:dependency:analyze(the standalone goal) forks its own build up totest-compile. So that second step quietly recompiles the entire reactor a second time, inside the unit-test job, just to run a dependency check that has nothing to do with unit tests. On recent runs that step costs ~1m35s.What this does
dependency:analyzestep fromunit-test.dependency-analysisjob that runsmvn dependency:analyzeon its own runner, in parallel with the test jobs.needslist so a failure onmasteris still reported.The check still runs on every PR and push, with the same fail-on-warning behaviour (
<failOnWarning>true</failOnWarning>is configured on the plugin indhis-2/pom.xml, including the sameignoredUnusedDeclaredDependenciesallowlist) — it just no longer sits on the unit-test critical path.Effect
unit-testdrops ~1m35s and the confusing hidden recompile.For a maintainer to check
If
dependency:analyze(previously surfaced under theunit-testcheck) was a required status check in branch protection, the newdependency-analysischeck name needs to be added there so it stays required.🤖 Generated with Claude Code