Skip to content

Detect duplicate feature attribute assignments in configurations (#2046) - #2047

Merged
kbirken merged 4 commits into
maintenance/mps20241from
feature/detect_duplicate_attribute_assignments_2046
Nov 23, 2026
Merged

kbirken merged 4 commits into
maintenance/mps20241from
feature/detect_duplicate_attribute_assignments_2046

Conversation

@kbirken

@kbirken kbirken commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Closes #2046

Partner PR in iets3.core (linter side): IETS3/iets3.core#1810

Summary

  • New checking rule check_FeatureAttributeAssignment (org.iets3.variability.configuration.base, typesystem, virtual package attribute): reports every FeatureAttributeAssignment whose attribute is assigned more than once in the same InlineFeatureConfigurationContent (error id non_unique_attribute_assignment). Such duplicates typically result from an erroneous manual merge; they mirror the duplicate FeatureConfiguration case from Detect and fix inconsistent states in feature model configurations #1476.
  • New non-automatic quickfix fix_DuplicateAttributeAssignment: removes the selected duplicate assignment. The user decides which one to keep, since either assignment may carry the productive value.
  • While building the tests it turned out that a duplicate assignment also breaks the configuration solver (INTERNAL ERROR: value already present: FM1@@s), so the rule reports an error, not a warning.
  • No migration needed. Existing models of this repository contain no duplicate assignments (checked with a console query), so checkmodels is not affected.

Test plan

Model test.org.iets3.variability.configuration.base.checking_rules@tests, virtual package config.inconsistent:

  • NonUniqueAttributeAssignments (NodesTestCase): both duplicate assignments are flagged with non_unique_attribute_assignment; a configuration with a single assignment stays error-free.
  • FixDuplicateAttributeAssignment (EditorTestCase): applies the quickfix on the second of two assignments (selected in the inspector, where attribute assignments are edited) and checks that exactly this one is removed.

Both tests pass in MPS 2024.1 (in-process run).

@kbirken kbirken self-assigned this Nov 16, 2026
@kbirken
kbirken requested a review from dbinkele November 16, 2026 19:31
@kbirken
kbirken force-pushed the feature/detect_duplicate_attribute_assignments_2046 branch from 2f571f1 to a75ab05 Compare November 20, 2026 08:15
dbinkele
dbinkele previously approved these changes Nov 20, 2026

@dbinkele dbinkele left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Checked the branch in MPS: check_FeatureAttributeAssignment flags both duplicate assignments in NonUniqueAttributeAssignments (expectations sit on the assignments, which are only visible in the Inspector), and ConfWithoutError stays clean.

@kbirken
kbirken enabled auto-merge November 23, 2026 08:09
@kbirken
kbirken merged commit 4d5aa9b into maintenance/mps20241 Nov 23, 2026
2 checks passed
@kbirken
kbirken deleted the feature/detect_duplicate_attribute_assignments_2046 branch November 23, 2026 08:37
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.

2 participants