Skip to content

fix: add .global. to connection string hostname in vector-search TS + Java#84

Merged
diberry merged 1 commit into
Azure-Samples:mainfrom
diberry:squad/256-fix-global-hostname
May 14, 2026
Merged

fix: add .global. to connection string hostname in vector-search TS + Java#84
diberry merged 1 commit into
Azure-Samples:mainfrom
diberry:squad/256-fix-global-hostname

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented May 14, 2026

Closes diberry/project-dina#256

What

Adds .global.\ to the DocumentDB connection string hostname in:

  • vector-search-typescript/src/utils.ts
  • vector-search-java IVF.java, HNSW.java, DiskAnn.java

Why

Per Khelan Modi's guidance, all samples must use the global read-write endpoint format (<cluster>.global.mongocluster.cosmos.azure.com) to auto-follow active write region after replica promotion. Without .global., connections silently become read-only after failover.

Verification

Pattern matches vector-search-python, vector-search-go, vector-search-dotnet, and all select-algorithm samples.

…script and vector-search-java

Closes diberry/project-dina#256

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented May 14, 2026

Team Review — Round 1

Reviewer Verdict Notes
Statler (Devil's Advocate) ⚠️ REQUEST CHANGES Flagged agent samples missing .global. — DISMISSED: verified all agent source files already use .global. Also noted no test evidence — N/A for sample repos.
Scooter (Quality) ✅ APPROVE Confirmed all 4 files updated correctly; agent samples already correct; matches Python/Go reference.
Architect ⚠️ REQUEST CHANGES Flagged README examples not using .global. — OUT OF SCOPE for this issue; separate issue to be filed.
Security ✅ APPROVE No credential exposure, injection risk, or auth regressions. OIDC/Managed Identity model unchanged.
Algorithm ✅ APPROVE Logic correct. .global. subdomain is DNS-level routing; no latency overhead. All format strings valid.
Integration ✅ APPROVE SRV DNS format valid with .global., MongoDB driver handles transparently, connection params preserved.
Beauregard (PR Hygiene) ✅ APPROVE Exactly 4 files, 4 insertions/4 deletions. In-scope only. Branch naming correct. Commit message well-formed.
Fact Checker ✅ APPROVE .global. endpoint format verified against official Microsoft Learn DocumentDB samples. Failover behavior claim architecturally sound.

Result: 6/8 APPROVE — 2 dismissed (false positive + out of scope)

Summary

This PR correctly adds .global. to all 4 targeted connection strings in vector-search-typescript and vector-search-java samples. All source files in the repo have been verified — no other non-.global. patterns remain in any source file. Changes are minimal, surgical, and consistent with the Python/Go reference implementations.

The two REQUEST CHANGES findings were resolved:

  • Statler's agent sample concern: All agent samples (�ector-search-agent-typescript, �ector-search-agent-go) already use .global. correctly.
  • Architect's README concern: README documentation updates are out of scope for issue #256. A separate issue will track README alignment.

Approved — ready to merge.

@diberry diberry merged commit a3bd860 into Azure-Samples:main May 14, 2026
8 checks passed
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.

1 participant