[incubator-kie-drools-6761] Fix CI scoped build for Quarkus extension runtime/deployment pairing - #6772
Conversation
5a057ae to
9257824
Compare
…untime <-> deployment pairing, causing extension-descriptor failures on PRs Inject synthetic dependency edges in CiComputeBuildScopes for Quarkus extension runtime/deployment pairs so both halves land in the same Maven reactor during scoped PR builds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9257824 to
f6665f5
Compare
|
Hi @tiagobento , This PR is to fix CI failure when a PR changes only
Could you review this PR and check whether it's a valid fix? Thanks! |
|
Hey @tkobayas, thanks a lot for taking the time to actually improve the dependency graph logic in the partial build mechanism! I have to say I have seen so many errors happen due to this convention of Quarkus'. I'm not sure why they chose to break the configuration-over-convention aspect of Maven itself, it is truly unpredictable. Your PR looks great, and I approve it. Just one minor comment: we have in some places specific dependency declarations that aim to solve that problem. E.g.,:
I think those two strategies are complimentary to each other, since this PR makes topology sorting include the |
|
Thanks for the confirmation! |
Summary
The CI scoped build (
CiComputeBuildScopes.java) computes build sets from Maven<dependency>edges only. Quarkus extension runtime modules have an implicit build-time dependency on their-deploymentcounterpart — thequarkus-extension-maven-plugin:extension-descriptorgoal resolves the deployment artifact at compile time — but this link is invisible to Maven'sProjectDependencyGraph.When a PR changes a shared deployment utility (e.g.
drools-quarkus-util-deployment), the deployment modules land in the affected set while their paired runtime modules land in the upstream set. The upstream pass builds the runtime module first,extension-descriptortries to resolve the deployment artifact, and fails because it's in a different reactor (built later in the affected pass).This manifests as an intermittent failure — warm Maven cache masks the bug; cold cache exposes it.
Fix
Inject synthetic dependency edges in
CiComputeBuildScopes.javafor any reactor module pair where<ga>and<ga>-deploymentboth exist. This makes the existing graph traversal naturally keep both halves in the same build set. No post-processing or invariant changes needed.The convention-based matching (not filtered to Quarkus-specific modules) is safe: the worst case for a non-extension pair is that both land in the same set, which is conservative, not wrong.
In this repo, exactly 2 pairs match:
drools-quarkus/drools-quarkus-deploymentdrools-quarkus-ruleunits/drools-quarkus-ruleunits-deploymentTest plan
jbang script/ci/tests/CiComputeBuildScopesTest.java— all 12 scenarios pass (new scenario12-quarkus-extension-pairingvalidates the fix; existing 01-11 unchanged)AbstractDroolsAssetsProcessor.javato confirm the scoped build producesaffected=14 upstream=61(instead ofaffected=12 upstream=63) and CI passes with cold cacheNote: CI on this PR itself is a full build (
affected=257) because the changedscript/ci/files map to the root module. The scoped-build fix can only be validated after merge, with a single-file PR.