Skip to content

ci: build the .NET and Python onboarding examples - #66

Open
mikemcdougall wants to merge 1 commit into
trunkfrom
ci/build-dotnet-python-examples
Open

ci: build the .NET and Python onboarding examples#66
mikemcdougall wants to merge 1 commit into
trunkfrom
ci/build-dotnet-python-examples

Conversation

@mikemcdougall

Copy link
Copy Markdown
Contributor

Summary

The README and docs/getting-started.md prominently advertise running all three example apps:

cd examples/dotnet && dotnet run
cd examples/python && pip install -r requirements.txt && python main.py
cd examples/javascript && npm install && npm start

But CI only built the JavaScript example (examples-javascript). The examples/dotnet and examples/python onboarding samples had zero CI coverage and could silently break against schema or API changes — the exact regression the JS-example job exists to prevent. (For instance, the dotnet example can drift to a different Grpc.Net.Client version than getting-started / the smoke test.)

Change

Add two cheap jobs mirroring examples-javascript:

  • examples-dotnetdotnet build examples/dotnet/GeospatialExample.csproj. The csproj compiles the protos directly via Grpc.Tools, so this is a restore+build with no buf/network codegen.
  • examples-python — install requirements.txt, buf generate the Python stubs into examples/python (matching the documented generate → copy gen/python/* flow), then import-check main.py plus the generated modules it imports.

Both jobs are wired into the notify success gate.

Verification (local)

  • dotnet build examples/dotnet/GeospatialExample.csproj --configuration ReleaseBuild succeeded. 0 Warning(s) 0 Error(s).
  • buf generate --template buf.gen.python.yaml --output examples/python → stubs generated; import-check prints python example imports resolve.
  • ci.yml parses as valid YAML; job graph intact.

Finding addressed

  • .github/workflows/ci.yml — .NET/Python examples advertised with run commands but never built/run in CI.

README and docs/getting-started advertise running all three example apps,
but CI only built the JavaScript example (examples-javascript). The
examples/dotnet and examples/python onboarding samples had zero CI coverage
and could silently break against schema or API changes — the same regression
risk the JS-example job was added to prevent.

Add two cheap jobs that mirror examples-javascript:

- examples-dotnet: dotnet build examples/dotnet/GeospatialExample.csproj.
  The csproj compiles the protos directly via Grpc.Tools, so this is a
  restore+build with no buf/network codegen. Verified locally: build
  succeeds with 0 warnings/errors.

- examples-python: install requirements, buf generate the Python stubs into
  examples/python (matching the documented generate -> copy gen/python/*
  flow), then import-check main.py and the generated modules it imports.
  Verified locally: generation succeeds and the imports resolve.

Both jobs are wired into the notify gate. This catches drift such as the
example pinning a different Grpc.Net.Client version than getting-started/the
smoke test.

Finding: .github/workflows/ci.yml — dotnet/python examples advertised but
never built in CI.
Comment thread .github/workflows/ci.yml
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
Comment thread .github/workflows/ci.yml
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
Comment thread .github/workflows/ci.yml
echo "${RUNNER_TEMP}" >> "$GITHUB_PATH"

- name: Setup Python
uses: actions/setup-python@v5
Comment thread .github/workflows/ci.yml
# (generate -> copy gen/python/* next to main.py -> import).
- name: Install Example Dependencies
run: pip install -r examples/python/requirements.txt

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.

2 participants