fix(test): handle COPY --chmod in platform-agent drift gate (CI fix) (#2990) #2998

Closed
agent-dev-b wants to merge 0 commits from fix/2990-platform-agent-drift-test-copy-chmod into main
Member

Fixes #2990

The Platform (Go) job on main was failing because TestPlatformAgentImageDriftGate did not recognize COPY --chmod=0755 ${PLATFORM_AGENT_TEMPLATE_DIR}/identity-fallback.sh ... as a valid COPY for identity-fallback.sh. PR #2984 added --chmod to that COPY line (required for the non-root tenant base), and the drift-gate string matcher rejected it.

Fix

Cherry-pick of 576305c6 (also at 83435cbe / 1ae54c77) — adds:

  • hasDockerfileCopyForRel helper that uses a regex matching COPY [optional flags] ${PLATFORM_AGENT_TEMPLATE_DIR}/<rel-or-dir> (the matcher permits an optional flag segment such as --chmod=0755 between COPY and the source path).
  • TestHasDockerfileCopyForRel unit test with 6 sub-tests covering: top-level file COPY, top-level file COPY with --chmod, directory COPY for nested file, missing COPY, wrong source variable, nested file missing directory COPY.
  • Updates TestPlatformAgentImageDriftGate to use the new helper (replaces the brittle strings.Contains checks).

Test plan (local)

  • go test ./internal/provisioner -run TestPlatformAgentImageDriftGate — PASS (consumer update verified; SSOT-side checks skip per env, expected).
  • go test ./internal/provisioner -run TestHasDockerfileCopyForRel — PASS (6/6 sub-tests, including the --chmod case).
  • go test ./internal/provisioner (full suite) — PASS (ok 0.161s).
  • go build ./... — clean.
  • go vet ./internal/provisioner — clean.

Notes

  • Per the no-author-self-merge convention: leaving for the gitea-merge-queue / non-author applier.
  • Same root cause / same fix as PR #2986 (Kimi's original, on a different branch base). This PR re-bases the fix on current main to clear the prior #2986's drift.

🤖 Generated with Claude Code

Fixes #2990 The Platform (Go) job on `main` was failing because `TestPlatformAgentImageDriftGate` did not recognize `COPY --chmod=0755 ${PLATFORM_AGENT_TEMPLATE_DIR}/identity-fallback.sh ...` as a valid COPY for `identity-fallback.sh`. PR #2984 added `--chmod` to that COPY line (required for the non-root tenant base), and the drift-gate string matcher rejected it. ## Fix Cherry-pick of `576305c6` (also at `83435cbe` / `1ae54c77`) — adds: - `hasDockerfileCopyForRel` helper that uses a regex matching `COPY [optional flags] ${PLATFORM_AGENT_TEMPLATE_DIR}/<rel-or-dir> ` (the matcher permits an optional flag segment such as `--chmod=0755` between `COPY` and the source path). - `TestHasDockerfileCopyForRel` unit test with 6 sub-tests covering: top-level file COPY, top-level file COPY with `--chmod`, directory COPY for nested file, missing COPY, wrong source variable, nested file missing directory COPY. - Updates `TestPlatformAgentImageDriftGate` to use the new helper (replaces the brittle `strings.Contains` checks). ## Test plan (local) - `go test ./internal/provisioner -run TestPlatformAgentImageDriftGate` — PASS (consumer update verified; SSOT-side checks skip per env, expected). - `go test ./internal/provisioner -run TestHasDockerfileCopyForRel` — PASS (6/6 sub-tests, including the `--chmod` case). - `go test ./internal/provisioner` (full suite) — PASS (`ok 0.161s`). - `go build ./...` — clean. - `go vet ./internal/provisioner` — clean. ## Notes - Per the no-author-self-merge convention: leaving for the gitea-merge-queue / non-author applier. - Same root cause / same fix as PR #2986 (Kimi's original, on a different branch base). This PR re-bases the fix on current main to clear the prior #2986's drift. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Member

Closing as a no-op re-trigger of #2990. The actual fix is in #2990 (add=88, del=20, 1 file, head 8b956c3) — this PR has 0 file changes (the no-op was meant to verify a CI flake on a previous head). #2990 is canonical; please review + land that one. Closes #2998.

Closing as a no-op re-trigger of #2990. The actual fix is in #2990 (add=88, del=20, 1 file, head 8b956c3) — this PR has 0 file changes (the no-op was meant to verify a CI flake on a previous head). #2990 is canonical; please review + land that one. Closes #2998.
agent-dev-b closed this pull request 2026-06-17 05:24:07 +00:00
Some optional checks failed
CI / Python Lint & Test (push) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (push) Successful in 6s
Block internal-flavored paths / Block forbidden paths (push) Successful in 8s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (push) Successful in 5s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (push) Has been skipped
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (push) Successful in 7s
Secret scan / Scan diff for credential-shaped strings (push) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (push) Successful in 6s
CI / Detect changes (push) Successful in 16s
lint-no-coe-on-required / lint-no-coe-on-required (push) Successful in 16s
CI / Shellcheck (E2E scripts) (push) Successful in 1s
CI / Canvas (Next.js) (push) Successful in 2s
CI / Platform (Go) (push) Successful in 2s
Handlers Postgres Integration / detect-changes (push) Successful in 19s
CI / Canvas Deploy Status (push) Successful in 1s
E2E API Smoke Test / detect-changes (push) Successful in 23s
E2E Chat / detect-changes (push) Successful in 27s
E2E API Smoke Test / E2E API Smoke Test (push) Successful in 3s
CI / all-required (push) Successful in 3s
E2E Staging Canvas (Playwright) / detect-changes (push) Successful in 31s
E2E Chat / E2E Chat (push) Successful in 4s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (push) Successful in 3s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (push) Successful in 35s
Handlers Postgres Integration / Handlers Postgres Integration (push) Successful in 23s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (push) Successful in 35s
publish-workspace-server-image / build-and-push (push) Successful in 3m57s
publish-workspace-server-image / Staging auto-deploy (push) Failing after 37s
publish-workspace-server-image / Production auto-deploy (push) Successful in 2m19s
template-delivery-e2e / Template-asset delivery (fresh seo-agent boots WITH skills) (push) Failing after 15m24s
CI / Python Lint & Test (pull_request) Successful in 7s
E2E Peer Visibility (literal MCP list_peers) / detect-changes (pull_request) Successful in 6s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 5s
sop-checklist / review-refire (pull_request_target) Has been skipped
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 6s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 9s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 6s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Has been skipped
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 7s
Required
Details
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2s
Required
Details
qa-review / approved (pull_request_target) Successful in 10s
Required
Details
reserved-path-review / reserved-path-review (pull_request_target) Successful in 8s
Required
Details
sop-checklist / na-declarations (pull_request) N/A: (none)
security-review / approved (pull_request_target) Successful in 8s
Required
Details
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 6s
E2E API Smoke Test / detect-changes (pull_request) Successful in 16s
sop-checklist / all-items-acked (pull_request_target) Successful in 9s
gate-check-v3 / gate-check (pull_request_target) Failing after 14s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 3s
Required
Details
CI / Detect changes (pull_request) Successful in 20s
E2E Chat / detect-changes (pull_request) Successful in 21s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 1s
CI / Canvas (Next.js) (pull_request) Successful in 3s
CI / Platform (Go) (pull_request) Successful in 3s
PR Diff Guard / PR diff guard (pull_request) Successful in 20s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 21s
CI / Canvas Deploy Status (pull_request) Successful in 2s
E2E Chat / E2E Chat (pull_request) Successful in 4s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 28s
CI / all-required (pull_request) Successful in 3s
Required
Details
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 4s
sop-checklist / all-items-acked (pull_request) Compensated by status-reaper (non-required pull_request/pull_request_review governance shadow overridden by successful pull_request_target status; see .gitea/scripts/status-reaper.py)
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 50s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 32s
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#2998