Repository navigation
Don't fail on deploys that only push config files (cron.yaml, dispatch.yaml) - #400
Open
rootkiller6788 wants to merge 3 commits into
Open
rootkiller6788 wants to merge 3 commits into
rootkiller6788 wants to merge 3 commits into
Conversation
When you deploy only config files such as cron.yaml or dispatch.yaml, gcloud prints an empty "versions" list because no new version was created. The deploy itself succeeded, but the parser treated that as an error and failed the whole step. Accept an empty versions list as long as gcloud listed at least one config, and keep the configs on the response so callers know what was deployed.
For config-only deploys there is no version to describe, so bail out before running "gcloud app versions describe" with empty values. The version outputs stay unset, which is the honest answer here. Also made the parseDeployResponse mock in the tests synchronous, since the real function is.
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 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.
Fixes #353.
Deploying only cron.yaml or dispatch.yaml does work, but the step fails right after the deploy finishes: gcloud prints an empty "versions" list because no new version gets created, and we treated that as an unparseable response. Same repro for dispatch.yaml as reported in the comments.
So I made the parser accept that shape as long as gcloud listed at least one config, and made run() skip the "app versions describe" call when there is no version to describe. The version outputs just stay unset in that case, which seems more honest than filling them with empty strings.
A response with neither versions nor configs (including the existing
[]and{}cases) still throws, so genuinely broken output is not being swallowed.Tests: added cases for the exact stdout from the report, dispatch-only, version+configs together, and versions+configs both empty;
npm testpasses 55/55 and eslint is clean. Rebuiltdist.