fix: render the serialisation violation verb as 'serialise objects' - #133
Conversation
mapRuleNameToAction lowercases each ArchUnit rule label and maps it to a
sentence verb for the 'tried to illegally <action> via ...' violation
message. The serialisation case still matched the American label
'serializes objects', but the rule label is 'Serialises objects', which
lowercases to 'serialises objects' and no longer matched, so the mapping
fell through to default and leaked the capitalised label into the sentence
('tried to illegally Serialises objects via ...'). Match the British label
and map it to the lowercase base-form verb, consistent with every sibling
('serialise objects'), yielding 'tried to illegally serialise objects via ...'.
|
Warning Review limit reached
Next review available in: 7 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Fixes the ArchUnit architecture-violation message phrasing for the serialization rule so the sentence reads with a lowercase base-form verb (… tried to illegally serialise objects …) instead of leaking the rule label (Serialises objects) into the message.
Changes:
- Update
mapRuleNameToActionto match the British rule label (serialises objects) and map it to the intended verb phrase (serialise objects).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Problem
Architecture-violation messages render as:
The capitalised, third-person
Serialises objectsis grammatically wrong in thetried to illegally <action> via ...sentence (every other verb reads as a lowercase base form, e.g.access the file system,terminate the JVM).Cause
JavaArchitectureTestCase.mapRuleNameToActionlowercases each ArchUnit rule label and maps it to a sentence verb. The serialisation branch still matched the American labelserializes objects:The rule label is
security.architecture.serialize=Serialises objects(British), which lowercases toserialises objectsand therefore no longer matches. The mapping falls through todefault -> ruleName, leaking the raw capitalised label into the sentence. Every sibling label is American/neutral and still matches its case, so serialisation is the only affected verb.Fix
Match the British label and map it to the lowercase base-form verb, consistent with all siblings:
The message now reads
... tried to illegally serialise objects via ... but was blocked by Ares.Verification
Rebuilt Ares and ran the SCORE reproducibility package BLOCKED_ALL serialisation metatests against it: all pass with the expected
tried to illegally serialise objects via ..., and a falsification run (asserting the oldSerialises objects) fails, confirming the emitted verb is now the corrected lowercase British form.