Skip to content

fix(manifest_ingest): resolve inherited groupId and ${...} properties in pom.xml (#3806) - #3823

Closed
chiliec wants to merge 1 commit into
Graphify-Labs:v8from
chiliec:fix/pom-inherited-groupid-properties
Closed

chiliec wants to merge 1 commit into
Graphify-Labs:v8from
chiliec:fix/pom-inherited-groupid-properties

Conversation

@chiliec

@chiliec chiliec commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #3806.

_parse_pom built module and dependency ids from the literal POM text, so two common Maven patterns produced ids that never matched and the depends_on edges were pruned as dangling:

  1. Inherited groupId: a module with no top-level <groupId> now falls back to <parent><groupId> (version works the same way with <parent><version>).
  2. ${...} properties: groupId/artifactId/version of the module and of each dependency are resolved against the POM's own <properties> plus project.groupId, project.artifactId, project.version, project.parent.groupId and project.parent.version. Placeholders that can't be resolved from the same file (for example, a property only defined in a parent POM) are kept as-is, which matches the current behaviour.

Tests

  • Added test_pom_inherits_groupid_and_resolves_properties to tests/test_manifest_ingest.py. It covers the parsed ids and the edges that survive build_from_json across three modules.
  • RED→GREEN: the new test fails on v8 ('acme-server' == 'org.acme:acme-server') and passes with this change.
  • pytest tests/test_manifest_ingest.py: 14 passed.
  • Full suite: 5539 passed, 62 failed, 259 skipped. The same 62 tests (VB.NET, Terraform and similar optional-grammar extractors) fail on the base commit in my environment too. None of them are manifest tests.
  • ruff check on the two changed files: clean.

Real-world check (apache/livy, the repro from the issue)

Ran extract + build_from_json over all 25 pom.xml files:

  • before: 18 depends_on edges
  • after: 39 depends_on edges

Some edges are still missing because scala.binary.version is only defined in the root POM, and this change doesn't do cross-file parent-property inheritance.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 2 advisory finding(s) below merit a look before merge.


Graphify review — findings

Resolves Maven POM coordinates from parent inheritance and property substitution: _parse_pom now falls back to parent/groupId and parent/version when the child omits them, and expands ${...} references (including the built-in project.* and project.parent.* keys plus any <properties>) across the group id, version, and dependency coordinates. Dependencies declared with unresolved placeholders like ${project.groupId} or version-suffixed artifact names now link to the correct package nodes instead of dangling.

Worth a look

  • POM dependency artifactIds are resolved but package artifactIds are not — graphify/manifest_ingest.py:317 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • POM parser accepts XML entity expansion — graphify/manifest_ingest.py:290 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 1665 functions depend on the 40 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 704 callers, 47 callees
  • new: _rebuild_code() — 144 callers, 55 callees
  • new: detect() — 112 callers, 15 callees
  • new: main() — 98 callers, 3 callees
  • new: dispatch_command() — 2 callers, 125 callees
  • new: detect_incremental() — 23 callers, 7 callees
  • new: _get_extractor() — 26 callers, 6 callees
  • new: _is_sensitive() — 39 callers, 4 callees
  • …and 17 more — each is listed as a finding

Verification — 1665 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 703 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

15 of 300 test file(s) selected (5%) via static blast radius.

  • tests/test_apm_fallback_version.py — impact
  • tests/test_detect.py — impact
  • tests/test_dotnet.py — impact
  • tests/test_extract.py — impact
  • tests/test_ignore_file_encoding.py — impact
  • tests/test_incremental_mtime_collision.py — impact
  • tests/test_languages.py — impact
  • tests/test_manifest_ingest.py — impact, changed-test
  • tests/test_manifest_tomli_required.py — impact
  • tests/test_mcp_ingest.py — impact
  • tests/test_out_dir_evidence.py — impact
  • tests/test_pipeline.py — impact
  • tests/test_stale_prune.py — impact
  • tests/test_watch.py — impact
  • tests/test_watch_manifest_location.py — impact

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

· 25 more finding(s) on lines outside this diff (see the check run).

safishamsi added a commit that referenced this pull request Sep 25, 2026
Complete the skillgen --watch INPUT_PATH injection fix in the add-watch
reference (#3742), preserve cross-file edges on incremental update
(#3812), stop C# type references resolving to same-named non-type nodes
(#3815), prefer a real source location over richness in dedup (#3786),
and resolve Maven inherited groupId + ${...} properties in pom.xml
(#3823).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@safishamsi

Copy link
Copy Markdown
Member

Shipped in v0.9.68 (now on PyPI) via an authorship-preserving cherry-pick, so your commit keeps contributor-graph credit. Thanks @chiliec! Maven pom.xml inherited groupId + ${...} property resolution.

Release: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.68

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.

[Bug]: Maven POM ingestion drops most inter-module depends_on edges: inherited groupId and ${...} properties are not resolved

2 participants