Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5a85922
Update the version upgrade tool
jdetter Jan 21, 2026
beca5be
Allow the user to just accept the insta snapshot change
jdetter Jan 21, 2026
9d040e7
Fix CI check
jdetter Jan 24, 2026
1eaaf95
Merge branch 'master' into jdetter/upgrade-version-upgrade-tool
jdetter Jan 24, 2026
7d6ea9a
Run pnpm build as well
jdetter Jan 24, 2026
c72e0ab
Merge remote-tracking branch 'origin/jdetter/upgrade-version-upgrade-…
jdetter Jan 24, 2026
179ef5a
Also pnpm install
jdetter Jan 24, 2026
47ce799
Small fix from template rename
jdetter Jan 24, 2026
89ce89c
Install npm/pnpm in workflow
jdetter Jan 24, 2026
be961a0
Upgrade npm version
jdetter Jan 24, 2026
6a8b300
Test after accepting new snapshot
jdetter Jan 24, 2026
3ade9ed
cargo fmt
jdetter Jan 24, 2026
43504e4
One more fix
jdetter Jan 24, 2026
2804fdc
cargo fmt
jdetter Jan 24, 2026
e44fa54
Small fix for CI
jdetter Jan 25, 2026
ac9b494
Cleanup
jdetter Jan 25, 2026
ea0b07c
Small bug fix
jdetter Jan 25, 2026
8009ae9
Install cargo insta when a review is required
jdetter Jan 25, 2026
e09974f
When review is required, the first pass of tests is expected to fail
jdetter Jan 25, 2026
4a6228f
Fix lints
jdetter Jan 25, 2026
030d5fd
Broken out explicit `dotnet restore` for dotnet tests
rekhoff Jan 25, 2026
3db9710
Update `write-nuget-config` with explicit clear and a key for nuget.org
rekhoff Jan 25, 2026
e4ab002
Patched CI to copy `sdks/csharp/nuget.config` to repo root
rekhoff Jan 25, 2026
8ea2e14
Corrected `NuGet.Config` capitalization and add another NuGet Override
rekhoff Jan 25, 2026
773c450
Corrected another NuGet..Config casing, added discrete context for Nu…
rekhoff Jan 26, 2026
f0fd738
Incorporating similar fixes to the quickstart test
rekhoff Jan 26, 2026
bc5ea6b
Removing override from `quickstart.py` workflow
rekhoff Jan 27, 2026
f4e0094
[rekhoff/ci-testing-v1.12.0]: Merge remote-tracking branch 'origin/ma…
bfops Jan 27, 2026
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
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ jobs:
with:
global-json-file: global.json

- name: Override NuGet packages
shell: bash
run: |
dotnet pack -c Release crates/bindings-csharp/BSATN.Runtime
dotnet pack -c Release crates/bindings-csharp/Runtime
cd sdks/csharp
./tools~/write-nuget-config.sh ../..

# nodejs and pnpm are required for the typescript quickstart smoketest
- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -571,6 +579,10 @@ jobs:
cd sdks/csharp
./tools~/write-nuget-config.sh ../..

- name: Restore .NET solution
working-directory: sdks/csharp
run: dotnet restore --configfile NuGet.Config SpacetimeDB.ClientSDK.sln

# Now, setup the Unity tests.
- name: Patch spacetimedb dependency in Cargo.toml
working-directory: demo/Blackholio/server-rust
Expand Down Expand Up @@ -693,9 +705,13 @@ jobs:
cd sdks/csharp
./tools~/write-nuget-config.sh ../..

- name: Restore .NET solution
working-directory: sdks/csharp
run: dotnet restore --configfile NuGet.Config SpacetimeDB.ClientSDK.sln

- name: Run .NET tests
working-directory: sdks/csharp
run: dotnet test -warnaserror
run: dotnet test -warnaserror --no-restore

