Skip to content

Conversation

@jdetter
Copy link
Collaborator

@jdetter jdetter commented Jan 26, 2026

Description of Changes

(jdetter): Github marked Ryan's PR as merged because I rebased it without updating the base branch first - my bad.
Original PR: #4120

This PR fixes C#-related CI failures when testing against v1.12.0 before the corresponding NuGet packages are available on nuget.org.

  • CI: Ensure local C# NuGet packages are used consistently
    • Pack crates/bindings-csharp/{BSATN.Runtime,Runtime} with -c Release so the configured local package sources (bin/Release) actually contain the .nupkgs.
    • Run ./sdks/csharp/tools~/write-nuget-config.sh in CI to generate a NuGet.Config that maps SpacetimeDB.BSATN.Runtime / SpacetimeDB.Runtime to those local sources (with nuget.org as fallback for non-SpacetimeDB dependencies).
    • Add an explicit dotnet restore --configfile NuGet.Config step before tests, and run dotnet test --no-restore, so restore always uses the intended config and does not “accidentally” restore from nuget.org.
  • write-nuget-config.sh: Make NuGet config discovery + mapping deterministic
    • Write NuGet.Config (capitalized) and include <clear /> + an explicit nuget.org source to avoid inherited sources and to keep PackageSourceMapping functional.
    • Also write a repo-root NuGet.Config so dotnet publish/pack invoked from templates (outside sdks/csharp/) still discovers the same override behavior.
  • Smoketests quickstart: avoid PackageSourceMapping restore failures
    • Ensure smoketest helper packing uses Release, and when repo-root NuGet.Config exists, perform dotnet restore --configfile ... + dotnet pack --no-restore so pack/restore are evaluated with the same sources/mapping.
    • When editing configs, prefer NuGet.Config casing for Linux discovery and ensure nuget.org exists as a source for the fallback mapping.

API and ABI breaking changes

No changes

Expected complexity level and risk

1

Testing

  • Locally tested concept after simulating local repro.
  • Confirmed CI passes in this branch

@jdetter jdetter requested a review from bfops January 26, 2026 16:40
@jdetter jdetter changed the title Rekhoff/ci testing v1.12.0 CI: Fix of C# tests failures Jan 26, 2026
Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, it seems to work in a test PR for me! (#4124)

@jdetter jdetter changed the base branch from jdetter/upgrade-version-upgrade-tool to master January 27, 2026 03:34
@jdetter jdetter enabled auto-merge January 27, 2026 04:53
@jdetter jdetter mentioned this pull request Jan 27, 2026
2 tasks
@jdetter jdetter added this pull request to the merge queue Jan 27, 2026
Merged via the queue into master with commit c3848d5 Jan 27, 2026
29 checks passed
Centril pushed a commit that referenced this pull request Jan 27, 2026
# Description of Changes

(jdetter): Github marked Ryan's PR as merged because I rebased it
without updating the base branch first - my bad.
Original PR: #4120

This PR fixes C#-related CI failures when testing against `v1.12.0`
before the corresponding NuGet packages are available on nuget.org.

* CI: Ensure local C# NuGet packages are used consistently
* Pack `crates/bindings-csharp/{BSATN.Runtime,Runtime}` with `-c
Release` so the configured local package sources (`bin/Release`)
actually contain the `.nupkg`s.
* Run `./sdks/csharp/tools~/write-nuget-config.sh` in CI to generate a
`NuGet.Config` that maps `SpacetimeDB.BSATN.Runtime` /
`SpacetimeDB.Runtime` to those local sources (with `nuget.org` as
fallback for non-SpacetimeDB dependencies).
* Add an explicit `dotnet restore --configfile NuGet.Config` step before
tests, and `run dotnet test --no-restore`, so restore always uses the
intended config and does not “accidentally” restore from `nuget.org`.
* `write-nuget-config.sh`: Make NuGet config discovery + mapping
deterministic
* Write `NuGet.Config` (capitalized) and include `<clear />` + an
explicit `nuget.org` source to avoid inherited sources and to keep
`PackageSourceMapping` functional.
* Also write a repo-root `NuGet.Config` so `dotnet publish/pack` invoked
from templates (outside `sdks/csharp/`) still discovers the same
override behavior.
* Smoketests quickstart: avoid `PackageSourceMapping` restore failures
* Ensure smoketest helper packing uses `Release`, and when repo-root
`NuGet.Config` exists, perform `dotnet restore --configfile ...` +
`dotnet pack --no-restore` so pack/restore are evaluated with the same
sources/mapping.
* When editing configs, prefer `NuGet.Config` casing for Linux discovery
and ensure `nuget.org` exists as a source for the fallback mapping.

# API and ABI breaking changes

No changes

# Expected complexity level and risk

1

# Testing

- [X] Locally tested concept after simulating local repro.
- [x] Confirmed CI passes in this branch

---------

Co-authored-by: rekhoff <[email protected]>
Co-authored-by: Zeke Foppa <[email protected]>
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.

4 participants