Skip to content

Commit 54f1afa

Browse files
committed
Kill stale travis config, add new GH actions config, add dev doc.
1 parent efda996 commit 54f1afa

19 files changed

Lines changed: 562 additions & 74 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, 2026netupgrade]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
name: build & test (${{ matrix.os }})
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, windows-latest]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup .NET 10
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: '10.0.x'
25+
26+
- name: Restore
27+
run: dotnet restore src/Rezoom.SQL.sln
28+
29+
- name: Build
30+
run: dotnet build src/Rezoom.SQL.sln -c Release --no-restore
31+
32+
- name: Unit tests
33+
run: dotnet test src/Rezoom.SQL.Test/Rezoom.SQL.Test.fsproj -c Release --no-build --nologo

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,6 @@ paket-files/
258258
*.pyc
259259
/src/Rezoom.SQL.Provider/Properties/launchSettings.json
260260

261+
262+
# Local dev prerelease suffix (set by build/pack-dev.ps1)
263+
version.local.props

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

DEVELOPER_README.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Rezoom.SQL developer notes
2+
3+
Notes for working on this repo.
4+
5+
## Repo layout assumption
6+
7+
The dev workflow assumes you have this repo cloned alongside its sibling
8+
repos (most importantly [Rezoom](https://github.com/rspeele/Rezoom)) under a
9+
common parent directory. The parent's name doesn't matter, but the
10+
siblings need to be together.
11+
12+
```
13+
my-rezoom-source-code/
14+
.localfeed/ (NuGet feed for in-progress dev packages)
15+
NuGet.config (configures .localfeed as a package source)
16+
Rezoom/
17+
Rezoom.SQL/ (this repo)
18+
FParsec-Pipes/
19+
LicenseToCIL/
20+
```
21+
22+
You need a `NuGet.config` at the parent level so package restore finds
23+
`.localfeed` ahead of nuget.org:
24+
25+
```xml
26+
<?xml version="1.0" encoding="utf-8"?>
27+
<configuration>
28+
<packageSources>
29+
<clear />
30+
<add key="local" value=".localfeed" />
31+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
32+
</packageSources>
33+
</configuration>
34+
```
35+
36+
If you're only working on Rezoom.SQL and don't need to iterate on Rezoom,
37+
you can use the latest published Rezoom from nuget.org. If you're changing
38+
both, pack Rezoom into the same `.localfeed` first using whatever script that
39+
repo provides.
40+
41+
## Why the unusual setup
42+
43+
Rezoom.SQL has two artifacts that interact awkwardly during dev:
44+
45+
- The **type provider** (`Rezoom.SQL.Provider`) is loaded by `fsc` at compile
46+
time, not at the consumer's runtime. To test a TP change, a project has to
47+
reference a NuGet-installed version of the provider, not a project-reference
48+
to its source. (Project references don't trigger the same TP loading path.)
49+
50+
- The **TP user smoke tests** (in `src/TypeProviderUsers/`) exercise the TP
51+
exactly the way a consumer would — they `PackageReference` the wrapper
52+
meta-packages (e.g. `Rezoom.SQL.Provider.SQLite`) which transitively bring
53+
in `Rezoom.SQL.Provider`. So testing a TP change means packing your changes,
54+
then letting the TPUs restore the new package and rebuild.
55+
56+
The local feed + version-bump dance encodes this. Run `build/pack-dev.ps1`
57+
after a Provider change; the TPUs (and any consumer in the repo) automatically
58+
restore the new version on their next build.
59+
60+
## Versioning during dev
61+
62+
All Rezoom.SQL packages share a single version. Two files compose it:
63+
64+
- `version.props` (committed): `RezoomSqlVersion = 0.13.0`, represents the upcoming or
65+
current release version. Bumped only at actual releases.
66+
- `version.local.props` (gitignored): written by `pack-dev.ps1`, contains
67+
`RezoomSqlVersionSuffix = dev.N`. The combined version becomes
68+
`0.13.0-dev.N`. Bumped extremely frequently during development, every time we have to smoke-test the TPUs.
69+
70+
Every package and consumer reads these via `Directory.Build.props`. Wrapper
71+
csprojs and TPU / demo fsprojs reference our packages as
72+
`Version="$(RezoomSqlPkgVersion)"`, which resolves to the current dev or
73+
release version automatically.
74+
75+
## Scripts
76+
77+
### `build/pack-dev.ps1`
78+
79+
Bumps the dev counter (one above the highest existing prerelease in the local
80+
feed), writes `version.local.props`, packs all six packages. Run after any
81+
change you want the TPUs or demos to see.
82+
83+
```powershell
84+
./build/pack-dev.ps1
85+
```
86+
87+
Add `-NoPack` to bump the counter and write the suffix file without actually
88+
packing. This could be useful if you want consumers pointed at a specific dev version
89+
without rebuilding producers.
90+
91+
### `build/pack-release.ps1`
92+
93+
Deletes `version.local.props` so the build has no prerelease suffix, then
94+
packs all six packages at the release version. Errors out if the working
95+
tree is dirty (override with `-Force`). After it succeeds, tag and push:
96+
97+
```powershell
98+
./build/pack-release.ps1
99+
git tag v0.13.0
100+
git push origin v0.13.0
101+
```
102+
103+
Drop the `.nupkg`s into wherever your nuget.org push lives.
104+
105+
### `src/TypeProviderUsers/test-tp-users.ps1`
106+
107+
Runs `dotnet test` on both TPU projects. SQLite can make its own DB file, but Postgres auto-
108+
skips when no server is reachable. Either set up your local Postgres like mine, with an
109+
`rz` user and password `testtest`, or use `REZOOM_TPU_POSTGRES` to override the
110+
connection string.
111+
112+
## Why the TPUs aren't in the main sln
113+
114+
The TPUs reference the wrapper packages via NuGet, not via project reference.
115+
Putting them in the same sln as `Rezoom.SQL.Provider` is confusing: opening
116+
the sln in VS suggests project-ref semantics, but the TPUs actually consume
117+
whatever's currently packed into `.localfeed`. Changing Provider source
118+
without running `pack-dev.ps1` would silently leave the TPUs on the old
119+
version.
120+
121+
They live as standalone fsprojs under `src/TypeProviderUsers/`. Open them
122+
individually (or via the test runner script) when you need to verify TP
123+
behavior end-to-end.
124+
125+
## Edit-rebuild loop for TP work
126+
127+
1. Edit something in `src/Rezoom.SQL.Provider/`, `Rezoom.SQL.Compiler/`, or
128+
`Rezoom.SQL.Mapping/`.
129+
2. Run `./build/pack-dev.ps1`. New version is `0.13.0-dev.<N+1>`.
130+
3. Run `./src/TypeProviderUsers/test-tp-users.ps1` (or `dotnet test` the specific one
131+
you care about). Restore picks up the new dev version automatically.
132+
4. Iterate.
133+
134+
If something doesn't update as expected, the usual suspect is a stale entry
135+
in `~/.nuget/packages/<pkg>/<version>/`. `pack-dev.ps1` clears those for the
136+
version it's about to publish, but if you manually pack something else into
137+
the feed, you may need to clear by hand.
138+
139+
## Release flow
140+
141+
1. Update `RezoomSqlVersion` in `version.props` for the new release.
142+
2. Update `<PackageReleaseNotes>` in the relevant csprojs/fsprojs.
143+
3. Update `CHANGELOG.md` (when one exists) and any docs that mention versions.
144+
4. Commit. Working tree should be clean.
145+
5. Run `./build/pack-release.ps1`. Verify the resulting `.nupkg`s in the feed.
146+
6. Push to nuget.org via your usual mechanism.
147+
7. Tag `v<version>` and push the tag.

Directory.Build.props

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project>
2+
<!--
3+
Centralized versioning for every Rezoom.SQL package and consumer.
4+
5+
Inputs:
6+
version.props committed; base release version (e.g. 0.13.0)
7+
version.local.props gitignored; dev prerelease suffix (e.g. dev.5)
8+
9+
Outputs (consumed by package projects and consumer PackageReferences):
10+
VersionPrefix feeds into NuGet pack
11+
VersionSuffix feeds into NuGet pack
12+
RezoomSqlPkgVersion used by every <PackageReference> referencing one
13+
of our packages, so wrappers / demos / TPUs pull
14+
whatever the current dev or release version is
15+
-->
16+
<Import Project="$(MSBuildThisFileDirectory)version.props" />
17+
<Import Project="$(MSBuildThisFileDirectory)version.local.props" Condition="Exists('$(MSBuildThisFileDirectory)version.local.props')" />
18+
19+
<PropertyGroup>
20+
<VersionPrefix>$(RezoomSqlVersion)</VersionPrefix>
21+
<VersionSuffix Condition="'$(RezoomSqlVersionSuffix)' != ''">$(RezoomSqlVersionSuffix)</VersionSuffix>
22+
23+
<RezoomSqlPkgVersion Condition="'$(RezoomSqlVersionSuffix)' == ''">$(RezoomSqlVersion)</RezoomSqlPkgVersion>
24+
<RezoomSqlPkgVersion Condition="'$(RezoomSqlVersionSuffix)' != ''">$(RezoomSqlVersion)-$(RezoomSqlVersionSuffix)</RezoomSqlPkgVersion>
25+
</PropertyGroup>
26+
</Project>

build/pack-dev.ps1

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
#requires -Version 5
2+
<#
3+
.SYNOPSIS
4+
Pack a dev prerelease of every Rezoom.SQL package into the local feed.
5+
6+
.DESCRIPTION
7+
Bumps the dev counter in version.local.props (one above the highest existing
8+
prerelease in the local feed) and runs `dotnet pack` for the three runtime
9+
packages plus the three wrapper meta-packages, in topological order.
10+
11+
After this script runs, every consumer (TPUs, demos, future projects in the
12+
same repo) automatically picks up the new prerelease on its next restore,
13+
because their <PackageReference> uses $(RezoomSqlPkgVersion) which is
14+
composed from version.props + version.local.props.
15+
16+
Assumes the umbrella checkout layout: a directory containing both this repo
17+
and a .localfeed/ sibling. The umbrella directory name doesn't matter.
18+
19+
.PARAMETER NoPack
20+
Bump the counter and write version.local.props, but skip the actual
21+
dotnet pack invocations. Useful when you just want consumers to point at a
22+
specific dev version without packing producers.
23+
#>
24+
[CmdletBinding()]
25+
param(
26+
[switch]$NoPack
27+
)
28+
29+
$ErrorActionPreference = 'Stop'
30+
$repoRoot = Resolve-Path (Join-Path $PSScriptRoot '..')
31+
32+
# .localfeed sits beside the repo in the umbrella directory. We don't care what
33+
# the umbrella is called — just that it's the parent.
34+
$umbrellaRoot = Split-Path -Parent $repoRoot
35+
$feed = Join-Path $umbrellaRoot '.localfeed'
36+
if (-not (Test-Path $feed)) {
37+
New-Item -ItemType Directory -Path $feed | Out-Null
38+
}
39+
40+
# Read the release version from the committed version.props.
41+
$versionPropsPath = Join-Path $repoRoot 'version.props'
42+
[xml]$versionProps = Get-Content $versionPropsPath
43+
$baseVersion = $versionProps.Project.PropertyGroup.RezoomSqlVersion.Trim()
44+
45+
# Find the highest existing dev counter for this base version in the feed.
46+
$pattern = "Rezoom.SQL.Provider.$baseVersion-dev.*.nupkg"
47+
$existing = Get-ChildItem $feed -Filter $pattern -ErrorAction SilentlyContinue
48+
$highest = 0
49+
foreach ($f in $existing) {
50+
if ($f.BaseName -match "\.dev\.(\d+)$") {
51+
$n = [int]$Matches[1]
52+
if ($n -gt $highest) { $highest = $n }
53+
}
54+
}
55+
$next = $highest + 1
56+
$suffix = "dev.$next"
57+
$fullVersion = "$baseVersion-$suffix"
58+
59+
# Persist the suffix so consumers pick it up on their next restore.
60+
$localPropsPath = Join-Path $repoRoot 'version.local.props'
61+
$localPropsBody = @"
62+
<Project>
63+
<PropertyGroup>
64+
<!-- Written by build/pack-dev.ps1. Gitignored. Delete (or run pack-release.ps1)
65+
to return to release-version builds. -->
66+
<RezoomSqlVersionSuffix>$suffix</RezoomSqlVersionSuffix>
67+
</PropertyGroup>
68+
</Project>
69+
"@
70+
Set-Content -Path $localPropsPath -Value $localPropsBody -NoNewline -Encoding utf8
71+
72+
Write-Host "Set version to $fullVersion in version.local.props" -ForegroundColor Cyan
73+
74+
if ($NoPack) {
75+
Write-Host "-NoPack specified; skipping dotnet pack." -ForegroundColor Yellow
76+
return
77+
}
78+
79+
# Clear any stale entries in the global packages cache for this version.
80+
$pkgs = @(
81+
'rezoom.sql.mapping','rezoom.sql.compiler','rezoom.sql.provider',
82+
'rezoom.sql.provider.sqlite','rezoom.sql.provider.tsql','rezoom.sql.provider.postgres'
83+
)
84+
foreach ($p in $pkgs) {
85+
$cacheDir = Join-Path "$env:USERPROFILE\.nuget\packages" "$p\$fullVersion"
86+
if (Test-Path $cacheDir) { Remove-Item -Recurse -Force $cacheDir }
87+
}
88+
89+
# Pack in topological order: runtime libs first, then wrappers that reference them.
90+
$projects = @(
91+
'src/Rezoom.SQL.Mapping/Rezoom.SQL.Mapping.fsproj',
92+
'src/Rezoom.SQL.Compiler/Rezoom.SQL.Compiler.fsproj',
93+
'src/Rezoom.SQL.Provider/Rezoom.SQL.Provider.fsproj',
94+
'src/Rezoom.SQL.Provider.TSQL/Rezoom.SQL.Provider.TSQL.csproj',
95+
'src/Rezoom.SQL.Provider.SQLite/Rezoom.SQL.Provider.SQLite.csproj',
96+
'src/Rezoom.SQL.Provider.Postgres/Rezoom.SQL.Provider.Postgres.csproj'
97+
)
98+
foreach ($p in $projects) {
99+
$path = Join-Path $repoRoot $p
100+
Write-Host ""
101+
Write-Host "==> pack $p" -ForegroundColor Cyan
102+
& dotnet pack $path -c Release -o $feed --nologo 2>&1 | Select-Object -Last 2
103+
if ($LASTEXITCODE -ne 0) { throw "pack failed for $p" }
104+
}
105+
106+
Write-Host ""
107+
Write-Host "Packed $fullVersion to $feed" -ForegroundColor Green
108+
Write-Host "Consumers will restore this version automatically on next build."

0 commit comments

Comments
 (0)