Skip to content

Add CI validation workflow and collection lifecycle#3

Closed
diberry wants to merge 2 commits intoarticle2/select-algorithmfrom
ci/workflow-and-lifecycle
Closed

Add CI validation workflow and collection lifecycle#3
diberry wants to merge 2 commits intoarticle2/select-algorithmfrom
ci/workflow-and-lifecycle

Conversation

@diberry
Copy link
Copy Markdown
Owner

@diberry diberry commented Apr 30, 2026

Summary

Adds a GitHub Actions workflow that validates all samples can build and run, plus standardizes collection lifecycle across all samples.

Changes

  • Workflow (.github/workflows/validate-samples.yml): Dual-mode (build-only on PR, full-run on manual trigger), serialized execution, secret masking
  • Lifecycle standardization: All samples now drop-if-exists at start and always-drop at end for clean CI runs
  • TypeScript type safety: MongoSearchResult interface, env validation, safe finally block

Depends on

Testing

  • Workflow runs serially to avoid collection name collisions
  • Each sample creates its own collections and cleans up after itself

diberry and others added 2 commits April 30, 2026 07:51
…rop at end

All 10 sample directories now follow the same pattern:
- START: conditionally drop collection only if it exists
- END: always drop collection for cleanup (in finally/defer block)

Languages updated: TypeScript, Python, Go, Java, .NET

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add validate-samples.yml workflow (dual-mode: build-only + full-run)
- Serialized execution: TS -> Py -> Go -> Java -> .NET
- Secret masking for all env vars
- Collection lifecycle: drop-if-exists at start, always drop at end
- TypeScript type safety improvements in compare-all.ts

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

diberry commented Apr 30, 2026

Retargeting to upstream Azure-Samples/documentdb-samples

@diberry diberry closed this Apr 30, 2026
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