Skip to content

fix: detect duplicate plugin entries in dependencies#1255

Open
hashwnath wants to merge 1 commit intowalmartlabs:masterfrom
hashwnath:fix/issue-19-duplicate-dependencies
Open

fix: detect duplicate plugin entries in dependencies#1255
hashwnath wants to merge 1 commit intowalmartlabs:masterfrom
hashwnath:fix/issue-19-duplicate-dependencies

Conversation

@hashwnath
Copy link

Summary

Fixes #19

Problem

Currently, Concord configuration parsing silently merges or ignores duplicate entries in dependencies. If a user accidentally lists the same dependency twice (potentially with different versions), it can lead to confusion about which one is actually used.

Solution

Implemented a fail-fast validation in ProjectLoaderV2. The loader now checks for duplicate strings in dependencies and extraDependencies lists before merging them. If a duplicate is found, it throws an IllegalArgumentException with the message "Duplicate dependency found: ...".

Changes

  • Modified ProjectLoaderV2.java to check for duplicates in parsed lists.
  • Added testDuplicateDependencies to ProjectLoaderV2Test.java.
  • Added test resource duplicate_deps/concord.yml.

Testing

  • Ran mvn test -pl runtime/v2/model -Dtest=ProjectLoaderV2Test to verify the fix and ensure no regressions.
  • Confirmed that valid configurations (like multi-file merges) still work as expected via existing tests.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Hashwanth Sutharapu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Fixes walmartlabs#19

Added duplicate validation in ProjectLoaderV2. When parsing configuration,
we now check if a dependency or extraDependency has already been detected
in the current list. If so, we fail fast with an IllegalArgumentException.

This prevents silent merging of potential duplicates which can lead to
confusion (e.g. duplicate plugins with different versions).
@hashwnath hashwnath force-pushed the fix/issue-19-duplicate-dependencies branch from 4500a1a to 9464a45 Compare January 20, 2026 02:30
@hashwnath
Copy link
Author

recheck

@benbroadaway
Copy link
Collaborator

This change has no practical benefit to workflow execution and will introduce breaking changes to existing flows. As discussed in #19 (comment), between policy overrides, imported flows, and transitive dependencies of workflow dependencies, duplicates are expected to be encountered.

If anything, a warning in the CLI linter may be appropriate for a heads up to flow designers they've introduced a duplicate in configuration.dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Defending against duplicate plugin entries

3 participants