Repository navigation
A released beta reaches a self-hosted install by itself, and a broken install is noticed - #879
Merged
Merged
Conversation
… install is noticed A beta never installed without a person, and a broken install went unnoticed (incident vu): - Permission changes are real ones. CloudFormation reports a Modify for every policy that names another part's output, since that value is known only after apply, even when the documents are byte for byte the same. permission_changes now compares each such Modify with the running release: both sides resolved the way the template resolves them (the running stack's parameter values, the change set's, an import keeping its running value when the parent feeds it the same way and its source output is the same), policy documents as IAM reads them. Only a difference in actions, resources or conditions counts; an Add, a real widening and anything that can't be compared still hold. - The release notes list the permission changes against the previous release, with the same comparison (.github/scripts/iam_diff.py, a step in release.yml). - The beta channel's window can be day "any": the hourly check installs each new beta, at least gap_hours (default 2) after the last install. Stable keeps its window; "any" is refused on stable. - The watch after an update probes Chat: the streaming function answers a direct invoke of /api/stream/probe by making Chat's own calls (the member check every stream runs, one call per DynamoDB grant in infra/streaming-dynamodb.json, changing nothing). A refusal rolls the release back like a failed worker probe. The updater may invoke the streaming function (ProbeChatAfterUpdate). - Alarms that can fire: log metric filters on ERROR lines (gateway, worker, streaming, updater), on a new structured GitHub rate-limit line, and on a new structured Chat answer line, each alarmed as a share of the traffic with metric math, into the alerts topic.
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.
Summary
A released beta now reaches a self-hosted install with no person in the loop, and a broken install gets noticed (incident
vu). Four things stood in the way:The dashboard's settings control is CoderHelm/coderhelm#496.
Changes
Real permission changes (
lambda/updater/handler.py:permission_changes,ChangeSides,template_resolve,resource_on,resource_difference)native_holdis unchanged, so a real widening still waits for a person.Release notes (
.github/scripts/iam_diff.py,release.yml)release-notesartifact. The publish job appends that artifact to the GitHub release notes. dist/ and SHA256SUMS are untouched.Beta any hour (
validate_settings,in_window,gap_wait,last_install_at,decide)day: "any": on the beta channel, the hourly check installs each new beta, at leastgap_hours(default 2, 1 to 168) after the last install that changed the stack.gap_hoursthrough.Chat probe (
services/gateway/src/routes/stream_probe.rs,probe_chatandprobe_releasein the updater)POST /api/stream/probe, but only to a direct invoke whose request context namescoderhelm-probe.invalid(404 otherwise). It makes Chat's own calls:require_sso::check_scoped), for a member that doesn't exist;infra/streaming-dynamodb.jsongrants the stream routes, on a key no record has. Writes carry a condition that can't hold, so nothing is written.InvokeWithResponseStreamduring the watch.ProbeChatAfterUpdate(lambda:InvokeFunctionon the streaming function), and the fixtures are updated. This new statement is itself a real permission change, so the first update to this release asks once.Alarms (
infra/lib/monitoring-stack.ts)$.level) and of the updater (Lambda's[ERROR]text line);event = "github_rate_limited", written once per refusal throughRateLimited::logged;event = "chat_answer"line with outcomeansweredorfailed(sign-in check or model).Docs:
docs/self-host/updates.md(Any hour, what counts as a permission change, Chat's health check) anddocs/self-host/troubleshooting.md(the install's own alarms). Incidentvu:services/worker/src/passes/incidents/vu_unattended_beta_and_alarms.rsanddocs/incidents/vu_unattended_beta_and_alarms.md.Verification
lambda/tests/test_updater_real_permissions.py, against a fake parent and two parts whose policy is reported as a dynamic Modify and whose import is known only after apply:native_holdis ""..github/scripts/test_iam_diff.py: reordering is no change; an added action, a changed branch, a changed condition and an added permission resource are listed; the previous-release choice for beta and stable tags is checked.dynamodb:GetItemresources.lambda/tests/test_updater_beta_window.py:lambda/tests/test_updater_chat_probe.py:services/gateway/src/routes/stream_probe.rstests: the probe makes one real call for every granted (action, table) and writes nothing; a member record that can't be read fails it; any request that isn't the updater's invoke gets 404 and runs none of its calls; every listed action is one the probe can make.infra/test/log-alarms.test.ts(CDK assertions):cargo fmt --all --check,rustfmt --check --edition 2021 worker/src/passes/incidents/*.rs,cargo clippy -p common -p worker -p gateway --all-targets -- -D warnings,cargo test -p common -p worker -p gateway,python3 -m unittest discover -s lambda/tests(623),python3 -m unittest discover -s .github/scripts, infranpm test(198),check_workflows.py.