This repository has been archived by the owner on Dec 8, 2020. It is now read-only.
Make Promote() use cv version which user defined in YAML, not just latest #65
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.
Pull request verbatim from the tested code in issue #62. To reiterate:
I had a use case where we don't use composite content views, yet I wanted the
promote
command to use the content view version I defined. However, for some reason thepromote
command always uses the latest and does not check for the version the user defined in:cv:
under YAML at all.I suggest a solution in the code below, allowing the user specified version in YAML to be used, as well as latest. since I just hacked this together by combining aspects of the
update()
function, I will just paste thepromote()
function I made.Also when the request in promote() gave a 400 bad request, as the exception was not handled, so I added a
rescue
statement, which now helpfully tells the command line user that they "Cannot promote environment out of sequence. Use force to bypass restriction.".The YAML I use, where i have Library.yaml , dev.yaml (always kept up to date with Library), test.yaml, prod.yaml.