Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/vector-search-go-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# CI for the Azure SQL Vector Search Go quickstart sample.
# Security: uses `pull_request` (read-only token, no secrets on forks)
# with an explicit same-repo check to skip fork PRs entirely.
#
# This CI runs static analysis and unit tests only — no live Azure SQL
# Database or Azure OpenAI resource is required or contacted. Live
# end-to-end validation is a separate, manual step (see the sample's
# README and output/sample-output.txt for the explicit no-live-run
# disclosure).

name: "Vector Search Go — Build"

on:
pull_request:
branches: [master]
paths:
- "samples/features/vector-search/vector-search-query-go/**"
push:
branches: [master]
paths:
- "samples/features/vector-search/vector-search-query-go/**"

# Cancel redundant runs for the same PR / branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: Vet, format-check, build, and test
runs-on: ubuntu-latest
timeout-minutes: 10

# Skip CI on fork PRs — prevents external actors from consuming minutes.
if: >-
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name

defaults:
run:
working-directory: samples/features/vector-search/vector-search-query-go

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version: "1.25"
cache-dependency-path: samples/features/vector-search/vector-search-query-go/go.sum

- name: Download dependencies
run: go mod download

- name: Format check (gofmt)
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "The following files are not gofmt-formatted:"
echo "$unformatted"
exit 1
fi

- name: Vet
run: go vet ./...

- name: Build
run: go build ./...

- name: Unit tests (no Azure connectivity required)
run: go test ./... -v
74 changes: 74 additions & 0 deletions .github/workflows/vector-search-python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# CI for the Azure SQL Vector Search Python quickstart sample.
# Security: uses `pull_request` (read-only token, no secrets on forks)
# with an explicit same-repo check to skip fork PRs entirely.
#
# This CI runs static analysis and unit tests only — no live Azure SQL
# Database or Azure OpenAI resource is required or contacted. Live
# end-to-end validation is a separate, manual step (see the sample's
# README and output/sample-output.txt for the explicit no-live-run
# disclosure).

name: "Vector Search Python — Build"

on:
pull_request:
branches: [master]
paths:
- "samples/features/vector-search/vector-search-query-python/**"
push:
branches: [master]
paths:
- "samples/features/vector-search/vector-search-query-python/**"

# Cancel redundant runs for the same PR / branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
name: Lint, type-check, and test
runs-on: ubuntu-latest
timeout-minutes: 10

# Skip CI on fork PRs — prevents external actors from consuming minutes.
if: >-
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name

defaults:
run:
working-directory: samples/features/vector-search/vector-search-query-python

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
samples/features/vector-search/vector-search-query-python/requirements.txt
samples/features/vector-search/vector-search-query-python/requirements-dev.txt

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt

- name: Lint
run: python -m ruff check .

- name: Format check
run: python -m ruff format --check .

- name: Type-check
run: python -m mypy src

- name: Unit tests (no Azure connectivity required)
run: python -m pytest -v
6 changes: 6 additions & 0 deletions .github/workflows/vector-search-typescript-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,11 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Format check
run: npm run format:check

- name: Type-check (build)
run: npm run build
12 changes: 7 additions & 5 deletions samples/features/vector-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@ This provisions:
- **Azure OpenAI** with `text-embedding-3-small` deployment
- **Managed Identity** with appropriate role assignments

After deployment, create the `.env` file for the language samples:
After deployment, create the `.env` file for the language samples. For example, for TypeScript:

```bash
azd env get-values --cwd samples/features/vector-search > samples/features/vector-search/vector-search-query-typescript/.env
```

This writes the deployment outputs (`AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_EMBEDDING_DEPLOYMENT`, `AZURE_SQL_SERVER`, `AZURE_SQL_DATABASE`, etc.) directly into the `.env` file that the samples read at runtime.
This writes the deployment outputs (`AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_EMBEDDING_DEPLOYMENT`, `AZURE_SQL_SERVER`, `AZURE_SQL_DATABASE`, etc.) directly into the `.env` file that the TypeScript, Python, and Go samples read at runtime. Point the same command at another language's folder to configure it instead.

## Language samples

| Language | Folder | Description |
|----------|--------|-------------|
| TypeScript | [vector-search-query-typescript/](./vector-search-query-typescript/) | Vector search with Node.js, tedious driver, and Azure OpenAI |
| Language | Folder | Description | Status |
|----------|--------|-------------|--------|
| TypeScript | [vector-search-query-typescript/](./vector-search-query-typescript/) | Vector search with Node.js, tedious driver, and Azure OpenAI | Implemented; live end-to-end run captured |
| Python | [vector-search-query-python/](./vector-search-query-python/) | Vector search with pyodbc, azure-identity, and Azure OpenAI | Implemented; statically validated (lint, type-check, unit tests) — no live end-to-end run captured yet |
| Go | [vector-search-query-go/](./vector-search-query-go/) | Vector search with go-mssqldb, azidentity, and the OpenAI Go client configured for Azure | Implemented; statically validated (vet, build, unit tests) — no live end-to-end run captured yet; also out of scope for v1 by constitution decision ([ASV-LANG-GO-1](/.github/instructions/vector-search-constitution.instructions.md)) |

## Infrastructure only

Expand Down
18 changes: 18 additions & 0 deletions samples/features/vector-search/vector-search-query-go/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Environment variables (may contain Azure credentials)
.env
.env.local
.env.*.local

# Go build artifacts
/query
/embed
*.exe
*.test

# Sample output — keep the committed reference file (output/sample-output.txt);
# ignore any other ephemeral run artifacts written to this folder.
output/*
!output/sample-output.txt

# Logs
*.log
Loading