fix: guard notification senders when matchedRuleIds are omitted#2
Merged
fix: guard notification senders when matchedRuleIds are omitted#2
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a normalizeEvaluation function to the API client to ensure that evaluation results have consistent array structures for evidence, matched rule IDs, and requested reviewers. It also includes logic to derive matchedRuleIds from the evidence list if the API omits them, along with a new test case to verify this functionality. Feedback was provided to ensure that matchedRuleIds contains unique values by using a Set, preventing duplicates that might arise from multiple evidence items sharing the same rule ID.
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.
What changed
evaluationpayloads from the API before the notification senders runmatchedRuleIdsfromevidence[].ruleIdwhen the API omits the explicit fieldWhy
The live MergeWire backend returned evaluation evidence and reviewers, but omitted
matchedRuleIdsfor the demo-repo validation PRs. The action successfully posted PR comments and requested reviewers, then crashed in the Slack sender onmatchedRuleIds.length, which prevented Slack and webhook delivery.Validation
npm testnpm run typechecknpm run release