Repository navigation
test: use a secret-shaped fake credential in redaction tests (2/2) - #22737
bolichen97 wants to merge 1 commit into
Conversation
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. Every changed file is a test file, so the diff adds or changes no user-visible control and needs no screenshot. [UX-REVIEWED] af4e42b Description read[DESCRIPTION-READ] 8d4dc988629494ef23294d9eee5dadcd919d01044d7bca1ed4a7f0c8c4034576 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Test-only fixture swap with no product code or user-visible surface; design issues: none. [DESIGN-REVIEWED] af4e42b Description read[DESCRIPTION-READ] 80c728bc5c49231f15249bc6c415f7bf0097feb9f10a4232658c240237a0ac91 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Tests that use an AWS access key ID as their stand-in for "a credential" now use a fake token the redactor treats as a secret (a GitLab- or Slack-shaped fake, or a labelled fake secret key). No product code changes; every test passes on main before and after.
757e454 to
af4e42b
Compare
|
Problem / Motivation
Goal: Redaction tests that only need "some credential" use a fake value the redactor treats as a secret, not an AWS access key ID.
About 430 test files use the AWS documentation key ID as their stand-in for a credential. The redaction design in #22552 moves key IDs to the Identifier tier, which is never redacted. Once that lands, every one of those tests would stop exercising redaction at all.
Why it matters
Without this swap, the key-ID change would have to rewrite these tests in the same PR as the security change, which buries the real behaviour change under thousands of mechanical lines. Done first, the swap is reviewable on its own, and the follow-up PR carries only the tests whose expected result really changes.
Not a goal
What changed (motivation → approach → change)
Tests used a key ID to mean "a credential", so a tier change for key IDs would silently empty them. Each such test now uses a fake token that is a secret under every tier: a GitLab-shaped
glpat-fake with the same 16-character body, a Slack-shapedxoxb-fake where the test depends on a 20-character length or on a body that stops at_, and a labelled fake secret key where the test reads a labelled value.Where a test cut the fake at a fixed offset (
[4:], a padding length, a split index), the offset moves with the longer prefix so the test still exercises the same boundary. A few pinned digests of input-echoing transcripts are updated for the new input text.website/src/test/sanitizeExfiltrationUrls.test.tstakes the Slack-shaped fake, which the frontend mirror also redacts.This is the second of two test-only PRs; together they cover every such test. The two touch disjoint files and each passes on main alone.
Backwards compatibility
Compatible: only tests change; nothing a user runs is touched.
Removes nothing: every test keeps its assertion; only the fake input changes.
Tests
Every changed test passes on
origin/mainwith the swap, run file by file (about 12,400 tests). The only reds in that run also fail on unmodified main on this host (test_design_tweak_backend.py,test_design_tweak_devproc.py: the host refuses the preview with 403;test_prompt_override_encoding.py: a host binary check), and CI runs them in its own environment.No test is added, so no determinism proof applies.
Manual verification
N/A - test-only change; the suite is the verification.
Related Issues
Part of #22552
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)