Skip to content

#992: support multiple attributes for merge - #2425

Open
JoelAdbu wants to merge 42 commits into
devonfw:mainfrom
JoelAdbu:feature/992-support-multiple-attributes-for-merge-id
Open

#992: support multiple attributes for merge#2425
JoelAdbu wants to merge 42 commits into
devonfw:mainfrom
JoelAdbu:feature/992-support-multiple-attributes-for-merge-id

Conversation

@JoelAdbu

@JoelAdbu JoelAdbu commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #992

Implemented changes:

  • added support for multi-attribute merge identifiers, e.g. merge:id="@default,@type"
  • added support for automatically using all element attributes via merge:id="@@"
  • added tests covering the new merge id pattern

Testing instructions

Please add conscise, understandable instructions on how a reviewer can test/verify the functionality of your contribution here:

  1. Checkout this branch.

  2. Run all tests in IdComputerTest and execute:

build-local-dev.sh
  1. Create a fresh project:
ide create <test-project> -
  1. Clone any repository into worspace/main and run:
ide intellij
  1. Verify that the existing XML merge still works with the current XPath-based workaround:
<configuration default="true"
               type="JUnit"
               factoryName="JUnit"
               merge:id="configuration[@default='true' and @type='JUnit']">
  1. Modify the template in: project/<your-project>/settings/intellij/workspace/update/.idea/workspace.xml to use a multi-attribute merge identifier:
<configuration default="true"
               type="JUnit"
               factoryName="MyJUnit"
               merge:id="@default,@type">
  1. Run
ide intellij
  1. Verify that the existing configuration is identified using only the default and type attributes. Although factoryName differs, the element should still be matched and merged.

  2. Modify the same configuration again to use:

 <configuration default="true"
               type="JUnit"
               factoryName="MyJUnit"
               merge:id="@@">
  1. Run:
ide intellij
  1. Verify that the configuration is no longer matched with the existing JUnit configuration because factoryName now participates in element identification. This demonstrates that merge:id="@@" uses all atributes of an element as merge identifiers.

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat and not feature/921 fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summaries what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labelled
    with internal
  • You have not changed any dependency in pom.xml files or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

- improvement of XPathExpression build
- now supports @@ to build the XpathExpression for all element attributes
- fixed small bug
- added tests for new functionality
JoelAdbu and others added 4 commits September 7, 2026 16:05
- spotless...
…ributes-for-merge-id' into feature/992-support-multiple-attributes-for-merge-id
- spotless...
@JoelAdbu
JoelAdbu marked this pull request as ready for review September 7, 2026 14:12
@JoelAdbu JoelAdbu moved this from 🆕 New to Team Review in IDEasy board Sep 7, 2026
@coveralls

coveralls commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 34355148101

Coverage increased (+0.07%) to 73.975%

Details

  • Coverage increased (+0.07%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 4 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

4 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/merge/xml/matcher/IdComputer.java 4 93.16%

Coverage Stats

Coverage Status
Relevant Lines: 18828
Covered Lines: 14552
Line Coverage: 77.29%
Relevant Branches: 8419
Covered Branches: 5604
Branch Coverage: 66.56%
Branches in Coverage %: Yes
Coverage Strength: 3.3 hits per line

💛 - Coveralls

@Khaled-Cap Khaled-Cap self-assigned this Sep 8, 2026
@Khaled-Cap Khaled-Cap moved this from Team Review to 👀 In review in IDEasy board Sep 8, 2026
@Khaled-Cap Khaled-Cap moved this from 👀 In review to Team Review in IDEasy board Sep 8, 2026
@Khaled-Cap

Copy link
Copy Markdown

Implementation is clean. Tests are running successfully. The added functionality was tested locally and it works as described. PR will be moved to "in review"

@Khaled-Cap Khaled-Cap moved this from Team Review to 👀 In review in IDEasy board Sep 9, 2026
@JoelAdbu JoelAdbu added enhancement New feature or request intellij IntelliJ IDE from Jet-Brains settings ide-settings repo and replated processes and features merger workspace template merger (XML, JSON, properties) labels Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request intellij IntelliJ IDE from Jet-Brains merger workspace template merger (XML, JSON, properties) settings ide-settings repo and replated processes and features

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Support multiple attributes for merge:id

3 participants