Fix extracting rule properties in updateRule#266
Fix extracting rule properties in updateRule#266ayeshLK merged 4 commits intoballerina-platform:2201.8.xfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 Admin client updateRule so that rule updates correctly apply filter/action by extracting them from the nested rule: SqlRule field in UpdateRuleOptions (aligning with create-rule behavior).
Changes:
- Update
getUpdatedRulePropertiesFromBObjectto readaction/filterfrom the nestedrulemap (RECORD_FIELD_SQL_RULE). - Add a changelog entry documenting the fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| native/src/main/java/io/ballerina/lib/asb/util/ASBUtils.java | Fixes update-rule property extraction to use nested rule record fields. |
| changelog.md | Notes the updateRule fix in the Unreleased “Fixed” section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
c4cac3c to
66baf6c
Compare
Co-authored-by: Ayesh Almeida <77491511+ayeshLK@users.noreply.github.com>
Purpose
Resolves : ballerina-platform/ballerina-library#8730
Fix the
updateRuleoperation in the Admin client which was not actually updating rule properties (filter/action).The
getUpdatedRulePropertiesFromBObjectmethod inASBUtils.javawas incorrectly looking foractionandfilterfields at the top level of theUpdateRuleOptionsBMap. However, the BallerinaUpdateRuleOptionsrecord nests these fields inside aSqlRule rulefield. This meant the update was silently ignored and the existing rule properties were returned unchanged.The fix aligns the update logic with the create logic
getCreateRulePropertiesFromBObject, correctly reading from the nestedrule(RECORD_FIELD_SQL_RULE) map.Examples
Checklist