This repository was archived by the owner on Apr 3, 2019. It is now read-only.
Conversation
vbudhram
reviewed
Dec 5, 2018
Contributor
vbudhram
left a comment
There was a problem hiding this comment.
@philbooth First pass, just a couple comments.
| #[derive(Debug, Deserialize)] | ||
| struct Payload { | ||
| /// Flag indicating whether this payload clobbers existing config or should be merged with it. | ||
| clobber: Option<bool>, |
Contributor
There was a problem hiding this comment.
It might be a little clearer if it was called replace and noted that default is to merge configs.
| fn handler( | ||
| payload: AppResult<Payload>, | ||
| config_db: State<ConfigDb>, | ||
| // TODO: do we need the logger? |
Contributor
There was a problem hiding this comment.
If it isn't too hard, I think it might be useful.
| .header(ContentType::JSON) | ||
| .body( | ||
| r#"{ | ||
| "clobber": true, |
Contributor
There was a problem hiding this comment.
Are these values documented somewhere?
| "queue": "https://sqs.us-east-1.amazonaws.com/1234567890/blee", | ||
| "rules": [ | ||
| { "percentage": 50, "precedence": -127, "provider": "sendgrid" }, | ||
| { "percentage": 100, "precedence": 0, "provider": "socketlabs", "regex": "^socketlabs@mozilla\\.com$" }, |
Contributor
There was a problem hiding this comment.
Should the highest precedence be 0? It does seem strange that the highest precedence would be negative in this case.
| } | ||
|
|
||
| #[test] | ||
| fn request_without_optional_fields() { |
Contributor
There was a problem hiding this comment.
Can add more tests for clobber.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Related to #185.
Adds an endpoint that can write (or merge) config data to Redis. There's quite a lot here for a single reviewer, hence opening as
WIPand I'll pull out some smaller chunks that can be reviewed independently over the next couple of days.