GrantPSpencer opened a new pull request, #2583:
URL: https://github.com/apache/helix/pull/2583
### Issues
- [ ] My PR addresses the following Helix issues and references them in the
PR description:
Fixes #2565
Formatting of the "reason" key could vary depending on how data was sent to
helix-rest. This change makes it so helix-rest always checks for a "reason" key
and then consistently formats it in UPPERCASE
### Description
- [ ] Here are some details about my PR, including screenshots of any UI
changes:
Checks the KV mapping passed to the helix-rest endpoint to determine if
there a "reason" key present. We check for a case-insensitive key then set it
to content, which then gets set as the value to the "REASON" (uppercase) key
down the line.
More details can be seen in the linked issue, but we need to enforce this
formatting because when this endpoint receives a non-JSON string, it sets it as
the value to the "REASON" key. If the endpoint receivers a json string (KV
map), then it will just use whatever key-value pairs are passed to it and does
not enforce UPPERCASE formatting for the reason key. This change ensures that
if a reason key is present, it will always appear as "REASON" . This is
important as Java maps are case sensitive and keys of different casing are
functionally two different keys and do not allow customers to easily
programmatically access the reason key
### Tests
- [ ] The following tests are written for this issue:
Updated testEnableDisableMaintenanceMode() in testClusterAccessor.java to
assert KV map of {"reason": "Test reason"} gets stored as {"REASON": "Test
reason"}
### Commits
- My commits all reference appropriate Apache Helix GitHub issues in their
subject lines. In addition, my commits follow the guidelines from "[How to
write a good git commit message](http://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
1. Subject is limited to 50 characters (not including Jira issue reference)
1. Subject does not end with a period
1. Subject uses the imperative mood ("add", not "adding")
1. Body wraps at 72 characters
1. Body explains "what" and "why", not "how"
### Code Quality
- My diff has been formatted using helix-style.xml
(helix-style-intellij.xml if IntelliJ IDE is used)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]