Repository navigation
SCA-313: Scope-gate admin deploys and retarget omi-tv activation - #11709
Conversation
Keep generated-client-only commits from taking the shared prod environment slot, and make the Grafana activation panels sourceable from the Firestore activation route. Failure-Class: none Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]>
The gcp_admin.yml scope job invokes the classifier at deploy time; manifest contract and fixtures already own the CI surface. Failure-Class: none Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]>
Point at grafana/README.md instead of growing the component guide. Failure-Class: none Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]>
There was a problem hiding this comment.
1 issue found across 14 files
Confidence score: 3/5
- In
.github/scripts/check_admin_deploy_scope.py,admin_deploy_appliescan miss required deploy triggers when a generated-client change is combined with a public-build promotion helper change, which risks silently skipping admin deployment for changes that should ship—include all transitive public-build helper paths in the deploy-input set to close this gap.
Not reviewed (too large): web/admin/grafana/dashboards/omi-tv.json (~6,112 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.
You’re at about 91% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/scripts/check_admin_deploy_scope.py">
<violation number="1" location=".github/scripts/check_admin_deploy_scope.py:93">
P1: When a generated-client change is bundled with a public-build promotion helper change, `admin_deploy_applies` ignores the helper and skips deployment. Add all transitive public-build helper paths to the deploy-input set or fail closed on unknown co-changed paths.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| return True | ||
| if changed_files is None: | ||
| return True | ||
| return any(path_can_affect_admin_deploy(path) for path in changed_files) |
There was a problem hiding this comment.
P1: When a generated-client change is bundled with a public-build promotion helper change, admin_deploy_applies ignores the helper and skips deployment. Add all transitive public-build helper paths to the deploy-input set or fail closed on unknown co-changed paths.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/scripts/check_admin_deploy_scope.py, line 93:
<comment>When a generated-client change is bundled with a public-build promotion helper change, `admin_deploy_applies` ignores the helper and skips deployment. Add all transitive public-build helper paths to the deploy-input set or fail closed on unknown co-changed paths.</comment>
<file context>
@@ -0,0 +1,157 @@
+ return True
+ if changed_files is None:
+ return True
+ return any(path_can_affect_admin_deploy(path) for path in changed_files)
+
+
</file context>
There was a problem hiding this comment.
Declining this one — it is not valid on this head.
admin_deploy_applies is any(path_can_affect_admin_deploy). A generated-client path is out of scope, but a public-build helper path is in scope, so a bundle of the two already returns true and deploys. Changing the any() semantics would be the wrong fix.
Coverage for that case is in test_generated_client_plus_public_build_helper_still_deploys.
… honest Scope now diffs github.event.before...github.sha and fail-closes when before is missing or zero. Admission requires live scope wiring, workflow_dispatch, and uncommented deploy keys. Partial Firestore caches no longer overlay a silent rate, and classic keeps the daily viral-metrics fallback. Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]>
Pre-push exports GIT_DIR into child git commands, so the disposable classifier repos must clear GIT_* and disable inherited hooks. Co-authored-by: Cursor <[email protected]> Co-authored-by: multica-agent <[email protected]>
…ren (#13850) Git exports GIT_DIR to hooks; from a linked worktree it is the absolute path of .git/worktrees/<name>. scripts/pre-push passed it to every check it ran, so agents-md-lean's self-test `git init <fixture>` reinitialized the real repository instead: git guessed it bare and wrote core.bare=true into the config every worktree shares. With extensions.worktreeConfig on, that shared value also applies to linked worktrees, so the fixture's ls-files failed and the push of #11183 was refused with "ignored worktree copies must not be discovered". Four earlier fixes scrubbed the variable one caller at a time (#11413, #11709, #11795, #12564). Clear it once at the top of the gate, after it changes to the work tree root, and drop the two Flutter-phase copies it makes redundant. test-pre-push-worktree-fallback.sh ran the gate with a bogus bare GIT_DIR and relied on the gate still using it to fail at the base-ref lookup. The gate now uses the work tree, which has origin/main, so the harness names a base branch no repository has to keep failing fast at the same step. Verification: - Real `git push` from a disposable linked worktree, real pre-push hook, the checker from origin/main: hook env GIT_DIR=<sbx>/main/.git/worktrees/wt; shared core.bare false -> true; with extensions.worktreeConfig=true the exact #11183 AssertionError. A push from the main worktree exports no GIT_DIR and is unaffected. - scripts/test-pre-push-git-env.sh passes with the fix and fails with the gate from origin/main and with only the new unset removed (core.bare=false -> core.bare=true in the fixture's shared config). - All 13 manifest checks triggered by scripts/pre-push pass through run_checks.py --lane local; pre-push-worktree-fallback is Windows-only in the manifest and passes when run directly on macOS. Failure-Class: new Co-authored-by: Claude Opus 5 <[email protected]>
Summary
scopejob ongcp_admin.ymlso generated-client-only and other non-runtime diffs skip green beforeenvironment: prod/ GCP creds / image build.workflow_dispatchstill always deploys. Lock group andcancel-in-progress: falseare unchanged.omi-tvboard, retarget the two activation panels to/api/omi/stats/activation?days=60(rate,weeks[]), and add an apply script that no-ops whenGRAFANA_TOKENis unset.viral-metricssummary.activationRateandactivation[]serve those figures so today's Infinity panels do not stay blank. Telemetry coverage stays a separate field.Closes #11700
Closes #11701
Closes SCA-313
Failure-Class: none
Test plan
python3 .github/scripts/check_admin_deploy_scope_admission.pypython3 .github/scripts/test_check_admin_deploy_scope.py(11 tests: generated-client skip, runtime/public-build/workflow_dispatch deploy, lock/cancel-in-progress: false, dashboard selectors, apply skip)python3 .github/scripts/check_public_build_contract.pypython3 .github/scripts/check-deployment-concurrency.pynpx tsc --noEmitinweb/adminnpm testinweb/admin(106 passed, including activation shim + Grafana selectors)make preflight— 96 checks passed in 72.48s on16658d74d9(OMI_PR_BODY_FILE=pr-body.md)Verification notes
web/admin/**/*.generated.tsalone, or that file plus backend/desktop-only paths.web/admin/**path,gcp_admin.yml, public-build deploy/prepare/promotion actions, preflight/smoke scripts,config/public-build-*.json, andworkflow_dispatch.applies=true).GET /grafana/api/dashboards/uid/omi-tv; instanceid/versionstripped; uidomi-tvkept.gcp_admin.ymlrunsweb/admin/grafana/apply_omi_tv_dashboard.pyafter a successful deploy and skips whensecrets.GRAFANA_TOKENis empty.