Skip to content

Add a plugin store, tighten storage and jobs, drop sign-in with Apple, and run every end-to-end case on WebKit - #3723

Merged
pournasserian merged 13 commits into
mainfrom
feature/storage-jobs-and-tests
Nov 26, 2026
Merged

pournasserian merged 13 commits into
mainfrom
feature/storage-jobs-and-tests

Conversation

@pournasserian

Copy link
Copy Markdown
Member

Closes #3604
Closes #3606
Closes #3575
Closes #3574
Closes #3560
Closes #3553
Closes #3552
Closes #3562
Closes #3649
Closes #3648
Closes #3213
Closes #3709

Brings the batch of feature/storage-jobs-and-tests into main: eight issues of storage, jobs and operations, the three end-to-end issues that were left, and the removal of member sign-in with Apple.

Storage, jobs and operations:

End-to-end tests of the admin:

Identity:

Changes a host or a client can see:

  • A host whose configuration names a member provider with Type: Apple no longer starts (FCMS3180). The package AspNet.Security.OAuth.Apple is no longer referenced.
  • The table cms_plugin_store is folded into the system Initial, so a database of an earlier build is refused with FCMS1308 and must be recreated; plugin_store becomes a reserved table name.
  • An import line without a file now copies the file at the key it names under a key of its own; mediaNameKeys=true (--media-name-keys) keeps the earlier naming.
  • At a stop the outbox drain's writes take half of ReleaseTimeout.
  • fluentcms.rate_limit.refused gains the policy value client-registration.

With #3713 and #3717 no end-to-end case is left out on WebKit. The end-to-end project now references Microsoft.EntityFrameworkCore.Sqlite, at the version already pinned, to write a login into the test host's database.

The decisions the issues left open are recorded on #3604, #3606 (ADR 0009) and #3553. What the reviews left for later is on the follow-up lists #3608, #3609, #3610 and #3611, with the lines the notes of the next release owe. #3587 and #3581 were left out of the batch and stay open.

Checked on the feature branch before this pull request: a quick run of CI with the Firefox and WebKit end-to-end jobs, green on every job (run 45890126997).

…3710)

Closes #3604

An import line without a file now copies the checked file at the key it
names under a key of the asset's own,
`{library}/{asset}/original-{v7}{ext}`, and owns it. A purge, a replace
or a site deletion on another instance that shares the storage and wrote
the key no longer removes it. The cost is a second copy of each such
file, written once.

Naming the key without a copy stays behind the import option
`mediaNameKeys=true` (`fluentcms import --media-name-keys`), off by
default, for instances that share the database too; with it the line
behaves as before, with `owns_file` false. A package cannot set the
option.

A copy that fails leaves no file and no row, and a rerun keeps the copy
because the asset already has the line's checksum. No model or migration
change; assets imported by naming a key in earlier builds keep naming
it.

Tests: a purge, a replace and a site deletion on the instance that wrote
the key leave the copy; the option through the endpoint, the in-host
command and the CLI; a rerun, a dry run and a failed copy. The media
plugin's tests ran on SQLite. The spec and the media README describe it;
the decision is recorded on the issue.
Closes #3709

Removes the Apple member provider: the type `Apple`, its `TeamId`,
`KeyId` and `PrivateKey` settings, its handler, its log level, its line
of the startup report and the package `AspNet.Security.OAuth.Apple`.
FluentCMS will not support sign-in with Apple (#3165, closed as not
planned).

A host that still names `Type: Apple` is refused at start with
`FCMS3180`, the error an unknown type gets, which names Google,
Microsoft, GitHub and Oidc. Stored Apple logins stay as they are; there
is no model or migration change.

The cases that Apple only illustrated now run on the generic OIDC
provider (`email_verified` sent as text, the `form_post` check, no
secret in the logs); the generated client secret and the log category
tests go with the provider.

The host configuration guide, the specification, requirement 11, the
roadmap and the record of the sign-in verification are updated; the
published notes of the two previews are not.
Closes #3649

On WebKit the two reload cases of `NavigationProgressTests` answer the
lazy assembly of their first visit with `Cache-Control: no-store`, so
the reload downloads it again and the test's route can hold it and see
the loading state. Only the test changes; the admin and the host do not.

Chromium and Firefox take the path they took before: Playwright's own
fetch of the answer cannot accept the run's certificate on Chromium.

The `NotOn=webkit` trait and the row in section 7 of the admin spec are
removed, and `docs/admin.md` now names one case left out on WebKit
(#3648).

Ran on WebKit at normal speed (2 of 2; WebKit has no slow mode) and on
Chromium (the class 5 of 5, the two cases in slow mode).
…3715)

