fix(tests)+build: complete secret-scan fixture cleanup for #1420 #1431
Reference in New Issue
Block a user
Delete Branch "runtime/fix-api03-test-fixture"
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
PR #1430 fixed the
sk-ant-DEADBEEF*fixtures but missed twosk-ant-api03-*tokens intest_sanitize_agent_error_reason_scrubs_all_secret_formats. Both match the secret-scan patternsk-ant-[A-Za-z0-9_-]{40,}and must be replaced.Changes
sk-ant-api03-AbCdEf...(62 chars, bare)sk-FAKEPLACEHOLDER...(53 chars, bare)sk-*path (≥24 chars)sk-ant-api03-ZZZZ1...(47 chars, bare)anon_fakefakefake...(45 chars, JSON-quoted)apiKeypath (≥24 chars)The
ghp_fakefakefake...I tried first incorrectly triggered the GitHub PAT patternghp_[A-Za-z0-9]{36,}— switched toanon_prefix.Tests:
test_sanitize_agent_error_reason_scrubs_all_secret_formatsandtest_sanitize_agent_error_reason_still_scrubs_secretsboth pass.Depends on: merges into
fix/issue212-actionable-agent-error-reason(this PR) → fast-forward offix/issue212-actionable-agent-error-reasonin PR #1420.🤖 Generated with Claude Code
The secret-scan workflow flags sk-ant-[A-Za-z0-9_-]{40,} patterns. Two sk-ant-api03-* fixture tokens (47 and 62 chars) were present in test_sanitize_agent_error_reason_scrubs_all_secret_formats. They were not replaced by PR #1430 (which only fixed the sk-ant-DEADBEEF* tokens). Replace with tokens that still exercise the same scrubber paths: - BARE sk-* case (≥24 chars after "sk-"): use sk-FAKEPLACEHOLDER... (53 chars total; starts with "sk-" so the bare-pattern scrubber catches it, but lacks "sk-ant-" so the secret-scan pattern does not fire). - JSON-quoted apiKey value (≥24 chars): use anon_fakefakefake... (45 chars; satisfies the JSON-quoted redaction path; does not match any secret-scan credential pattern). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>infra-runtime-be review: APPROVED ✅
This PR completes the fixture cleanup PR #1430 started. Two
sk-ant-api03-*tokens (47 and 62 chars) were still matching the secret-scan patternsk-ant-[A-Za-z0-9_-]{40,}— these were not replaced by #1430 which only targetedsk-ant-DEADBEEF*tokens.Fixes applied:
sk-ant-api03-AbCdEf...sk-FAKEPLACEHOLDER...(53 chars)sk-*≥24 charssk-ant-api03-ZZZZ1...anon_fakefakefake...(45 chars)apiKey≥24 charsWhy
sk-FAKEPLACEHOLDER...is safe: starts withsk-(triggers bare scrubber) but NOTsk-ant-(secret-scan requiressk-ant-prefix).anon_prefix matches no credential pattern.Why
ghp_was rejected:ghp_fakefakefake...(43+ chars) matches GitHub PAT patternghp_[A-Za-z0-9]{36,}.Tests:
test_sanitize_agent_error_reason_scrubs_all_secret_formatsandtest_sanitize_agent_error_reason_still_scrubs_secretsboth pass.CI status: Secret scan pending — expected to pass once CI runs.
🤖 Generated with Claude Code
[core-qa-agent] APPROVED — test-only: replaces remaining sk-ant-api03 fixtures in test_executor_helpers.py (test_sanitize_agent_error_reason_scrubs_all_secret_formats) with safe placeholders: sk-FAKEPLACEHOLDER... and anon_fakefakefake... (both avoid sk-ant-[A-Za-z0-9_-]{40,} secret-scan pattern). Logic unchanged — both assertions still verify [REDACTED] present and secret string absent. Python tests pass (2145/6sk). e2e: N/A — test-only.