Repository navigation
Add service settings and roll back only to deployments that served - #28
Merged
Merged
Conversation
.valar.yml accepts deployment.cpu (millicores), deployment.memory (MiB), deployment.http and deployment.minRunning. A push that deploys sends the declared keys in one PATCH settings after the upload and before the build, so the build's deployment pins them; nothing is sent without keys, with --no-deploy or with deployment.skip, which the push now honours as documented. Refusals keep their exit codes: 403 is notAllowed with a hint that raising needs a token with full access, 400 is invalid. valar service settings [service] shows the settings, which were set, their bounds and the project's budget, and passes the response through with --json. settings set name=value and settings reset name wrap PATCH. deployment rollback now targets the newest deployment below the live one that served (done or expired, without a failure or error) instead of counting versions, which could pick a failed deployment. --delta counts only those. --settings pinned|current is passed through.
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.
Client side of service settings (RFC-0013 release 2) and a fix to rollback's target choice.
.valar.ymldeployment.httpanddeployment.minRunningare accepted as well; the server validates them. The keys are in the config types,schema/valar.yml.jsonand the unknown-key check. Files without them behave as before.build pushWhen the push deploys, the declared keys go out in one
PATCH .../settingsafter the artifact upload (which creates a new service) and beforePOST builds, because the deployment row pins settings when the build is submitted. Nothing is sent when no key is declared, with--no-deploy, or withdeployment.skip.deployment.skipwas documented as "build without deploying" but never read; the push now honours it.Refusals keep the existing exit codes: 403 is
notAllowed(4), with a hint that raising needs a token with full access when the server names a field; 400 isinvalid(2). A server without the settings route fails the push with a clear message instead of ignoring the keys.valar service settingsvalar service settings [service]shows each value, whether it was set or is the default, its bounds, and the project's budget;--jsonpasses the response through.valar service settings set cpu=500 memory=2048andvalar service settings reset memorywrap PATCH.deployment rollbackThe target used to be the deployment
deltaplaces below the newest by version number, so it could be a failed or never-served deployment. It is now the newest deployment below the live one (the newestdone) that served:doneorexpired, with nofailureand noerror.--delta ncounts only those, and must be at least 1. The API does not distinguish an expired deployment that served from one superseded before activation, so both count.--settings pinned|currentis passed through; without it the server's default (pinned) applies.Tests
Table-driven against a test HTTP server: PATCH between upload and build, no PATCH without keys or with
--no-deploy, 403/400 mapping and the hint, old server, settings output (human and JSON passthrough), set/reset parsing, rollback target selection, and the schema golden file.