-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Issue#1243 configurations with unimplemented environments #1244
Merged
namusyaka
merged 1 commit into
sinatra:master
from
JonMidhir:issue#1243-configurations_with_unimplemented_environments
Mar 22, 2018
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Load current environment settings regardless of support for other env…
…ironments in settings file.
- Loading branch information
commit dac516088e9a8279dd7d9a2e079ff23e4ffab5b1
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
default: &default | ||
foo: default | ||
bar: baz | ||
|
||
development: | ||
<<: *default | ||
foo: development | ||
|
||
production: | ||
<<: *default | ||
foo: production | ||
|
||
test: | ||
<<: *default | ||
foo: test |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't remove the conditional expressions because the following unintentional behavior will happen.
I think that it isn't desirable to automatically overwrite
settings
defined by default by config file settings.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@namusyaka Running this against both master and this branch I notice the default setting being overwritten. I don't think the original conditional defends against this behaviour. I can't actually think of a condition where the original would be met at all.
However, I can add this behaviour if you'd prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, makes sense.
It seems that the sample I showed was wrong.
However, we must grasp the condition that the original conditional expression was trying to protect.
Welcome if you can look it up.
Then, if the original conditional expression is meaningful, we have to add a test on that matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the case where this would fail. If the value is being set to nil and it's set using this style, the conditional will be met and setting ignored:
However in both other styles the conditional is not met, and the default value is overwritten:
If we're changing the behaviour anyway do we really want to stop people from overriding default values using the config file? It seems reasonable that it should be possible to do so.
If not we can exclude all cases or have it function exactly as it did before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's no problem, I think.
I've reviewed this change to a certain extent, but I judged that it is almost no problem.