The verify tool proves that each dataset package works on the Rock release it was built on, and writes a receipt that says so. A package serves every dot release of that Rock's major release (decision 52), so each new dot release gets a verify run before a church uses it. It runs when packages are made, never when a church installs one (decision 66).
The loader bulk-copies around Rock's business logic. That is what makes it fast, but it also means Rock never gets a chance to say "this is wrong." So the proof has to come from somewhere else. The verify tool gets it from Rock itself: a database made only by Rock's own migrations and start-up steps, Rock's own column list, and Rock's own Rock Cleanup job.
This page is about running the tool. For every check in the repository, what it does, and why it is there, see Verification.
Build the packages first (see the builder), from the same built Rock checkout. Then, from this folder:
dotnet run -- --rock C:\Development\Rock-21
Use a Rock checkout kept only for this, at the ref in release/rock-releases.json for its major release, such as C:\Development\Rock-21 and C:\Development\Rock-20, built with Visual Studio's MSBuild. Do not use the checkout you develop Rock in. Pulling develop there changes its migrations while RockWeb\bin still holds the old build, so the trusted base fails until you rebuild, and a run already going reads a mix of both.
It needs SQL Server on localhost with Windows sign-in, Node.js, and a built Rock checkout (RockWeb\bin must hold Rock.dll). It makes and drops its own databases, all named RockSampleVerify-<run tag>-..., and never touches any other database. The run tag is the worktree's folder name without "rock-sample-data-" (the main checkout is main), so runs from different worktrees can share a server. They share the trusted base, which a run locks while it uses it (see Working in parallel).
| Option | Meaning |
|---|---|
--rock <folder> |
A built Rock checkout: a release tag, or develop. The ROCK_PATH environment variable does the same. Required. |
--dataset |
One dataset (core-1, core-3, or full-7), or all (the default). |
--packages <folder> |
Where the packages are. Defaults to ../packages. Receipts are written next to them. |
--server |
The SQL Server. Defaults to localhost. |
--base |
The trusted base's name. Defaults to RockSampleVerify-base. |
--run <tag> |
The run tag in this run's database names. Defaults to the worktree's name. |
--anchor, --seed |
The install day and seed for the verification loads. Default to today on the database server and rock-sample-data. Rock Cleanup is judged only when the anchor is today (see rock-cleanup below), and so are the other checks below that say so, such as process-reminders. |
--record-contract |
Records validation/rock-contract.json from these loads, instead of only checking it. Needs every dataset. |
--keep |
Keeps each loaded database (RockSampleVerify-<run tag>-core-1 and so on) for a look afterward. |
--anchor-sweep [days] |
Runs only the anchor sweep (see below), for 60 install days or as many as you give, from --anchor or today, on --dataset (Core 1 by default). Writes no receipt. |
--check-receipts [folder] |
Runs nothing else. The publishing gate: exits with 1 unless every package has a passing receipt. |
A full run takes about 8 minutes, about 3 of them for Full 7. Making a new trusted base adds about 9 minutes, once for each Rock release.
| Check | What it proves |
|---|---|
trusted-base |
The database every load starts from was made only by this Rock's migrations. |
content-standards |
The content standards a script can check all hold. |
contract-schema |
Every column, Guid, and procedure the loader depends on exists in this Rock, and Rock added no column the loader has not reviewed. |
contract-current |
validation/rock-contract.json still describes what the loader writes. |
load |
The package loads into a copy of the trusted base. |
cast-expectations |
Every Cast giver whose story says what Rock should show still shows it, and so do the Cast's tags and mentions (validation). |
invariants |
Every rule in validation/invariants.sql holds in the loaded data. |
rock-metrics |
For each of Rock's shipped metrics with history, and each Ministry by Design metric with its own SQL, at its newest run and its newest run at least 90 days before that, Rock's own metric SQL gives every value the load wrote. The check sets the database back to that run inside a transaction it rolls back: later check-ins, prayer requests, prayers, and gifts are hidden, and the people and their eRA values are as they were then, read back from the eRA job's history lines. Today's eRA values must be the ones those lines give. Every typed adult count is the people in its service, and each service with one has a Salvations value. It runs before rock-cleanup, so it judges the database as loaded. |
rock-cleanup |
Rock's own Rock Cleanup job finds nothing to fix in the sample data. |
address-services |
The selection of Rock's Location Services Verify job, judged for every later night, picks no Location the load wrote, so no sample address goes to an address service. It never runs the job. |
person-duplicates |
Rock's own Calculate Person Duplicates job, run as Rock's scheduler runs it, adds, removes, and rescores no duplicate pair, and keeps every Not Duplicate and Ignore decision (Duplicates). |
sign-in |
Rock's own Database login signs in as tdecker and the load's newest confirmed login, and refuses a wrong password. |
data-views |
Rock's own engine runs every data view in the load, the church's and Rock's, without an error. It prints each church view's count and time. |
flow-audiences |
Each recurring or One-Time Communication Flow's audience rule, as the loader runs it for past runs, finds on install day exactly the people Rock's own engine finds in the flow's data view. Judged only when today is the anchor. |
metrics |
Each path metric's newest values, one for each campus, add up to Rock's count of its stage view, less the people who first reached the stage after that value, and each campus's is its own people less its own later ones. A SQL count of the stage rule must also equal Rock's count. A Ministry by Design metric on another view is replayed: at its last run it gives each campus's newest value, and today it holds Rock's count of the view. |
access |
Rock's own security check gives every answer in the security walkthroughs (access in configuration/reporting.json, configuration/adaptive-messages.json, configuration/signals.json, configuration/tags.json, configuration/benevolence.json, and content/communications/snippets.json): which Cast person may view or edit which category, data view, report, personalization segment, page, signal type, SMS snippet, or benevolence type, and who may view or use which tag. |
reports |
Every report column is one Rock reads: a property is one of Rock's reportable fields, an attribute exists, a data select component builds its expression from the stored selection, and a Lava column renders through Rock's Lava engine. |
assessment-scores |
Rock's own five assessment scoring services score every saved answer set, and give each person's latest results exactly the person attribute values the load wrote. Rock's own serializer writes the same answer data (Assessments). |
adaptive-messages |
Rock's own {% adaptivemessage %} Lava command shows each Cast person in configuration/adaptive-messages.json their adaptation, with its call to action. |
calculate-metrics |
Rock's own Calculate Metrics job (rock-runner --task calculate-metrics), run once after the load, changes and removes no loaded value, and adds a value only for a run after its metric's last run. |
staff-homepage |
Rock's staff homepage block picks this week's update from 52 weekly ones, and Rock's own Lava engine renders it with its feature and articles. Each homepage metric's newest value is its last run and agrees with Rock's own SQL, the block lists the path metrics and no other church metric, and the Quick Links hold the church's links. |
email-sections |
Rock's own save rules accept every email section the load wrote: the model's validation, and the check Rock's email editor runs on a section's markup when staff save it. |
segments |
Rock's own segment update, run on every personalization segment the load wrote, adds and removes nobody. Judged only when today is the anchor. |
signals |
Rock's own top signal rule, run for everyone with a signal, changes no one's top signal, so the Top Person Signal badge shows the flag Rock would. Judged only when today is the anchor. |
personal-links |
Rock's own bookmark menu data shows each person in configuration/personal-links.json their sections and links in order, finds no section order missing for a section's owner, and keeps a version the browser's cached empty menu does not match. |
notifications |
Rock's own unread count, which the top-bar bell reads, equals each note author's mentions in the last three days' notes, and Rock's link for their newest mention opens the note. Judged only when today is the anchor. |
process-reminders |
Rock's own Process Reminders job (rock-runner --task process-reminders) changes no reminder and nobody's reminder count, and reports no error but a failed email. The trusted base has no mail server, so failed sends are noted. Judged only when today is the anchor. |
step-workflow-launch |
Rock's own code (rock-runner --task launch-step-workflows) launches each open step workflow's step, and up to ten steps with completed ones for each trigger, as Rock does when a step becomes complete, without saving it. Each gives the name, assignee, and person the load wrote, and waits at its form (Step workflow launch). |
process-workflows |
Rock's own Process Workflows job (rock-runner --task process-workflows), run as Rock's scheduler runs it, leaves every workflow the load wrote as it was, apart from an open workflow's processed times, and reports no error (Process Workflows). |
family-analytics |
Rock's own Family Analytics procedures, run as installed inside a rolled-back transaction, move no family in or out of eRA and change no eRA value, count, gift date, or visit date, and the job is on with Set Visit Dates on (Family Analytics). Judged only when today is the anchor. |
peer-network |
Rock's own Calculate Peer Network procedures, run as installed inside a rolled-back transaction, add, remove, and rescore no peer network row, and the job stays on (Peer network). Judged only when today is the anchor. |
group-sync |
Rock's own group sync, run on every sync the load wrote, adds, removes, and refuses nobody. Judged only when today is the anchor. |
data-automation |
Rock reads each Data Automation rule with its own settings class exactly as the load saved it, all off, and Rock's own Data Automation job, run as Rock's scheduler runs it, changes no person and no family (Data automation). |
group-requirements |
Rock's own Calculate Group Requirements job inserts, deletes, and changes no requirement result, apart from its last-checked time. Judged only when today is the anchor. |
benevolence-workflow-launch |
Rock's own launch of the benevolence Request Started workflow, on up to 25 requests whose case worker the check cleared first, gives each back to the configured case worker with no error. It runs last, because it changes those rows. |
anchor-sweep |
Core 1 only. Every Cast giving and reminder expectation holds on each of the 60 install days from the anchor, in dry-run loads of the giving and reminders parts. |
The base is an empty database made from nothing in four steps:
- EF's own migration tool (
ef6.exe, from the Rock checkout's packages) applies every Rock migration, the same way a Rock developer runs Update-Database. rock-runnerruns Rock's own start-up steps that write to the database: theRockGetDatefunction, the plugin and hotfix migrations, and the attribute value views. Then it starts Rock's message bus, as Rock's startup does next. EF alone skips these. On Rock 21.0.1 that is 189 hotfix migrations, so a base made only by EF is not what a church has after Rock starts.rock-runnerstarts Rock's Lava engine, then runs Rock's one-time update jobs (the "Rock Update Helper" jobs,Rock.Jobs.Post...), which a new install runs at 9pm on its first evening (decision 170). Each runs as its own stored job, so it reads its settings and deletes itself, oldest first. Among them are the jobs that swap WebForms blocks for Obsidian ones, such as Pledge Entry, so the base has the blocks a Rock that has run a night has. The swap jobs first register their new block types' settings; Rock's web start-up has already done that for WebForms (.ascx) block types, which only compile inside IIS, so the runner marks those verified first. On Rock 21.0.2 that is 87 jobs.rock-runnerruns Rock's one-time post-install job (PostInstallDataMigrations), which a new install runs at 2am on its first night. It fillsAnalyticsSourceDate, the identity verification codes, andAnalyticsSourcePostalCode(fromRockWebApp_DataFormatted_Census_Data.xlsx, so Rock's AppDomain uses the RockWeb folder as its base, as under IIS). Rock Cleanup reads every person's age fromAnalyticsSourceDate, so without this step Rock Cleanup sets every age to null, which no church that has run one night sees.
Nothing else ever touches the base; every load runs on a copy.
Before each run, the tool checks the base: its __MigrationHistory must hold exactly the Rock checkout's migrations (read from each migration's designer file, since a file name is not always its Id), Rock's start-up steps, every one-time update job, and the post-install job must have run (with the postal codes filled), and it must have no sample data and an empty Exception Log. A plugin migration that fails logs an exception, so the empty log also proves every hotfix applied. If the base is missing or does not match the checkout, the tool makes a new one. The receipt records the base's schema hash, so two receipts with the same hash were checked against the same schema.
The tool writes its own config file for EF and for Rock, pointed at its own database. The checkout's web.ConnectionStrings.config is never read.
validation/rock-contract.json lists every Rock table and column the loader writes, the full column list of those tables when it was recorded, the tables it deletes rows from, the Rock-provided Guids it looks up, and the Rock procedures it runs.
Nobody writes it by hand. During each verification load, the loader's database class records every bulk copy and every SQL statement it runs (loader/database/WriteRecorder.cs). --record-contract saves that recording. A write the recorder cannot read fails the check, so nothing slips past it.
Two kinds of drift fail the check:
- Rock changed. A column the loader writes is gone or has a new type, a Guid or procedure is gone, or Rock added a column to a table the loader writes. A new column needs a decision: should the loader fill it the way Rock's save hook would?
- The loader changed. It writes, deletes, or depends on something the contract does not list.
Either way, review the change, run with --record-contract, and commit the new contract. Its diff shows exactly what changed. The check also refuses Person.RaceValueId and Person.EthnicityValueId (content standard 8).
validation/invariants.sql holds rules that must hold in every dataset on every Rock: every person has one primary alias, the primary family is a family the person is in, giving Ids match giving groups, phones and emails use reserved values, home addresses are mapped, nothing is dated in the future, every gift sits inside its batch, member roles belong to the group's type, and more. Each rule says why it matters. Rules a foreign key already enforces are left out, because the bulk copy checks those.
To add a rule, add a -- check: block that returns how many rows break it.
Rock's nightly Rock Cleanup job repairs what Rock's save hooks would have set: missing aliases, ages, salutations, and more. After a load, the tool runs that job and compares the database before and after, column by column, using a SQL Server snapshot. Whatever Rock fixes in the sample data, the loader missed.
The job runs outside IIS through rock-runner/, a small .NET Framework program that loads Rock.dll from the checkout's RockWeb\bin in its own AppDomain and starts Rock the way EF's design-time tools do. It also starts Rock's in-memory message bus before the job, as Rock's own startup does. Without it, each cache message the job publishes could log a bus error to the Exception Log, depending on timing, which made this check fail now and then for no data reason. It has no compile-time reference to Rock, so one build works with any Rock version. Two of the job's tasks need a web server (orphaned entity metadata and the connected services manifest). They fail the same way on the plain base, so they are noted, not failed. The campus tithe metric task runs for real once the base has its postal codes, so the loader sets that metric too.
Rock's job also tidies things in any fresh database. So it runs once on a plain copy of the base too. A change Rock also makes there, to rows that are not sample data, is background and is reported but does not fail. A change we accept on purpose goes in validation/cleanup-accepted.json with a reason.
Rock Cleanup rebuilds ScheduleDate for a window of now plus or minus two years, to the minute, and the plain copy and each loaded copy are cleaned minutes apart. So the comparison leaves out the ScheduleDate rows within a day of either edge of that window, in both runs, and compares the rest exactly. Before, an occurrence at an edge now and then fell inside one run and outside the other, and the check failed on base rows the load never touched.
An event occurrence's next start can pass between the load and Rock Cleanup, and Rock then moves it to the following start. So a change to EventItemOccurrence.NextStartDateTime is left out when the old value had already passed when Rock Cleanup started and Rock only moved it later or cleared it. Those rows show as "Not judged". Any other change to the column still fails.
Every load makes its logins with the test password sample-data-verify, hashed by Rock's own Database login through rock-runner --task hash-password, the way Rock's installer block hashes the one a person types (decision 180). It is not a secret: it signs in only to the run's throwaway databases. After the referee, rock-runner --task sign-in signs in through Rock's Database login, the check Rock's login block makes, and the sign-in check fails unless Rock accepts the sample logins and refuses a wrong password. It runs after the referee because a sign-in can rewrite a hash at the site's cost setting.
The verify tool runs cast/validate-cast.js and validation/check-standards.js. Both need only Node, so contributors run them too. The content standards say which rule each script checks, and which rules still need a person.
Each run writes {dataset}.verify.json next to each package. A receipt records the package's SHA-256, its source commit, its minimum loader version (decision 158), the Rock major release and the exact Rock version and migration, the trusted base's certificate (including its schema hash), the anchor and seed, this repository's commit, and every check with its details. A package passes only when every check passes. Its load section records how long the load took, step by step (every timing the loader reports), and the space it used: the peak used data and log space, sampled once a second, the file sizes, the file growths the default trace saw, the recovery model, and whether instant file initialization is on. No check reads it; it is there so every run leaves a timing record (see Performance).
Publishing runs the gate first:
dotnet run -- --check-receipts ../packages
It refuses to publish when a package has no receipt, its receipt is for different bytes, any check failed, the receipt is for a different Rock than the package, or either the package or the checks came from uncommitted changes.
| Check | What to do |
|---|---|
trusted-base |
The tool rebuilds the base on its own. If it still fails, the checkout's RockWeb\bin was built from different code than its migrations folder. Rebuild Rock. |
contract-schema |
Rock changed under the loader. Read each line, update the loader if needed, then re-record. |
contract-current |
The loader changed. Review the change, then re-record. |
invariants |
The loader wrote data that breaks a rule. Fix the loader, or fix the rule if the rule is wrong. |
rock-cleanup, "Rock Cleanup was not judged" |
Today's date is not the loads' anchor: the run crossed midnight, --anchor is not today, or the database server and this machine keep different time zones. Run it again, without --anchor. |
rock-cleanup |
The loader skipped something Rock's save hooks set. Fill it in the loader, or accept it in validation/cleanup-accepted.json with a reason. |
address-services |
A loaded Location lacks the marks of a checked address. Write it with the marks in loader/loading/CheckedAddress.cs. If Rock changed the job's selection, the Rock lock check says so too. |
person-duplicates |
Something changed a person, phone, or address after the load ran Rock's duplicate finder, or a Cast decision did not stick. Each line names the pair and its values before and after. Move the change before the Duplicates step, or fix how loader/loading/DuplicatesLoader.cs writes the decision. |
group-sync |
A synced group does not hold exactly what its data view finds in Rock. Fix the view's filters in configuration/group-syncs.json or how loader/loading/DataViewEvaluator.cs reads them. |
benevolence-workflow-launch |
Rock's workflow left a request without its case worker or reported an error. Fix the actions or Lava in WriteWorkflow in loader/loading/BenevolenceLoader.cs. |
data-automation |
Rock read a rule differently than the load saved it, read one as on, or its job changed a person or family. Fix the rule in settings in configuration/data-integrity.json or the Guid swaps in loader/loading/DataIntegrityLoader.Settings.cs. A changed gender means a person Rock can fill: give them one. |
group-requirements |
Each line names a member whose result Rock's job would insert, delete, or change. Fix loader/generation/BackgroundCheckPlanner.cs, or rules in configuration/background-checks.json if Rock's data views changed. |
process-reminders, "Process Reminders was not judged" |
Today's date is not the loads' anchor. Run it again, without --anchor, as for rock-cleanup. |
process-reminders |
Rock's job changed a reminder or a reminder count, or reported an error. Fix how loader/loading/RemindersLoader.cs dates each reminder or counts each owner's reminders due. |
step-workflow-launch |
Rock's launch gives a different name, assignee, or person than the load wrote, does not wait at the form, or reports an error. Fix the type's actions and Lava in loader/loading/StepWorkflowsLoader.cs, or the field in configuration/step-workflows.json. A wrong Baptism Follow-Up assignee can mean a campus leader is not its campus pastor (loader/loading/CampusPastors.cs). |
process-workflows |
Rock's job changed a workflow, or reported an error. Fix how loader/loading/StepWorkflowsLoader.cs, or DataIntegrityLoader.Workflows.cs for a Person Data Error or Photo Request, writes the workflow's activities and actions, so an open one waits at its form as Rock leaves it. |
anchor-sweep |
A Cast giving or reminder story holds on some install days and not others. Each line names the expectation and the days. Keep that giver's gifts from landing close together on any day, for example with isOnTime for a monthly giver. For a reminder, fix its date rule in configuration/reminders.json. Then sweep a year with --anchor-sweep 365. |
content-standards |
The data breaks a content standard. Each line names the rule. |
data-views |
Rock could not read a data view's filter. Fix its selection in the configuration file that holds it, or how loader/loading/ReportingLoader.cs builds it. |
metrics |
The loader's weekly values in loader/loading/MetricsWriter.cs no longer follow the stage view's rule or Rock's campus split, or the view changed shape. A metric can count only a view of active people with any of some steps. |
rock-metrics |
Each line names the metric, the run, the partition entities, Rock's value, and the load's. A wrong value means the rule in loader/loading/RockMetricsLoader.*.cs no longer follows the metric's SQL in Rock, often because a Rock release changed it. A missing or extra campus usually means Rock's SQL groups differently. A line about a person's eRA values means the eRA job's history lines and today's values disagree: fix the loader's eRA history in loader/loading/FamilyAnalyticsLoader.cs. |
calculate-metrics |
Rock's job changed a value, or filled in a past run. Check the metric's last run, which loader/loading/RockMetricsLoader.cs sets to its newest run, and the schedule rule MetricSchedule read from Rock. |
reports |
Fix the column in configuration/reporting.json: the property name, attribute key, or the component's selection. |
adaptive-messages |
A Cast person sees another adaptation. Check their segments' data views and the adaptation order in configuration/adaptive-messages.json, and their story. |
staff-homepage |
Each line names what is missing. For an update, check content/internal-news/updates.json and loader/loading/StaffHomepageLoader.cs. For a metric, compare its newest value with the metric's own SQL in Rock. |
segments |
A segment does not hold exactly what its data view finds in Rock. Fix how loader/loading/DataViewEvaluator.cs reads the view's filters. |
email-sections |
Rock would refuse a section's name, summary, or markup. Each line has Rock's message. Fix content/communications/email-sections.json or make-sections.spec.ts, and run make-sections.js again. |
signals |
Rock would give a person another top signal. Fix the order of the types in configuration/signals.json, or how loader/loading/SignalsLoader.cs picks the top one. |
personal-links |
A person's bookmark menu differs from menus in configuration/personal-links.json. Check the sections' roles, the person's roles, and the section orders in loader/loading/PersonalLinksLoader.cs. |
access |
Rock's answer differs from the walkthrough. Fix the category's security in configuration/categories.json, or the row in configuration/reporting.json, configuration/signals.json, or configuration/tags.json if the walkthrough is wrong. |
notifications |
Rock's bell counts a different number of unread mentions, or a mention opens the wrong place. Check the message rows in loader/loading/MentionNotificationsWriter.cs against what Rock's Note Mention component saves on this Rock. |