Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upOrder objects used for template data #7031
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
chef-expeditor
bot
commented
Oct 11, 2019
Hello raskchanky! Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
@@ -142,104 +240,6 @@ fn is_dest_on_path(dest_dir: &Path) -> bool { | |||
} | |||
} | |||
|
|||
struct Binlink { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
raskchanky
Oct 14, 2019
Author
Member
Because I found it confusing that it was defined at the bottom of the file. Typically our structs and such are defined before they're used, which I get is not a requirement. I do find it makes the file more readable though.
Looks like you need to rebase, but other than that |
The goal here is to provide predictable ordering of binds when they're rendered to a template. BTreeMap iterates over its keys in sorted order, whereas HashMap iterates over its keys in a non-deterministic order. Unfortunately, changing the type in that one place bubbled out into many different places across many different crates. I ultimately decided to propagate the change all the way through to the edges, which ended up being the launcher protocol crate. At that edge, we convert from BTreeMap to HashMap and back, as the protobuf map data type deserializes to a rust HashMap. Signed-off-by: Josh Black <raskchanky@gmail.com>
Signed-off-by: Josh Black <raskchanky@gmail.com>
Signed-off-by: Josh Black <raskchanky@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
raskchanky commentedOct 11, 2019
Previously, we used
HashMap
to hold key/value pairs for template data. Unfortunately,HashMap
iterates over its data in a non-deterministic order. This can cause problems when the checksum of the rendered file has changed, because the supervisor will reload the service.We now use
BTreeMap
to hold these key/value pairs. It has a compatible API withHashMap
and it iterates over its data in sorted order, which should fix this issue.Fixes #6713