canvas-deploy-reminder has:
if: needs.changes.outputs.canvas == 'true'
&& github.event_name == 'push'
&& github.ref == 'refs/heads/main'
ci_job_names() only skipped jobs with `github.event_name` in their `if:`.
The `github.ref` branch was invisible to the detector, so
canvas-deploy-reminder was flagged as missing from all-required.needs —
a false positive that fires on every PR touching canvas/ code.
Now the skip check also fires when `github.ref` is present in the `if:`
condition string, matching the same rationale as the event_name skip:
these jobs never execute in a PR context, so requiring them under
all-required.needs: is not meaningful.
Refs: mc#958 (main), mc#959 (staging)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Two compilation errors were preventing CI/Platform (Go) from running any
tests at all (go vet failed first):
1. delegation_list_test.go: missing `db` import. The file assigns
`db.DB = mockDB` but never imported the `db` package — a silent
omission that compiled before the staging promotion's go.mod bump.
2. org_helpers_security_test.go: three test functions redeclared in
org_helpers_pure_test.go (both files added by the staging promotion):
TestIsSafeRoleName_Valid, TestMergeCategoryRouting_EmptyListDropsCategory,
TestMergeCategoryRouting_EmptyKeySkipped. Removed from security file;
pure_test.go versions use testify and are more comprehensive.
Together with the prevDB/restore fixes in the previous commits, this
should make CI/Platform (Go) fully green.
Refs: mc#975
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Five more test helpers have the same setupTestDB bug (save db.DB but
don't restore on teardown). go test -race runs tests in parallel; when
test A sets db.DB = mockA and test B sets db.DB = mockB, if A runs
first and cleanup closes mockA, B then runs with db.DB pointing at a
closed mock.
Fixed files:
- internal/registry/liveness_test.go setupLivenessTestDB
- internal/registry/hibernation_test.go setupHibernationMock
- internal/registry/access_test.go setupMockDB
- internal/registry/healthsweep_test.go setupTestDB
- internal/scheduler/scheduler_test.go setupTestDB
All now follow: prevDB := db.DB; db.DB = mockDB;
t.Cleanup(func() { mockDB.Close(); db.DB = prevDB })
Total files fixed for mc#975: 8 files, ~20 test helper functions across
the workspace-server. Together with the CI fix to remove the
PHASE3_MASKED workaround, this should make CI/Platform (Go) stable.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
activity_test.go: 6 test functions used `defer mockDB.Close(); db.DB =
mockDB` without saving/restoring the previous db.DB. go test -race could
run subsequent tests with db.DB pointing at a closed mock.
a2a_queue_test.go: setupTestDBForQueueTests had the same bug as
setupTestDB — called `t.Cleanup(func(){mockDB.Close()})` without
restoring prevDB. All callers of this helper are now protected.
Pattern applied everywhere: save prevDB, assign mockDB, t.Cleanup
restores both. Together with the delegation_list_test.go fix in the
previous commit, this should eliminate all remaining race-condition
failures in CI/Platform (Go).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
mc#975 root cause: TestListDelegationsFromLedger_* and
TestListDelegationsFromActivityLogs_* assign db.DB = mockDB then defer
mockDB.Close(), but never save/restore the previous db.DB value. With
go test -race (parallel execution), any test running after one of these
13 tests sees db.DB pointing at a closed sqlmock and fails.
Fix: save prevDB := db.DB before assignment, then t.Cleanup(func() {
mockDB.Close(); db.DB = prevDB }) — the same pattern already used by
setupTestDB for the SSRF/restore path.
Also fix setupTestDB in handlers_test.go: it called t.Cleanup(func()
{ mockDB.Close() }) but left db.DB pointing at the closed mock; now it
also restores prevDB.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>