Skip to content

fix(annotations): Check for invalid sender requirements - #781

Merged
jpenilla merged 2 commits into
masterfrom
check-invalid-sender-requirements
Jul 19, 2026
Merged

fix(annotations): Check for invalid sender requirements#781
jpenilla merged 2 commits into
masterfrom
check-invalid-sender-requirements

Conversation

@jpenilla

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Oct 26, 2024

Copy link
Copy Markdown

Test Results

 88 files  ±0   88 suites  ±0   11s ⏱️ -1s
437 tests +1  437 ✅ +1  0 💤 ±0  0 ❌ ±0 
482 runs  +1  482 ✅ +1  0 💤 ±0  0 ❌ ±0 

Results for commit d6d6a94. ± Comparison against base commit e8f9532.

This pull request removes 2 and adds 3 tests. Note that renamed tests count towards both.
org.incendo.cloud.annotations.feature.RequiredSenderDeductionTest ‑ testCorrectSender()
org.incendo.cloud.annotations.feature.RequiredSenderDeductionTest ‑ testIncorrectSender()
org.incendo.cloud.annotations.feature.RequiredSenderTest ‑ testCorrectSender()
org.incendo.cloud.annotations.feature.RequiredSenderTest ‑ testIncorrectSender()
org.incendo.cloud.annotations.feature.RequiredSenderTest ‑ testInvalidRequirement()

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR strengthens cloud-annotations’ annotation parsing by rejecting invalid requiredSender constraints up front, preventing misconfigured command methods from being registered with impossible sender requirements.

Changes:

  • Add a validation step in AnnotationParser that throws an IllegalArgumentException when @Command(requiredSender=...) is not a subtype of the parser’s configured command sender type.
  • Update/rename the required-sender test class and retain the AnnotationParser as a field to reuse across test cases.
  • Add a new test asserting that an invalid requiredSender value is rejected during parsing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cloud-annotations/src/main/java/org/incendo/cloud/annotations/AnnotationParser.java Validates requiredSender is compatible with the configured command sender type and fails fast with a clear exception.
cloud-annotations/src/test/java/org/incendo/cloud/annotations/feature/RequiredSenderTest.java Adds coverage for invalid requiredSender requirements and aligns the test class name with the file name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jpenilla
jpenilla merged commit 28bb90e into master Jul 19, 2026
6 checks passed
@jpenilla
jpenilla deleted the check-invalid-sender-requirements branch July 19, 2026 23:05
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.

3 participants