Closes #3552

A registration refused by the registrations-per-hour limit of
`/connect/register` now counts in `fluentcms.rate_limit.refused` under
`fluentcms.policy` `client-registration`, once per refused request and
with no other tag, as the other values are recorded. Before, it answered
429 without the counter moving.

Spec 4.15 lists the new value. A test registers past a limit of one and
reads the measurement.
…at a stop (#3714)

Closes #3560

The outbox drain now bounds the writes of a stop by half of
`JobRunnerOptions.ReleaseTimeout`, so the drain job's own outcome is
written in the other half before the job runner's stop returns, where a
drain that used all of it left its job leased until the lease ended.

The runner still waits `ReleaseTimeout` in all, and no option was added.
At zero nothing is waited for, as before. The drain keeps its own split
inside its half: the settle first, then the release.

A new test on a manual clock stops a running job runner whose drain uses
its whole time and checks that the drain job succeeded before the stop
returned. The Events and Jobs tests of `FluentCMS.Data.Tests` ran on
SQLite, `OutboxFailureTests` on PostgreSQL too. The specification's
"Outbox drain, as built" and the job runner's stop describe it.
#3716)

Closes #3553

The guide states the bound per wait of the migrations lock (one wait on
PostgreSQL; one before the checks and one per stream on SQL Server, each
with its own 15 minutes and its own warning 9305) and names the schema
sync at a start, which runs on SQLite only.

The reads after the last stream stay outside the lock; the guide and the
spec say why. The guide names the permission the holder query needs on
Azure SQL Database.

`MigrationLockWaitTests` releases the held lock and observes the start
on every path. No production code changes. The decisions on the reads
and on the note of #3528 are recorded on the issue.

The migrations tests of `FluentCMS.Data.Tests` ran on SQLite, PostgreSQL
and SQL Server 2025.
Closes #3575

A hold now goes through `IDataProvider.HoldDocumentAsync`. On PostgreSQL
it is `SELECT ... FOR NO KEY UPDATE` by primary key, which takes the row
lock the update took and writes no new row version, so a publish no
longer leaves a dead row per locale for vacuum to clear.

SQLite and SQL Server, and any provider that does not override the
member, keep the update that sets nothing new. The lock timeout
(`FCMS2411`), the deadlock rerun and the answer for a row that is gone,
trashed or at another version behave as before.

`DocumentHoldTests` checks that the row is not rewritten across a hold
and which statements wait for it, and that a lock timeout and a deadlock
are still recognised; the gates of the lock-order tests also recognise
the locking read. The content tests of `FluentCMS.Data.Tests` ran on
PostgreSQL, and the lock classes on SQLite and SQL Server 2025. Spec 4.5
says what a hold is on each provider.
Closes #3648

On WebKit the case dispatches a `beforeunload` event in the page and
checks that no handler cancels it or sets its return value. Playwright's
WebKit never closes a page closed with `RunBeforeUnload`, so only
Chromium and Firefox still close the tab, as before.

The case with unsaved changes checks the same probe the other way, so
the check fails if the admin asks. Only the test changes.

The `NotOn=webkit` trait and the last row of section 7 of the admin spec
are removed, and `docs/admin.md` says that no case is left out.

Ran on WebKit (the case and its sibling with unsaved changes), on
Chromium (the class) and in Chromium's slow mode (the two cases).
…age (#3718)

Part of #3213

Adds the last case of the list: on the account page an external login is
listed, removed, the tab signs in again with the password, and the login
is still gone after a reload that reads it from the server.

The end-to-end host has no provider and nothing in its seeding links a
login, so the harness writes the login to the host's SQLite database
(`EndToEndHost.LinkLoginAsync`); no product code changes. The case
therefore runs on the published host only (`Host=Publish`), which the
image job already leaves out; section 7 of the admin spec says so.

Dependencies: none new. The end-to-end project now references
`Microsoft.EntityFrameworkCore.Sqlite`, at the version the repository
already pins, for its SQLite connection.

Passed on Chromium at normal speed and in slow mode, and on WebKit; the
whole `AccountPageTests` class passed on Chromium.
Closes #3606

- `IPluginStore<TPlugin>` (SDK): `GetAsync`, `TryAddAsync`,
`TrySetAsync(key, value, version)`, `DeleteAsync(key, version?)`. A lost
write answers null or false, never an exception. Keys are 1 to 128
characters matching `[a-z0-9]` groups joined by `.-_:`; values are text
up to 4,000 characters, without U+0000. A call inside the caller's open
transaction is refused. Values are per instance and never cached. The
decision is ADR 0009.
- A version is an opaque token compared for equality only: an added
value starts at a random version below 2^62 and each write adds one, so
a value added again after a delete starts at an unrelated version and a
write that read the earlier value loses.
- `cms_plugin_store (plugin, key, value, version, updated_at)` is folded
into the system `Initial` of SQLite, PostgreSQL and SQL Server. A
database of an earlier build is refused with `FCMS1308` and must be
recreated. `plugin_store` becomes a reserved table name.
- The media backfill keeps its cursor under `media.dimensions.backfill`
instead of row 2 of `cms_media_signing_key`, with no migration step,
since a preview upgrades no database. What changes for a chain that lost
a stale claim: when a start takes the claim over while one of the old
chain's runs is still reading its batch, that run loses its write and
enqueues nothing, and the new chain reads that batch again. Before, the
two chains took turns on the row; now only one goes on.
- Tests: compare-and-set with two writers and with retrying writers, a
write of a version read before a delete and an add, scoping between two
plugins, the limits and the refusal in a transaction, on all three
providers; the baseline and migration tests; the media plugin's tests
with the takeover case.
Part of #3610

`ApiKeysPageTests.LeavingTheNewKeysSecretGoesWhereTheUserWasGoing`
failed twice on Windows with `ComponentDisposedException` (runs
45845054935 and 45873964901): the secret check read each found
component's instance from the test thread, so a render after the
navigation could dispose one first.

It now finds and reads the components in one call on the renderer's
dispatcher, so no render runs in between. Nothing is caught, and a
rendered component that keeps the secret still fails the check
(`ANewKeyIsCreatedAndItsSecretShownOnce`). The same change applies to
the open-dialog check of `NothingAsks`.

Test code only. `FluentCMS.Admin.Tests` passed whole.
…and SQLite rebuilds (#3721)

Closes #3562

A name refused with `FCMS1529` that EF derived now says so and names the
call that gives a shorter one (`HasDatabaseName`, `HasName`,
`HasConstraintName` or `HasColumnName`); a given name keeps its text.
The code and when it is raised do not change.

A plugin's owned type on its owner's table, or a type split from its
principal's table, is no longer refused for the foreign key or the key
column EF never emits for that link; every foreign key EF emits is still
measured. The linking foreign keys of TPT and entity-splitting tables
are listed as not measured.

A check constraint's given name is measured as EF cuts it, to 63
characters, with a test. A SQLite table rebuild in `schema apply` loses
an index of expressions made by hand; a test pins it and the guide says
how to make it again. The job runner and the database lock share one
disposal bound, `DisposeWait.Bound`.

The plugin contribution tests ran on SQLite, PostgreSQL and SQL Server
2025, the schema apply tests on PostgreSQL and SQL Server 2025, and the
plugin and migration tests on SQLite. The guide gains a section "Names
of the model".
…3722)

Closes #3574

`ContentRoundTripTests` pins a publish of one of two locales (38 round
trips on SQLite), a scheduled publish job (63) and an import of an entry
in two locales (108), each with a comment that breaks the count down by
what the statements are, and with the counts per provider on PostgreSQL
and SQL Server. An increase fails the test, as for the update case.

Spec 4.4 states the counts. No production change.

Measured along the way, and left for the follow-up list: a publish
nested in a scheduled job or an import holds again the rows its
transaction already holds.
@pournasserian pournasserian added plugin type:feature New capability type:chore Repository, tooling or housekeeping area:sdk FluentCMS.Sdk public contract area:storage EF Core model, providers and migrations area:content Content service and query model area:identity Users, authorization server, API keys and members area:jobs Job runner and scheduled jobs area:testing Test host and fixtures area:operations Health, observability, limits, locks and diagnostics area:admin The Blazor WebAssembly admin and the admin halves of plugins labels Nov 26, 2026
@pournasserian
pournasserian enabled auto-merge (squash) November 26, 2026 20:49
@pournasserian
pournasserian merged commit 681ed2c into main Nov 26, 2026
64 checks passed
@pournasserian
pournasserian deleted the feature/storage-jobs-and-tests branch November 26, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:admin The Blazor WebAssembly admin and the admin halves of plugins area:content Content service and query model area:identity Users, authorization server, API keys and members area:jobs Job runner and scheduled jobs area:operations Health, observability, limits, locks and diagnostics area:sdk FluentCMS.Sdk public contract area:storage EF Core model, providers and migrations area:testing Test host and fixtures plugin type:chore Repository, tooling or housekeeping type:feature New capability

Projects

None yet

1 participant