Skip to content

New diff evaluator for added required members#1781

Merged
sugmanue merged 1 commit intosmithy-lang:mainfrom
rchache:AddedRequiredMember
May 22, 2023
Merged

New diff evaluator for added required members#1781
sugmanue merged 1 commit intosmithy-lang:mainfrom
rchache:AddedRequiredMember

Conversation

@rchache
Copy link
Copy Markdown
Contributor

@rchache rchache commented May 21, 2023

Issue #, if available:

Description of changes:
Validates that no members are newly created with the required trait (but no default trait) in existing structures.
Emits an event "AddedRequiredMember" for such cases

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rchache rchache requested a review from a team as a code owner May 21, 2023 00:46
assertThat(TestHelper.findEvents(result.getDiffEvents(), "AddedRequiredMember").size(), equalTo(1));
assertThat(TestHelper.findEvents(result.getDiffEvents(), "AddedRequiredMember").get(0).getShapeId().get().toString(),
equalTo("smithy.example#A$foo"));
assertThat(TestHelper.findEvents(result.getDiffEvents(), "AddedRequiredMember").get(0).getMessage(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit, I think asserting that specific messages is fragile, since improving it causes tests to fail.

@sugmanue sugmanue merged commit fc0cf41 into smithy-lang:main May 22, 2023
syall pushed a commit to Xtansia/smithy that referenced this pull request Aug 11, 2023
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