- name: Verify C# formatting
working-directory: sdks/csharp
Expand Down
36 changes: 33 additions & 3 deletions sdks/csharp/tools~/write-nuget-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ cd ..
# available.
# See https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file for more info on the config file,
# and https://tldp.org/LDP/abs/html/here-docs.html for more info on this bash feature.
cat >nuget.config <<EOF
cat >NuGet.Config <<EOF
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<!-- Local NuGet repositories -->
<add key="Local SpacetimeDB.BSATN.Runtime" value="${SPACETIMEDB_REPO_PATH}/crates/bindings-csharp/BSATN.Runtime/bin/Release" />
<!-- We need to override the module runtime as well because the examples use it -->
<add key="Local SpacetimeDB.Runtime" value="${SPACETIMEDB_REPO_PATH}/crates/bindings-csharp/Runtime/bin/Release" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSourceMapping>
<!-- Ensure that SpacetimeDB.BSATN.Runtime is used from the local folder. -->
Expand All @@ -36,5 +38,33 @@ cat >nuget.config <<EOF
</configuration>
EOF

echo "Wrote nuget.config contents:"
cat nuget.config
cat >"${SPACETIMEDB_REPO_PATH}/NuGet.Config" <<EOF
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<!-- Local NuGet repositories -->
<add key="Local SpacetimeDB.BSATN.Runtime" value="crates/bindings-csharp/BSATN.Runtime/bin/Release" />
<!-- We need to override the module runtime as well because the examples use it -->
<add key="Local SpacetimeDB.Runtime" value="crates/bindings-csharp/Runtime/bin/Release" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSourceMapping>
<!-- Ensure that SpacetimeDB.BSATN.Runtime is used from the local folder. -->
<!-- Otherwise we risk an outdated version being quietly pulled from NuGet for testing. -->
<packageSource key="Local SpacetimeDB.BSATN.Runtime">
<package pattern="SpacetimeDB.BSATN.Runtime" />
</packageSource>
<packageSource key="Local SpacetimeDB.Runtime">
<package pattern="SpacetimeDB.Runtime" />
</packageSource>
<!-- Fallback for other packages (e.g. test deps). -->
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
EOF

echo "Wrote sdks/csharp/NuGet.Config contents:"
cat NuGet.Config
33 changes: 29 additions & 4 deletions smoketests/tests/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ def load_nuget_config(p: Path):
return xmltodict.parse(f.read(), force_list=["add", "packageSource", "package"])
return {}


def _nuget_config_path(project_dir: Path) -> Path:
p_upper = project_dir / "NuGet.Config"
if p_upper.exists():
return p_upper

p_lower = project_dir / "nuget.config"
if p_lower.exists():
return p_lower

return p_upper

def save_nuget_config(p: Path, doc: dict):
# Write back (pretty, UTF-8, no BOM)
xml = xmltodict.unparse(doc, pretty=True)
Expand All @@ -66,8 +78,8 @@ def add_source(doc: dict, *, key: str, path: str) -> None:
cfg = doc.setdefault("configuration", {})
sources = cfg.setdefault("packageSources", {})
source_entries = sources.setdefault("add", [])
source = {"@key": key, "@value": path}
source_entries.append(source)

source_entries.append({"@key": key, "@value": str(path)})

def add_mapping(doc: dict, *, key: str, pattern: str) -> None:
cfg = doc.setdefault("configuration", {})
Expand All @@ -90,12 +102,25 @@ def add_mapping(doc: dict, *, key: str, pattern: str) -> None:
def override_nuget_package(*, project_dir: Path, package: str, source_dir: Path, build_subdir: str):
"""Override nuget config to use a local NuGet package on a .NET project"""
# Make sure the local package is built
run_cmd("dotnet", "pack", cwd=source_dir)
repo_nuget_config = STDB_DIR / "NuGet.Config"
if repo_nuget_config.exists():
run_cmd(
"dotnet",
"restore",
"--configfile",
str(repo_nuget_config),
cwd=source_dir,
capture_stderr=True,
)
run_cmd("dotnet", "pack", "-c", "Release", "--no-restore", cwd=source_dir)
else:
run_cmd("dotnet", "pack", "-c", "Release", cwd=source_dir)

p = Path(project_dir) / "nuget.config"
p = _nuget_config_path(Path(project_dir))
doc = load_nuget_config(p)
add_source(doc, key=package, path=source_dir/build_subdir)
add_mapping(doc, key=package, pattern=package)
add_source(doc, key="nuget.org", path="https://api.nuget.org/v3/index.json")
# Fallback for other packages
add_mapping(doc, key="nuget.org", pattern="*")
save_nuget_config(p, doc)
Expand Down
Loading