Skip to content

Commit 163833a

Browse files
committed
Merged rock-loader: the loader library builds for both net10.0 and net472 so Rock can use it, loads can choose their parts, a fresh-database guard refuses a non-new install, the hosted package index and dataset catalog are readable, and the NuGet package is SparkDevNetwork.Rock.SampleData.Loader 0.1.0-alpha.9 (decisions 120 to 126). All three packages pass verify on Rock 21.0.2
2 parents dd0d558 + 4a5411b commit 163833a

74 files changed

Lines changed: 2280 additions & 365 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ node_modules/
1515

1616
# The public site build (site/build.js writes it)
1717
/site/dist/
18+
19+
# The loader NuGet package dotnet pack writes
20+
/artifacts/

‎Directory.Build.props‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22

3-
<!-- Settings shared by the builder, the loader library, and the loader CLI. -->
3+
<!-- Settings shared by every project. The loader library and its compatibility check also build for net472. -->
44
<PropertyGroup>
55
<TargetFramework>net10.0</TargetFramework>
66
<Nullable>disable</Nullable>
@@ -19,6 +19,15 @@
1919
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-j9gm-c75j-xc9q" />
2020
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-jjfr-hcj7-qf5w" />
2121
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-wmxv-xphr-5c9g" />
22+
23+
<!--
24+
On .NET Framework, the loader uses Rock's Microsoft.Data.SqlClient 6.1.4, which brings
25+
System.Security.Cryptography.Pkcs 8.0.1, the version Rock ships. A newer one would put a
26+
second version into RockWeb/bin. The loader never reads certificates or signed data itself.
27+
The .NET 10 build pins a fixed version. Remove these once Rock moves to a fixed version.
28+
-->
29+
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-2fmv-rv2c-59x7" />
30+
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-846f-f764-76mx" />
2231
</ItemGroup>
2332

