Skip to content

Fix secret redaction test expectations for full redaction format#15235

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-ci-failures-again
Feb 12, 2026
Merged

Fix secret redaction test expectations for full redaction format#15235
pelikhan merged 2 commits intomainfrom
copilot/fix-ci-failures-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

A test case in redact_secrets.test.cjs was failing because it expected partial redaction (abc***) while the implementation correctly uses full redaction (***REDACTED***).

Changes

  • Updated test assertion in "should redact 6-character secrets" case to expect ***REDACTED*** instead of abc***
  • Aligns test expectations with the CWE-200 security fix that prevents information disclosure through prefix preservation
// Before (incorrect expectation)
expect(fs.readFileSync(testFile, "utf8")).toBe("Secret: abc*** test"));

// After (matches secure implementation)
expect(fs.readFileSync(testFile, "utf8")).toBe("Secret: ***REDACTED*** test"));

The implementation in redact_secrets.cjs was already correct—this only updates the test to match.

Original prompt

Fix ci failures

Custom agent used: ci-cleaner
Tidies up the repository CI state by formatting sources, running linters, fixing issues, running tests, and recompiling workflows


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

The test was expecting partial redaction (abc***) but the correct
security behavior is full redaction (***REDACTED***) to prevent
information disclosure (CWE-200). Updated test to match the secure
implementation.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix continuous integration failures Fix secret redaction test expectations for full redaction format Feb 12, 2026
Copilot AI requested a review from pelikhan February 12, 2026 20:51
@pelikhan pelikhan marked this pull request as ready for review February 12, 2026 20:53
Copilot AI review requested due to automatic review settings February 12, 2026 20:53
@pelikhan pelikhan merged commit 051fed4 into main Feb 12, 2026
2 checks passed
@pelikhan pelikhan deleted the copilot/fix-ci-failures-again branch February 12, 2026 20:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a failing unit test by aligning the expected redaction output with the existing secure redaction behavior (full replacement with a fixed string to avoid prefix disclosure).

Changes:

  • Update the "should redact 6-character secrets" test assertion to expect full redaction (***REDACTED***) instead of partial masking.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants