Skip to content

[incubator-kie-drools-6761] Fix CI scoped build for Quarkus extension runtime/deployment pairing - #6772

Merged
tkobayas merged 1 commit into
apache:mainfrom
tkobayas:ci-failure-quarkus
Jul 7, 2026
Merged

tkobayas merged 1 commit into
apache:mainfrom
tkobayas:ci-failure-quarkus

Conversation

@tkobayas

@tkobayas tkobayas commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

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 -deployment counterpart — the quarkus-extension-maven-plugin:extension-descriptor goal resolves the deployment artifact at compile time — but this link is invisible to Maven's ProjectDependencyGraph.

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-descriptor tries 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.java for any reactor module pair where <ga> and <ga>-deployment both 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-deployment
  • drools-quarkus-ruleunits / drools-quarkus-ruleunits-deployment

Test plan

  • jbang script/ci/tests/CiComputeBuildScopesTest.java — all 12 scenarios pass (new scenario 12-quarkus-extension-pairing validates the fix; existing 01-11 unchanged)
  • After merging, open a PR that only changes AbstractDroolsAssetsProcessor.java to confirm the scoped build produces affected=14 upstream=61 (instead of affected=12 upstream=63) and CI passes with cold cache

Note: CI on this PR itself is a full build (affected=257) because the changed script/ci/ files map to the root module. The scoped-build fix can only be validated after merge, with a single-file PR.

@tkobayas
tkobayas force-pushed the ci-failure-quarkus branch 2 times, most recently from 5a057ae to 9257824 Compare June 25, 2026 04:37
…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>
@tkobayas
tkobayas force-pushed the ci-failure-quarkus branch from 9257824 to f6665f5 Compare June 25, 2026 05:53
@tkobayas
tkobayas marked this pull request as ready for review June 25, 2026 05:53
@tkobayas tkobayas changed the title [DO-NOT-MERGE][incubator-kie-drools-6761]CI scoped build misses Quark… [incubator-kie-drools-6761]CI scoped build misses Quark… Jun 25, 2026
@tkobayas

tkobayas commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Hi @tiagobento , This PR is to fix CI failure when a PR changes only drools-quarkus-util-deployment/src/.../AbstractDroolsAssetsProcessor.java (#6759).

As the Note: in the PR description says, I couldn't actually verify the effect of this PR because this PR triggers a full build. I verified the fix by merging this fix in my repo (tkobayas)'s main branch and raised a PR (edit only AbstractDroolsAssetsProcessor.java) tkobayas#12 . I confirmed that the error didn't happen in 5 jobs * 3 times run.

Could you review this PR and check whether it's a valid fix? Thanks!

@tkobayas
tkobayas requested a review from tiagobento June 25, 2026 08:41
@tkobayas tkobayas changed the title [incubator-kie-drools-6761]CI scoped build misses Quark… [incubator-kie-drools-6761] Fix CI scoped build for Quarkus extension runtime/deployment pairing Jun 25, 2026
@tiagobento

Copy link
Copy Markdown
Contributor

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 -deployment modules, while these explicit dependency declarations in the POM put the -deployment modules in the classpath. But I guess it is true that explicitly declaring the -deployment modules makes this PR not have a lot of effect anymore, as normal dependencies are already correctly picked up by the current dependency graph logic.

@tkobayas

tkobayas commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the confirmation!

@tkobayas
tkobayas requested a review from yesamer July 7, 2026 01:35
@tkobayas
tkobayas merged commit fa8e05b into apache:main Jul 7, 2026
17 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants