fix(ci): unblock runtime publish and secret scan #1479
Reference in New Issue
Block a user
Delete Branch "ci-fix-main-runtime-secret-scan"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Unblocks the
molecule-core/mainpost-merge CI failures observed during the 2026-05-18 05:12Z hourly CI/security triage.ScanBytesstill sees the full representative shapes.a2a_tools_identitytoscripts/build_runtime_package.py:TOP_LEVEL_MODULES, matching the newworkspace/a2a_tools_identity.pyfile and unblocking the runtime wheel compatibility gate.publish-runtime-autobumpchoose the next patch from both PyPI latest and existingruntime-v<major>.<minor>.*tags, so pre-existing runtime tags do not wedge the post-merge tagger when PyPI upload lagged behind tag creation.Evidence
Fresh failing main evidence:
molecule-core/main@5324e69049fd: combined commit statusfailure.workspace-server/internal/secrets/patterns_test.goforghp_[A-Za-z0-9]{36,}.TOP_LEVEL_MODULES drifted ... ['a2a_tools_identity'].0.1.1000whileruntime-v0.1.1001already existed.Local verification on this branch:
go test ./internal/secretsfromworkspace-server/python3 -m unittest scripts/test_build_runtime_package.py -vpython3 scripts/build_runtime_package.py --version '0.0.0.dev0+pin-compat' --out <tmp>python3 .gitea/scripts/lint-workflow-yaml.py --workflow-dir .gitea/workflowspython3 -m pytest .gitea/scripts/tests/test_prod_auto_deploy.py -q0.1.1000+ latestruntime-v0.1.1003->0.1.1004, with no existing-tag collisionSOP Checklist
Comprehensive testing performed
go test ./internal/secretsfromworkspace-server/,python3 -m unittest scripts/test_build_runtime_package.py -v,python3 scripts/build_runtime_package.py --version '0.0.0.dev0+pin-compat' --out <tmp>, workflow YAML lint, prod-auto-deploy tests, local secret-scan diff reproduction, and local runtime version chooser reproduction.Local-postgres E2E run
docker pull alpine: Failed to initialize: protocol not available, A2A DNS/proxy timeout), not introduced by these three CI/tooling-only edits.Staging-smoke verified or pending
Delegation A2A POST failed rc=28) and should not be papered over by this PR.Root-cause not symptom
workspace/a2a_tools_identity.py, and runtime autobump only considered PyPI latest instead of also considering existing repo tags when prior tag creation outran PyPI upload.Five-Axis review walked
molecule-core; no new service or manual state.No backwards-compat shim / dead code added
Memory/saved-feedback consulted
infra-sre review
APPROVE — correct fixes for all three failure paths.
Fix 1:
publish-runtime-autobump.yml— version bump collisionOld logic:
next = MAJOR.MINOR.(PyPI_latest_patch + 1). Bug: if PyPI latest is behind the most-recently-published runtime tag (e.g. manual publish to PyPI), this computes a version that already exists →bump-and-tagfails on upload conflict.Fix: compare PyPI latest against latest existing
runtime-v{MAJOR}.{MINOR}.*git tag, takemax(), then increment. Python script withparse()+max()handles the case cleanly. Correct.Fix 2:
build_runtime_package.py— missing module allowlist entrya2a_tools_identitywas absent fromTOP_LEVEL_MODULES. This causedpublish-runtime-autobump's wheel build to fail when the runtime bundle includes this module. Added in the right sorted position. Correct.Fix 3:
patterns_test.go— secret scan false positive on test fixturesThe
ghp_EXAMPLE...pattern in test fixtures triggered the repo's ownSECRET_PATTERNS drift linton every push of these test files — creating a feedback loop where the test additions themselves look like leaked secrets.Fix: split the prefix from the body (
"ghp_" + "EXAMPLE...") so no single line contains the full 40-char credential shape.ScanBytesreads the concatenated value so the test still exercises the full pattern, but the committed source contains no 40-char credential-shaped string in one line. Correct pattern.Non-blocking note: once this merges and the 6 push failures clear, the
main-red-watchdogwill auto-close issue #1478. TheE2E Chat (push)failure is separate (internal#1480) and will need its own fix.Review — PR #1479 ✅ Approve
Changes (5 files)
.gitea/workflows/publish-runtime-autobump.yml— Fix version bumping logic to compare against both PyPI latest AND existing runtime tags, taking the max. Correct.scripts/build_runtime_package.py— Addsa2a_tools_identitytoTOP_LEVEL_MODULES. This module was added in identity tools (PR #1451) but wasn't wired into the build script, so it would be excluded from the published PyPI wheel. Right fix.workspace-server/internal/secrets/patterns_test.go— Comprehensive test suite for the secrets Pattern package: compile check, duplicate names guard, known-patterns-presence pins, positive match fixtures (split across string concatenation to prevent secret-scan false positives), negative shapes, and a contract test assertingMatchnever round-trips the secret value. Well-structured.canvas/src/components/__tests__/TestConnectionButton.test.tsx— Better error labeling for network exceptions; adds 404-specific test for internal#492. Clean improvement.canvas/src/components/mobile/MobileChat.tsx— ReusesAgentCommsPanel+AttachmentPreview+downloadChatFilefor mobile parity (#231/#232. Clean import additions + proper auth routing.Note on E2E API Smoke Test failure
E2E API Smoke Testshows failure. None of the changed files touch the platform server ortests/e2e/test_api.sh. This appears to be an environment flake. Recommend re-running the job.Queue hold
Applying
merge-queue-hold— main queue is frozen untilSOP_TIER_CHECK_TOKENis provisioned.[core-security-agent] APPROVED — OWASP Secrets-scan clean. (1) Secret fixture strings split by concatenation in patterns_test.go — prevents regex self-trip while keeping test coverage identical. Strings are EXAMPLE-patterns, not real credentials. (2) publish-runtime version-bump: reads existing git tags + PyPI latest, computes max+1 via Python — no external input. (3) build_runtime_package adds a2a_tools_identity (pre-approved in #1474). No new injection, auth, or SSRF surface.
[core-qa-agent] APPROVED — CI workflow fix (publish-runtime version bump), adds a2a_tools_identity to build modules, splits long test strings to avoid secret-scan false positives. Go secrets tests PASS. e2e: N/A — CI/script-only.