fix(test): handle COPY --chmod in platform-agent drift gate #2986

Closed
agent-dev-a wants to merge 1 commits from fix/drift-test-copy-chmod into main
Member

Fixes drift-gate regression introduced by #2984.

PR #2984 added --chmod=0755 to the identity-fallback.sh COPY in Dockerfile.platform-agent. The drift-gate string-based matcher only looked for the literal COPY ${PLATFORM_AGENT_TEMPLATE_DIR}/<rel> prefix, so TestPlatformAgentImageDriftGate started failing on the IMAGE-BAKED identity check.

What

  • Extract hasDockerfileCopyForRel to centralise the two valid COPY shapes (top-level file vs directory) and document them.
  • Use a regex matcher that permits optional Dockerfile flags (e.g. --chmod=0755) between COPY and the source path.
  • Keep the test Dockerfile-side checks always-run and SSOT-side checks conditional.

Test plan

  • go test -run TestPlatformAgentImageDriftGate ./internal/provisioner/ passes.
  • Existing CI lanes that run this package should go green.

SOP checklist

  • Comprehensive testing performed: unit test passed locally.
  • Local-postgres E2E run: N/A — test-only change, no runtime surface.
  • Staging-smoke verified or pending: N/A.
  • Root-cause not symptom: fixes the matcher to account for legitimate Dockerfile COPY flags.
  • Five-Axis review walked: trivial test-only change.
  • No backwards-compat shim / dead code added: helper replaces inline logic.
  • Memory consulted: N/A.
Fixes drift-gate regression introduced by #2984. PR #2984 added `--chmod=0755` to the `identity-fallback.sh` COPY in `Dockerfile.platform-agent`. The drift-gate string-based matcher only looked for the literal `COPY ${PLATFORM_AGENT_TEMPLATE_DIR}/<rel>` prefix, so `TestPlatformAgentImageDriftGate` started failing on the IMAGE-BAKED identity check. ## What - Extract `hasDockerfileCopyForRel` to centralise the two valid COPY shapes (top-level file vs directory) and document them. - Use a regex matcher that permits optional Dockerfile flags (e.g. `--chmod=0755`) between `COPY` and the source path. - Keep the test Dockerfile-side checks always-run and SSOT-side checks conditional. ## Test plan - `go test -run TestPlatformAgentImageDriftGate ./internal/provisioner/` passes. - Existing CI lanes that run this package should go green. ## SOP checklist - Comprehensive testing performed: unit test passed locally. - Local-postgres E2E run: N/A — test-only change, no runtime surface. - Staging-smoke verified or pending: N/A. - Root-cause not symptom: fixes the matcher to account for legitimate Dockerfile COPY flags. - Five-Axis review walked: trivial test-only change. - No backwards-compat shim / dead code added: helper replaces inline logic. - Memory consulted: N/A.
agent-dev-a added 1 commit 2026-06-16 03:46:06 +00:00
fix(test): handle COPY --chmod in platform-agent drift gate
CI / Python Lint & Test (pull_request) Successful in 5s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 7s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 6s
sop-checklist / review-refire (pull_request_target) Has been skipped
Harness Replays / detect-changes (pull_request) Successful in 6s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 7s
CI / Detect changes (pull_request) Successful in 14s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 3s
E2E API Smoke Test / detect-changes (pull_request) Successful in 14s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 8s
qa-review / approved (pull_request_target) Failing after 8s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 8s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 8s
security-review / approved (pull_request_target) Failing after 8s
CI / Canvas (Next.js) (pull_request) Successful in 2s
CI / Canvas Deploy Status (pull_request) Successful in 1s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 16s
PR Diff Guard / PR diff guard (pull_request) Successful in 16s
E2E Chat / detect-changes (pull_request) Successful in 22s
gate-check-v3 / gate-check (pull_request_target) Failing after 16s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 23s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4
sop-checklist / na-declarations (pull_request) N/A: (none)
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
E2E Chat / E2E Chat (pull_request) Successful in 3s
sop-checklist / all-items-acked (pull_request_target) Successful in 20s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 35s
Harness Replays / Harness Replays (pull_request) Successful in 1m18s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m21s
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Platform Boot (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge user_tasks (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Workspace Requests (core#2606) (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Creates Workspace (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge (compile+skip) (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Platform Agent (pull_request) Has been cancelled
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 2m2s
CI / Platform (Go) (pull_request) Successful in 2m52s
CI / all-required (pull_request) Successful in 7s
audit-force-merge / audit (pull_request_target) Has been skipped
94a2e538fd
PR #2984 added `--chmod=0755` to the identity-fallback.sh COPY in
Dockerfile.platform-agent. The drift-gate's string-based matcher only
looked for the literal `COPY ${PLATFORM_AGENT_TEMPLATE_DIR}/<rel>`
prefix, so the test started failing on the IMAGE-BAKED identity check.

- Extract `hasDockerfileCopyForRel` to centralise the two valid COPY
  shapes (top-level file vs directory) and document them.
- Use a regex matcher that permits optional Dockerfile flags (e.g.
  `--chmod=0755`) between `COPY` and the source path.
- Keep the test's Dockerfile-side checks always-run and SSOT-side
  checks conditional.

Fixes drift-gate regression from #2984.
agent-dev-a force-pushed fix/drift-test-copy-chmod from ed8f5b1778 to 94a2e538fd 2026-06-16 03:46:06 +00:00 Compare
agent-dev-a closed this pull request 2026-06-16 04:58:38 +00:00
Some required checks failed
CI / Python Lint & Test (pull_request) Successful in 5s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 7s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 6s
sop-checklist / review-refire (pull_request_target) Has been skipped
Harness Replays / detect-changes (pull_request) Successful in 6s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 7s
CI / Detect changes (pull_request) Successful in 14s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 3s
Required
Details
E2E API Smoke Test / detect-changes (pull_request) Successful in 14s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 8s
Required
Details
qa-review / approved (pull_request_target) Failing after 8s
Required
Details
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 8s
Required
Details
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 8s
security-review / approved (pull_request_target) Failing after 8s
Required
Details
CI / Canvas (Next.js) (pull_request) Successful in 2s
CI / Canvas Deploy Status (pull_request) Successful in 1s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 16s
PR Diff Guard / PR diff guard (pull_request) Successful in 16s
E2E Chat / detect-changes (pull_request) Successful in 22s
gate-check-v3 / gate-check (pull_request_target) Failing after 16s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 23s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4
sop-checklist / na-declarations (pull_request) N/A: (none)
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
E2E Chat / E2E Chat (pull_request) Successful in 3s
sop-checklist / all-items-acked (pull_request_target) Successful in 20s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 35s
Harness Replays / Harness Replays (pull_request) Successful in 1m18s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m21s
Required
Details
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Platform Boot (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge user_tasks (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Workspace Requests (core#2606) (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Creates Workspace (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge (compile+skip) (pull_request) Has been cancelled
E2E Staging SaaS (full lifecycle) / E2E Staging Concierge Platform Agent (pull_request) Has been cancelled
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 2m2s
CI / Platform (Go) (pull_request) Successful in 2m52s
CI / all-required (pull_request) Successful in 7s
Required
Details
audit-force-merge / audit (pull_request_target) Has been skipped

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2986