Skip to content

test: avoid credential-bearing URI literals in fixtures and examples - #520

Merged
hossain-rayhan merged 1 commit into
documentdb:mainfrom
hossain-rayhan:rhossain/sync-fixture-cleanup
Nov 20, 2026
Merged

hossain-rayhan merged 1 commit into
documentdb:mainfrom
hossain-rayhan:rhossain/sync-fixture-cleanup

Conversation

@hossain-rayhan

Copy link
Copy Markdown
Collaborator

Summary

  • Check the basic Mongo URI fixture structurally: scheme, user, password, host, path, and query remain explicitly asserted without embedding a complete credential-bearing expected URI.
  • Keep the existing credential-metacharacter escaping tests unchanged.
  • Remove unnecessary authentication data from the connection-string regex assertion fixture.
  • Mark illustrative TLS output as redacted and require an explicitly configured deployment URI for manual longhaul Secret creation.

These are synthetic test/example values, not application credential defaults. Keeping complete credential-bearing literals out of them makes the examples clearer and avoids misleading credential detections without modifying production URI formatting or weakening tests.

Validation

  • go test -race ./mongo and go vet ./mongo in test/shared.
  • go test -race ./pkg/e2eutils/assertions and go vet ./pkg/e2eutils/assertions in test/e2e.
  • Whitespace checks pass.

No operator, CRD, URI-builder, or automated deployment behavior changes.

Validate URI components and credentials structurally while retaining metacharacter-escaping coverage. Remove unnecessary fixture authentication, redact illustrative TLS output and require an explicit runtime URI for manual longhaul deployment.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 33b3cb3c-1b25-4ffb-bff1-ebf0f3d04058
Signed-off-by: Rayhan Hossain <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 21:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the credential-literal cleanup in test fixtures and documentation.

No open issues 🎉

What changed in this PR

This PR removes complete credential-bearing literals from test fixtures and documentation without changing production URI formatting or automated deployment behavior.

Changes:

  • Replace the basic Mongo URI string comparison with explicit component assertions, preserving credential-escaping tests.
  • Remove unnecessary credentials from the connection-string regex fixture and redact illustrative TLS output.
  • Require a deployment-specific LONGHAUL_DOCUMENTDB_URI for manual longhaul Secret creation.
File Description
test/​shared/​mongo/​client_test.go Assert URI components individually instead of comparing a complete credential-bearing literal.
test/​longhaul/​README.md Require an explicitly configured deployment URI for manual Secret creation.
test/​e2e/​pkg/​e2eutils/​assertions/​assertions_test.go Remove authentication data from the regex assertion fixture.
documentdb-playground/​tls/​E2E-TESTING.md Label example output as redacted and replace credentials with placeholders.

Review effort: Balanced

@documentdb-triage-tool documentdb-triage-tool Bot added documentation Improvements or additions to documentation ecosystem test labels Nov 19, 2026
@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: documentation, test, ecosystem
Project fields suggested: Component docs · Priority P2 · Effort M · Status Needs Review
Confidence: 0.95 (deterministic)

Reasoning

component from path globs (docs, test, playground); effort from diff stats (26+9 LOC, 4 files)

If a label is wrong, ping @patty-chow so the rules can be tuned. Issues with component labels are left alone; PR component labels are reconciled from changed paths on every run.

@hossain-rayhan
hossain-rayhan merged commit 43cc308 into documentdb:main Nov 20, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation ecosystem test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants