Skip to content

fix: Address code review issues in select-algorithm samples#87

Merged
diberry merged 10 commits into
Azure-Samples:mainfrom
diberry:fix/select-algorithm-issues
May 22, 2026
Merged

fix: Address code review issues in select-algorithm samples#87
diberry merged 10 commits into
Azure-Samples:mainfrom
diberry:fix/select-algorithm-issues

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented May 22, 2026

Summary

Comprehensive code quality fixes across all 5 select-algorithm samples (Python, TypeScript, .NET, Go, Java) based on 8-agent automated review cycle. This PR passed 7 review rounds before achieving unanimous approval from all 8 review agents.

Changes by Language

All Languages

  • Replace .env files with shell �xport commands (no dotenv dependencies)
  • Fix data file paths to use local data/Hotels_Vector.json (relative to sample root)
  • Document LOAD_SIZE_BATCH env var (default: 100) consistently
  • Remove connection string references — all samples use passwordless/Entra ID
  • Fix README structure: consistent sections across all languages

.NET (select-algorithm-dotnet)

  • Rename config section MongoDB → DocumentDB in appsettings.json
  • Read EmbeddingDimensions from config (was hardcoded)
  • Remove phantom EmbeddingSizeBatch config reference
  • Document DocumentDB__* env var override pattern (double underscore)

Java (select-algorithm-java)

  • Read LOAD_SIZE_BATCH from environment (was hardcoded to 100)
  • Fix
    etryWrites=false in connection setup

TypeScript (select-algorithm-typescript)

  • Remove �nv:init script from package.json
  • Fix data path to local data/ (not ../data/)

Python (select-algorithm-python)

  • Fix README to run from sample root (python src/compare_all.py)
  • Data path resolves relative to root, not src/

Go (select-algorithm-go)

  • Replace .env references with shell exports
  • Consistent data path documentation

Review Process

This PR went through a 3-phase, 8-agent automated review cycle:

Phase Focus Rounds Duration
Phase 1 Code correctness 7 rounds ~1h 13m
Phase 2 Content alignment (PR #240) 3 rounds ~18m
Phase 3 Cross-consistency (code ↔ content) 4 rounds ~12m

Total: 14 review rounds, 9 fix commits, ~2h 13m wall-clock

Review Agents (all 8 approved)

  1. PR Reviewer — structural quality, PR hygiene
  2. Tech Accuracy — factual correctness vs. DocumentDB docs
  3. Copy Editor — language clarity, Microsoft style
  4. Quickstart Reviewer — developer experience, runability
  5. Fact Checker — cross-reference upstream sources
  6. Cross-Language Consistency — parity across 5 languages
  7. Content PR Reviewer — Learn platform compliance
  8. AI Prompts Engineering — prompt/schema validation

Final verdict: ✅ ALL 8 APPROVE

Related PRs

  • Content: MicrosoftDocs/nosql-docs-pr#240 (article fixes, also 8-agent approved)
  • Skills: diberry/project-dina#407 (skill definition fixes)

Conventions Enforced

  • DOCUMENTDB_* prefix for all env vars (never MONGO_*)
  • Passwordless auth via DefaultAzureCredential (never connection strings)
  • Shell exports only (no .env files, no dotenv libraries)

etryWrites=false across all languages

  • Cleanup via VS Code extension (never mongosh)

diberry and others added 10 commits May 22, 2026 07:26
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ions

- All 5 READMEs: fix data copy to 'mkdir -p data && cp ../data/Hotels_Vector.json data/'
- Python, Java: replace 'connection strings' with 'configuration values'
- TypeScript: replace .env/.env.example instructions with shell export pattern,
  annotate SIMILARITY as unused in compare-all mode, fix step numbering (1-5)
- .NET: add note that azd is optional, users can edit appsettings.json directly
- appsettings.json: LoadBatchSize 50 -> 100 to match all other languages

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sistency)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ges)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry merged commit f5a2675 into Azure-Samples:main May 22, 2026
13 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