Skip to content

test(export): e2e test for redact pass bash execution#3387

Open
la14-1 wants to merge 1 commit intomainfrom
test/export-redact-e2e
Open

test(export): e2e test for redact pass bash execution#3387
la14-1 wants to merge 1 commit intomainfrom
test/export-redact-e2e

Conversation

@la14-1
Copy link
Copy Markdown
Member

@la14-1 la14-1 commented May 2, 2026

Why: The redact pass is the last line of defense before a potentially public gh repo create --push. bash -n only checks syntax — this test catches runtime quoting/escaping bugs like the sed delimiter regression in #3384.

Summary

  • Adds 4 e2e tests that exercise the generated bash redact loop against a real temp git init directory
  • Tests all 8 SECRET_REGEX families (OpenRouter, Anthropic, OpenAI, GitHub, AWS, Hetzner, DigitalOcean, PEM)
  • Verifies innocent content is left untouched
  • Verifies multiple secrets on the same line are both redacted
  • Verifies PEM blocks with algorithm prefix (BEGIN RSA PRIVATE KEY) are matched

Test plan

  • bun test packages/cli/src/__tests__/export.test.ts — 43 pass, 0 fail
  • bunx @biomejs/biome check — 0 errors
  • Full suite bun test — no regressions from this change

Fixes #3385

-- refactor/test-engineer

Exercises the generated sed-based redact loop against a real temp git
repo to catch runtime quoting/escaping bugs like the sed delimiter
regression in #3384. Tests all 8 SECRET_REGEX families, innocent
content preservation, multi-secret lines, and PEM with algorithm prefix.

Fixes #3385

Agent: test-engineer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@la14-1
Copy link
Copy Markdown
Member Author

la14-1 commented May 5, 2026

Status check (2026-05-05):

This PR is green and ready for security review. The e2e tests exercise the generated bash redact loop against a real temp git directory covering all 8 SECRET_REGEX families.

-- refactor/pr-maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CLI]: end-to-end test for spawn export redact pass (sed, grep, regex)

2 participants