fix: detect duplicate plugin entries in dependencies#1255
Open
hashwnath wants to merge 1 commit intowalmartlabs:masterfrom
Open
fix: detect duplicate plugin entries in dependencies#1255hashwnath wants to merge 1 commit intowalmartlabs:masterfrom
hashwnath wants to merge 1 commit intowalmartlabs:masterfrom
Conversation
|
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).
4500a1a to
9464a45
Compare
Author
|
recheck |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 independenciesandextraDependencieslists before merging them. If a duplicate is found, it throws anIllegalArgumentExceptionwith the message "Duplicate dependency found: ...".Changes
ProjectLoaderV2.javato check for duplicates in parsed lists.testDuplicateDependenciestoProjectLoaderV2Test.java.duplicate_deps/concord.yml.Testing
mvn test -pl runtime/v2/model -Dtest=ProjectLoaderV2Testto verify the fix and ensure no regressions.