Skip to content

[WIP] Address feedback on redactor config validation#46

Merged
hyp3rd merged 3 commits intofeat/secretsfrom
copilot/sub-pr-45
Jan 12, 2026
Merged

[WIP] Address feedback on redactor config validation#46
hyp3rd merged 3 commits intofeat/secretsfrom
copilot/sub-pr-45

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

  • Understand the feedback and analyze the code
  • Add test case for duplicate keys in the same WithRedactionKeys call
  • Add test case for keys already in default keys
  • Run tests to validate the new test cases
  • Code review and final validation
  • Fix formatting issue

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

Copilot AI and others added 2 commits January 12, 2026 14:04
Add test cases to validate the behavior when duplicate keys are provided to
WithRedactionKeys, including:
- Duplicate keys in the same call
- Keys with different cases (normalized to same key)
- Keys already in default keys (should error)
- Multiple keys already in defaults (should error)
- Mix of duplicate and default keys (should error)

The new TestRedactorDuplicateKeys validates that duplicate keys are properly
handled by the addedCount logic, ensuring at least one unique key is added.

Co-authored-by: hyp3rd <62474964+hyp3rd@users.noreply.github.com>
Co-authored-by: hyp3rd <62474964+hyp3rd@users.noreply.github.com>
@hyp3rd hyp3rd marked this pull request as ready for review January 12, 2026 14:05
@hyp3rd hyp3rd self-requested a review as a code owner January 12, 2026 14:05
Copilot AI review requested due to automatic review settings January 12, 2026 14:05
@hyp3rd hyp3rd merged commit 90dbc6a into feat/secrets Jan 12, 2026
2 checks passed
@hyp3rd hyp3rd deleted the copilot/sub-pr-45 branch January 12, 2026 14:06
Copilot stopped work on behalf of hyp3rd due to an error January 12, 2026 14:06
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 adds comprehensive test coverage for redactor configuration validation, specifically addressing feedback on handling duplicate keys and keys that are already in the default set. The changes add test cases to ensure the validation logic correctly rejects invalid configurations while accepting valid ones.

Changes:

  • Added three new test cases to TestRedactorInvalidConfig for scenarios where all provided keys are already in defaults or are duplicates
  • Added new test function TestRedactorDuplicateKeys with three test cases validating successful duplicate key handling scenarios

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

wantMatch bool
}{
{
name: "duplicate keys in same call - first is added",
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The comment says "first is added" but it would be more accurate to say "duplicates are silently ignored" or "only unique keys are added". The current wording might suggest that only the first of all keys is added, rather than conveying that duplicate keys are deduped.

Suggested change
name: "duplicate keys in same call - first is added",
name: "duplicate keys in same call - only unique keys are added",

Copilot uses AI. Check for mistakes.
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