2433
</Project>

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ and push. Ask me before anything that removes or rewrites history.
139139
| [photos/](photos/README.md) | The photo rules, the manifest, and the delivered Cast and pool photos. |
140140
| [graphics/](graphics/README.md) | Reusable church initiative and campaign artwork, beginning with Starting Point. |
141141
| [builder/](builder/README.md) | The .NET tool that turns this repository into one dataset package per dataset. |
142-
| [loader/](loader/README.md), `loader-cli/` | The loader library that installs a package into a Rock database, and its command line for developers and test harnesses. |
142+
| [loader/](loader/README.md), `loader-cli/`, `loader-compat-check/` | The loader library that installs a package into a Rock database (for .NET 10 and for Rock's .NET Framework, as the `SparkDevNetwork.Rock.SampleData.Loader` NuGet package), its command line for developers and test harnesses, and the check that both builds compute the same keys. |
143143
| [validation/](validation/README.md) | Tolerances and the script that grades generated data, plus the invariants, contract, and standards check the verify tool uses. |
144144
| [verify/](verify/README.md) | The tool that proves each package works on one exact Rock and writes its receipt. Publishing needs a passing receipt. |
145145
| [datasets/](datasets/README.md) | One manifest per dataset, with its settings. |

‎builder/PackageWriter.cs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ public static (string Path, PackageManifest Manifest) Write( string root, string
5252
var source = new SampleDataSource( repository );
5353
var datasetManifest = source.ReadDataset( dataset )
5454
?? throw new InvalidOperationException( $"There is no datasets/{dataset}.json." );
55+
56+
// Rock's installer shows this card, so a package is never built from a manifest without one.
57+
var card = SampleDataDatasets.FromManifest( datasetManifest, $"datasets/{dataset}.json" );
58+
var campusCount = source.Campuses.Campuses.Count( c => c.Datasets.Contains( dataset ) );
59+
if ( card.Key != dataset || card.Campuses != campusCount )
60+
{
61+
throw new InvalidDataException( $"datasets/{dataset}.json says key {card.Key} and {card.Campuses} campuses, but it is {dataset}, which configuration/campuses.json gives {campusCount} campuses." );
62+
}
63+
5564
var files = new SortedDictionary<string, byte[]>( StringComparer.Ordinal );
5665

5766
void AddFile( string path ) => files[path] = Normalize( path, repository.ReadBytes( path ) );

‎builder/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A package is a zip of data, never SQL (decision 41). Files keep their paths from
3131
| `package.json` | The format version, the dataset, the source commit, the one Rock it is for (decision 52), and the SHA-256 of every other file. |
3232
| `configuration/*.json` | The church setup, unchanged. |
3333
| `cast/households/*.json`, `cast/groups/*.json` | The Cast and its small group plans, unchanged. |
34-
| `datasets/{key}.json` | The dataset's settings. |
34+
| `datasets/{key}.json` | The dataset's settings and its [card](../datasets/README.md#the-dataset-card). |
3535
| `profile.json` | The calibration profile, already resolved from its sources, so a load never blends sources itself. |
3636
| `addresses/pool.json` | The address pool for the dataset's campuses only. Each campus's list is unchanged, so generated households get the same addresses. |
3737
| `photos/manifest.json`, `photos/cast/`, `photos/pool/` | The Cast photos, plus the pool when the dataset gives generated households faces (Core 3). |
@@ -40,7 +40,7 @@ A package is a zip of data, never SQL (decision 41). Files keep their paths from
4040

4141
No timeline is stored: the loader generates every gift, attendance, and alert for the install day. Text files use LF line endings, and every zip entry has the same fixed time, so packing the same commit twice gives byte-identical packages.
4242

43-
Before writing a package, the builder opens it the way the loader does and reads every file a load reads, so a package that would fail to load is never written.
43+
Before writing a package, the builder opens it the way the loader does and reads every file a load reads, so a package that would fail to load is never written. It also refuses a manifest without its full dataset card.
4444

4545
## Other commands
4646

‎builder/package-readme.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The loader library (`RockSampleData.Loader`) and its command line both install p
5252
rock-sample-data-load --package {{dataset}}.zip --connection "<connection string>" [--anchor yyyy-MM-dd] [--seed text]
5353
```
5454

55-
Before it writes anything, the loader checks the format version, every file's SHA-256, and that the database is Rock {{rockVersion}}. The load runs in one transaction, so a failure leaves nothing behind. Every row it writes carries `ForeignKey = SampleData:{{dataset}}`.
55+
Before it writes anything, the loader checks the format version, every file's SHA-256, that the database has no people beyond a new Rock install, and that it is Rock {{rockVersion}}. The load runs in one transaction, so a failure leaves nothing behind. Every row it writes carries `ForeignKey = SampleData:{{dataset}}`.
5656

5757
## More
5858

‎datasets/README.md‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ One manifest per dataset: [core-1.json](core-1.json), [core-3.json](core-3.json)
66
|---|---|---|---|---|
77
| Core 1 | Cast | 1 | Every Cast person | Every check |
88
| Core 3 | Cast plus 75 companion households each at Peoria and Gilbert | 3 | Cast, plus about half of companions | Every check |
9-
| Full 7 | Cast plus Crowd (about 25,000) | 7 | Cast only | Last 12 months |
9+
| Full 7 | Cast. The manifest lists no generated households yet, so the Crowd loads only with the CLI's `--crowd` | 7 | Cast only | Last 12 months |
1010

1111
## Manifest settings
1212

@@ -19,3 +19,18 @@ One manifest per dataset: [core-1.json](core-1.json), [core-3.json](core-3.json)
1919
| `checkImages.months` | Months of check gifts, counting back from the anchor date, that get scanned check images. 0 means every check. Used only when the builder runs with `--check-images`; `--check-image-months` overrides it. |
2020

2121
The manifest grows as the builder reads more settings from it. Campuses are listed per dataset in `../configuration/campuses.json`.
22+
23+
## The dataset card
24+
25+
Rock's installer shows a card for each dataset, so a church admin can choose one (decision 124). The loader embeds these fields and serves them as `SampleDataDatasets` (see the [loader README](../loader/README.md#the-dataset-catalog)). Every field is required, and the builder refuses a manifest that is missing one.
26+
27+
| Field | Meaning |
28+
|---|---|
29+
| `summary` | One or two plain sentences: who is in the dataset. |
30+
| `bestFor` | One plain sentence: what the dataset is best for. |
31+
| `highlights` | Two to four short phrases. |
32+
| `people`, `households` | People and family households (businesses included) a load adds, measured from a real load at the default seed and 3 years of history. Verify fails a load more than 2% away from either. |
33+
| `campuses` | The dataset's campuses. Must match `../configuration/campuses.json`. |
34+
| `typicalInstallSeconds` | The median of three measured loads of every part, check images included, in whole seconds. |
35+
36+
Write the text for a church admin choosing what to install. Follow the [content standards](../docs/content-standards.md) and the writing rules in [AGENTS.md](../AGENTS.md): plain, short sentences and no em dashes. Leave out numbers the number fields already give, so the text never goes stale.

‎datasets/core-1.json‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
"$comment": "Dataset manifest. Grows as the builder reads more settings from it. Command-line options override these values.",
33
"key": "core-1",
44
"name": "Core 1",
5+
"summary": "The Cast: hand-designed households at one campus, each with its own story. The same families are in every dataset.",
6+
"bestFor": "Automated tests, training, and everyday development.",
7+
"highlights": [
8+
"Families you can name in tests and help articles",
9+
"Profile photos for nearly everyone",
10+
"Three years of attendance, giving, groups, and serving",
11+
"Scanned images of every check gift"
12+
],
13+
"people": 185,
14+
"households": 87,
15+
"campuses": 1,
16+
"typicalInstallSeconds": 10,
517
"checkImages": {
618
"$comment": "Every check in the Cast gets images.",
719
"months": 0

‎datasets/core-3.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
"$comment": "Dataset manifest. Grows as the builder reads more settings from it. Command-line options override these values.",
33
"key": "core-3",
44
"name": "Core 3",
5+
"summary": "The Cast at the main campus, plus generated households at two more campuses. About half of the new households have photos.",
6+
"bestFor": "Building and trying campus features, such as campus filters, reports, and check-in.",
7+
"highlights": [
8+
"Three campuses, each with its own people",
9+
"The full Cast at the main campus",
10+
"Scanned images of every check gift"
11+
],
12+
"people": 405,
13+
"households": 241,
14+
"campuses": 3,
15+
"typicalInstallSeconds": 12,
516
"checkImages": {
617
"$comment": "Every check gets images; Core 3 is still small.",
718
"months": 0

‎datasets/full-7.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
"$comment": "Dataset manifest. Grows as the builder reads more settings from it. Command-line options override these values.",
33
"key": "full-7",
44
"name": "Full 7",
5+
"summary": "The Cast at the main campus, with all seven campuses set up. For now, the other six campuses have no people.",
6+
"bestFor": "Exploring a seven-campus setup, such as campus pickers and service times.",
7+
"highlights": [
8+
"Seven campuses with their own service times",
9+
"The same Cast as Core 1",
10+
"Scanned images of the last 12 months of check gifts"
11+
],
12+
"people": 185,
13+
"households": 87,
14+
"campuses": 7,
15+
"typicalInstallSeconds": 9,
516
"checkImages": {
617
"$comment": "Only the last 12 months of checks get images, to keep the database a reasonable size.",
718
"months": 12

0 commit comments

Comments
 (0)