Repository navigation
Remove telemetry-service/ now that the collector deploys from its own repo - #234
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
anth-volk
force-pushed
the
remove-telemetry-service
branch
from
October 20, 2026 18:20
257e953 to
df4447f
Compare
anth-volk
force-pushed
the
remove-telemetry-service
branch
from
October 20, 2026 18:42
df4447f to
1ceca9f
Compare
anth-volk
marked this pull request as ready for review
October 20, 2026 22:06
anth-volk
marked this pull request as draft
October 20, 2026 22:06
anth-volk
force-pushed
the
remove-telemetry-service
branch
from
October 20, 2026 22:39
1ceca9f to
566a708
Compare
The production dashboard deploy confirmed that the collector read secret exists by running telemetry-service/scripts/check-secrets-exist.sh. It now runs `deploy-dashboard.sh check-read-secret-exists`, which makes the same metadata- only `gcloud secrets describe` call with the same PROJECT_ID and READ_SECRET_NAME from the Production environment, so the deploy no longer depends on telemetry-service/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… repo PolicyEngine/microcosm-collector holds the collector's history, source, tests and deployment. Remove telemetry-service/, its telemetry-service.yml workflow (including the manual redeploy kept for rolling the deploy-source switch back), and the test of that workflow. Point the build monitor's documentation at the collector's repo. New tests require that the directory and workflow stay removed, that no tracked file refers to either, and that no workflow or workflow script here deploys the collector's Cloud Run service or migration job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test asserted that telemetry-service/ did not exist on disk. Switching an existing clone to this branch removes the tracked files but leaves ignored ones, such as .venv/ and __pycache__/, so the test failed there. It now requires that git tracks no file under the directory or at the removed workflow's path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removing telemetry-service/README.md removed the only description of the dashboard's own settings for reading the collector. Move it into the Build progress documentation: MICROCOSM_TELEMETRY_COLLECTOR_URL, MICROCOSM_TELEMETRY_READ_SECRET_VERSION and MICROCOSM_TELEMETRY_GOOGLE_IDENTITY_PROVIDER, the Vercel OIDC trust, the per-environment secret access, local development with Application Default Credentials, and what the production deploy's read-secret check does and doesn't show. Also correct the claim that the read credential comes from the deployment environment: the server fetches a Secret Manager version itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Production deployments don't take MICROCOSM_TELEMETRY_COLLECTOR_URL from the Vercel project's settings: deploy.yml passes the GitHub Production environment variable of the same name to vercel deploy --env. The read secret version and the identity provider do come from the Vercel project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gcloud stub replaced its arguments file on each call, so the tests saw only the last call. A check that first read the secret's value with `gcloud secrets versions access` and then ran the describe call passed test_read_secret_check_reads_only_the_secret_metadata. The stub now appends one record per call, and the tests compare the full list: exactly one `gcloud secrets describe` call when the secret exists or is missing, and no call when a setting is missing. The old script's test on main compared the full list of calls too. Test-only; the script already makes just the describe call. Against a temporary, uncommitted change to the script that adds the value-reading call, this file gave 2 failed (the two tests above); against the committed script, 7 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub Actions expands `${{ vars.NAME }}` to an empty string when the
variable doesn't exist, so a missing TELEMETRY_GCP_PROJECT_ID or
TELEMETRY_READ_SECRET_NAME reaches check-read-secret-exists as an empty
PROJECT_ID or READ_SECRET_NAME. The tests only removed the variable. Run
each case both ways: the check must fail, name the setting, and not call
gcloud.
Test-only; the script already treats an empty value as missing. Against a
temporary, uncommitted change that treats an empty value as present
(`${!name+x}` in place of `${!name-}`), this file gave 2 failed (the two
empty cases: the check exited 0 after calling gcloud); against the
committed script, 9 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
telemetry-collector-client.ts accepts plain HTTP for both localhost and 127.0.0.1, but the settings table named only localhost. Documentation only, so no red step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
force-pushed
the
remove-telemetry-service
branch
from
October 22, 2026 13:15
3509e33 to
df1e4ba
Compare
This was referenced Oct 22, 2026
Brings in 425 commits from main (1e5e147). One conflict, in docs/build-monitor.md's "Hosted collector" paragraph: keep main's text, which covers the Vercel OIDC way of reading the collector and points to frontend/HOSTED_RUNTIME.md, and keep this branch's sentence saying the collector's source, tests and deployment are in PolicyEngine/microcosm-collector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… collector main's frontend/HOSTED_RUNTIME.md now has "Reading the telemetry collector", which covers the same settings as this branch's "Reading the collector" section in docs/build-monitor.md, plus MICROCOSM_TELEMETRY_VERCEL_OIDC and MICROCOSM_BUILD_MONITOR_COLLECTOR_ONLY, which that section omitted. Remove the section, so the settings are described once, and name deploy-dashboard.sh check-read-secret-exists in HOSTED_RUNTIME.md's description of the production deploy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 1 found that the test for "nothing here deploys the collector" matched exact strings under .github/ only, so it missed `gcloud beta run deploy`, google-github-actions/deploy-cloudrun, `vars['TELEMETRY_SERVICE']`, lowercase names, and scripts outside .github/ that a workflow runs. The test now matches regular expressions in any case, in every tracked file except Markdown documents and test directories (main's workflow tests use `vars.TELEMETRY_SERVICE` as a fixture), and lists files through git like the module's other tests. Red: with two uncommitted files added with `git add -N`, a workflow using deploy-cloudrun with `vars['TELEMETRY_SERVICE']` and a script running `gcloud beta run deploy`, the old test passed and the new one failed, listing exactly those two files. Test-only: no workflow or script here deploys the collector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 2 found that the collector-deploy test missed global flags before `run` (`gcloud --project "$PROJECT_ID" run deploy`), `gcloud run services update` and `replace`, and argument lists, and that skipping every directory named `tests` was wider than needed and skipped Python test directories but not TypeScript fixtures. The `gcloud` pattern now allows anything on the same line between `gcloud` and `run`, quotes and commas as separators, and `services update|update-traffic|replace`. Instead of directories, the test skips test modules by file name (`test_*.py`, `*_test.py`, `*.test.*` and `*.spec.*` JavaScript and TypeScript files), whose patterns and fixtures name these settings. Red: with two uncommitted files added with `git add -N`, tests/planted_collector_deploy.sh running `gcloud run deploy` and .github/scripts/planted-collector-update.sh running `gcloud --project "$PROJECT_ID" run services update … --image`, the previous test passed and this one failed, listing exactly those two files. Test-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 3 found that the collector-deploy test only asserted an empty result, so a broken pattern would still pass, and that the single-line `gcloud` pattern missed commands split over several lines of text: a folded YAML block (which the round-1 pattern caught), a command continued with a backslash, and an argument list with one item per line. It also matched prose such as "run deploy-frontend" and the read-only `gcloud run jobs describe`. Move the search into collector_deploying_files and test it with files that deploy the collector and files that deploy nothing or are skipped (Markdown documents and test modules). This commit fails: with the current patterns, the search misses the folded, continued and one-argument-per-line examples. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `gcloud` pattern now looks up to 200 characters past `gcloud`, across line breaks, for `run` followed by a command that changes a service or job: `deploy`; `services update`, `update-traffic` or `replace`; `jobs deploy`, `create`, `update`, `replace` or `execute`. Words may be separated by whitespace, line breaks, quotes, commas or backslashes, and the command must be followed by one of those or the end of the file, so `run deploy-frontend` in a comment and the read-only `gcloud run jobs describe` no longer match. The Cloud Run action must end at a word boundary. Makes test_collector_deploy_search_finds_deploys_and_only_deploys pass (CI runs it). Among tracked files that are neither Markdown nor test modules, only .github/scripts/deploy-dashboard.sh and .github/workflows/deploy.yml mention gcloud, and neither runs a Cloud Run command (git grep). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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 #232
Summary
PolicyEngine/microcosm-collector holds the collector's source, tests and deployment, and has deployed it since 2026-10-21. This PR removes the copy that stayed here:
telemetry-service/(35 files),.github/workflows/telemetry-service.yml(its pull-request checks and the manual redeploy that calibration-diagnostics#233 kept as a rollback path), andfrontend/tests/test_telemetry_service_workflow.py, which tested that workflow..github/workflows/deploy.ymlrantelemetry-service/scripts/check-secrets-exist.sh "$READ_SECRET_NAME". It now runsbash .github/scripts/deploy-dashboard.sh check-read-secret-exists, a new command in the script that already holds the deploy's shell logic. It makes the same metadata-only call,gcloud secrets describe "$READ_SECRET_NAME" --project "$PROJECT_ID" --format=none, after the same Google Cloud authentication, and never reads the secret's value. An unset or emptyPROJECT_IDorREAD_SECRET_NAME, or a secret that can't be described, stops the job before anything is deployed.frontend/HOSTED_RUNTIME.md("Reading the telemetry collector", onmainsince this PR was written) is the one description of the dashboard's settings for reading the collector; its list of deploy steps now namescheck-read-secret-exists.docs/build-monitor.mdsays the collector's source, tests and deployment are in microcosm-collector.frontend/tests/test_collector_lives_in_its_own_repo.py, new tests intest_deploy_script.py, one changed test intest_deploy_workflow.py): no tracked file is in or refers to the removed directory or workflow (asked throughgit ls-files, because switching a clone to this branch leaves ignored files such as.venv/on disk); no tracked file other than Markdown documents and test modules runs a Cloud Run command that changes a service or job (gcloud … run deploy,run services update|update-traffic|replace,run jobs deploy|create|update|replace|execute, in any case, within 200 characters aftergcloud, so across global flags, folded YAML, continued commands and argument lists), uses the Cloud Run deploy action, or names the collector's Cloud Run deployment settings, and committed examples test that search both ways; the new command makes exactly onegcloudcall, the metadata call, and stops without callinggcloudwhen either setting is unset or empty.After this PR, no tracked file refers to
telemetry-service/,telemetry-service.yml,check-secrets-existorrequire-collector-push-runs-finished.Merge requirements
mainfirst deployed on 2026-10-21, for the release of microcosm-collector#11. From then to 2026-11-27 it ran for 39 release commits; 38 succeeded, each deploying staging and then production. (Its two earlier release runs, on 2026-10-19 and 2026-10-20, skipped both deploy jobs.)telemetry-service.ymlhere last ran on 2026-10-21, a pull-request run that deploys nothing; its last run onmainwas on 2026-10-20. So no collector deploy has come from this repository since the move.Merging
deploy.yml, as every merge does, and that deploy runscheck-read-secret-exists. Merge only when no othermainCI or "Deploy production" run is unfinished: a merge cancels an unfinishedmainCI run and skips its deploy.maincame in with merge commitfbf00d3(one conflict,docs/build-monitor.md's "Hosted collector" paragraph: keptmain's text, which covers reading the collector with the Vercel OIDC token, and this branch's sentence about microcosm-collector). Earlier updates of this branch were rebases; from now onmaincomes in only by merge commits.Deployment configuration
No variable or secret is added, removed or renamed. Values aren't listed here; each lives where the Provider column says.
PROJECT_ID←vars.TELEMETRY_GCP_PROJECT_IDProductionenvironment variabledeployjob (environment: Production) → step "Check collector read secret exists"env:→deploy-dashboard.sh check-read-secret-exists→gcloud --projectmain(2026-11-25 to 2026-11-30) passed this step, which onmainstill runs the old script with the same variables and the samegcloudcallREAD_SECRET_NAME←vars.TELEMETRY_READ_SECRET_NAMEProductionenvironment variable naming a Google Secret Manager secretenv:→gcloud secrets describeTELEMETRY_GCP_WIF_PROVIDER,TELEMETRY_GCP_DEPLOY_SERVICE_ACCOUNTProductionenvironment secretswith:ofgoogle-github-actions/auth@v2, the step before;setup-gcloudthen givesgcloudthat loginMICROCOSM_TELEMETRY_COLLECTOR_URL,MICROCOSM_TELEMETRY_READ_SECRET_VERSION,MICROCOSM_TELEMETRY_GOOGLE_IDENTITY_PROVIDER,MICROCOSM_TELEMETRY_VERCEL_OIDCfrontend/HOSTED_RUNTIME.mdThe removed
telemetry-service.ymlread thestagingenvironment and mostTELEMETRY_*variables ofProduction. After this merges, nothing reads them; see "Cleanup after merging".Tests
Red, then green, for each change (from before
mainwas merged in):80a2d1cCheck the collector read secret from the dashboard deploy scripttest_deploy_script.py::test_read_secret_check_reads_only_the_secret_metadata,test_missing_read_secret_stops_deployment,test_read_secret_check_requires_its_configuration[PROJECT_ID]and[READ_SECRET_NAME], andtest_deploy_workflow.py::test_dashboard_checks_read_secret_metadata_before_deployment3386b7cRemove telemetry-service/test_collector_lives_in_its_own_repo.py5cceb49Check the removed collector directory with git ls-filestelemetry-service/.venv/and__pycache__/folders9587f51Record every gcloud call in the read-secret check testsd4cb573Test the read-secret check with empty settings45294f6Find collector deploys in any spelling, outside .github too (review round 1)google-github-actions/deploy-cloudrunwithvars['TELEMETRY_SERVICE'], and a script runninggcloud beta run deploy. The new test failed, listing exactly those two72a6925Match more Cloud Run deploy forms; skip only test modules (review round 2)tests/planted_collector_deploy.sh(gcloud run deploy) and.github/scripts/planted-collector-update.sh(gcloud --project "$PROJECT_ID" run services update … --image). The new test failed, listing exactly those two3f79f03Test the collector-deploy search with committed examples (review round 3)test_collector_deploy_search_finds_deploys_and_only_deploysfailed, because the single-line pattern missed the folded YAML, continued-command and one-argument-per-line examples0cb6223Find gcloud deploys split over lines; ignore prose and read-only callsdeploy-dashboard.shanddeploy.ymlmentiongcloud, and neither runs a Cloud Run commandThe merge and the documentation commit change no code or test. The last four commits change only
test_collector_lives_in_its_own_repo.py. Planted files were never committed. CI runs the tests; locally only the tests above were run, selected individually, to see them fail.Review
Adversarial review of this update, at most three rounds:
8f11fb6.github/only45294f645294f6d4cb573. Code quality: the test missed global flags beforerun,services update|replaceand argument lists, and skipped wholetestsdirectories72a692572a6925gcloudpattern missed commands split over lines (folded YAML, which round 1's pattern caught) and matched prose (run deploy-frontend) and read-onlyrun jobs describe3f79f03(failing examples),0cb6223Not changed: commits
80a2d1cand3386b7c(October) add their tests together with the change, and the table above records their failing runs. Splitting them would need a force-push. The round-3 fixes were not reviewed again: three rounds is the limit.Cleanup after merging (manual; not done by this PR)
Each is its own tracker task and needs Anthony's go-ahead.
stagingGitHub environment, which onlytelemetry-service.ymlused. It still holds the secretsMICROCOSM_TELEMETRY_COLLECTOR_READ_TOKENandTELEMETRY_HF_QUALIFICATION_TOKEN.Production, delete theTELEMETRY_*variables other thanTELEMETRY_GCP_PROJECT_IDandTELEMETRY_READ_SECRET_NAME(keep bothTELEMETRY_GCP_*secrets andMICROCOSM_TELEMETRY_COLLECTOR_URL). Then give the read-secret check its own service account: one that may only read the read secret's metadata (roles/secretmanager.vieweron that secret, not the project), which this repository's GitHub Actions jobs may act as through the existing Workload Identity provider. PointTELEMETRY_GCP_DEPLOY_SERVICE_ACCOUNTat it, check that the next deploy's read-secret step passes, then remove this repository's permission to act as the collector's deploy service account.🤖 Generated with Claude Code