-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array handling #166
Open
mkw
wants to merge
14
commits into
breser:master
Choose a base branch
from
civitaslearning:mkw/yaml
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Array handling #166
Conversation
This file contains 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
update master
Current test suite always exits with zero because it's piped through bunyan. Since bunyan is always successful and it's the last command on the pipe chain we get it's exit code. By moving the command into a shell script and setting the pipefail option for bash we will exit with the proper exit code. This means that Travis CI will correctly determine test failures.
Was trying to set the include_branch_name property on a variable that didn't exist. Which caused the test to fail with a syntax error. Was using a property file but wasn't expecting the file extension to be in the key path.
Part of moving from Cimpress to breser.
git 2.x seems to automatically have renames on and git2consul doesn't know how to handle the R status. Might be better to handle all the statuses, but this appears to make it work with newer versions of git without further changes so going with this. Tested this with 1.9.1 and 2.14.1. Noticed this since Travis CI now has 2.13.0
Fixed the cov command just like I'd done for the test command, so that it will properly exit with an non-zero exit code on test failure. Switched back to using the cov script for doing the tests.
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to provide support for arrays when expanding keys for JSON and Yaml.
It was motivated by using Consul for Spring Boot services, which allows for array configuration data with either comma-separated lists or property names ending with indexes in
[]
-- e.g.my/array/key[0]
. While the existing loader provided fine support for loading Yaml files un-expanded, we wanted to expand keys in order to observe changes on a per-key level directly from Consul.I believe that would address the now-closed #71 issue. It builds on the work done by @kapekost for better Yaml support, but adds two new properties to control how arrays are formatted.
array_format
: Controls how primitive arrays are formatted. Options:array_key_format
: Controls how arrays can be formatted as individual keys. Instead of picking a single format, this expects a format string using_
as a reserved-value for the array name and#
as a reserved value for array "index". This allows arbitrary arrays to be formatted -- e.g. the JSON string{"my":{"array":{"key":[{"with_sub_obj":{"foo":"bar"}}]}}}
becomesmy/array/key/0/with_sub_obj/foo
. The default behavior is to not output any keys, so the existing behavior is unchanged without additional configuration.These values are described in the readme, and the code is isolated so it could easily be re-used in the discussed refactoring to allow for non-git configuration sources.