Repository navigation
Add ADR-0013 on extension versioning, a surface baseline, and conformance suites for every extension point - #2620
Merged
Merged
Conversation
…ance suites for every extension point
… against EngineJobs, and name each suite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2612
What
Two slices of F-EXT (#2429): the versioning policy for extension interfaces (EXT-N2), and a conformance suite for every extension point, with checks that keep both true (EXT-N1).
[Obsolete]for at least a minor release first.tests/FluentCMS.Tests/Extensions/extension-points.txtlists every[ExtensionPoint]interface's members, with types, nullability, default arguments and which members have a default body.ExtensionPointRulesTestscompares the interfaces with it, each member within its own interface, and prints each added or removed member with the interface it belongs to. Events count as members.FLUENTCMS_UPDATE_EXTENSION_BASELINE=1rewrites it.[ConformanceFor(typeof(...))]marks the class that checks an extension point. It is one file intests/, compiled into both test projects.JobHandlerConformanceTests: a type name that is lowercase and stable and that no other handler takes; aRunAsthatEngineJobsallows, so the enqueuer or the one engine Core lists the handler for; and a failure with a code and a message, not an exception, for a payload the handler can't read, unless the handler reads nothing from its payload. Every job handler derives from it: the check run, the retention purge, bulk entry updates and, in the integration tests, which compile the base class too, webhook delivery.SearchIndexConformanceTests, run on SQLite and PostgreSQL:The in-database indexes derive from it.
ChangeSetEventsConformanceTests, for the publish listener extension point that came with webhook delivery (Deliver signed webhooks on publish and revert from the job queue, with retries and a delivery log #2623), run on SQLite and PostgreSQL. A listener takes a publish and a revert's publish without failing, and what it records rolls back with a publish that doesn't commit. The webhook listener derives from it, with a subscription seeded so it has something to queue.[ConformanceFor]covers, naming it.Why
EXT-N1 asks that core features use the public extension interfaces, and the epic asks for a conformance suite per interface that every implementation passes. EXT-N2 asks for versioned interfaces with breaking changes only at majors. Until now nothing kept either true: an extension point could change, or land without a suite, unnoticed.
Choices worth a look:
PublicApiAnalyzers: it tracks only what plugins implement, adds no package, and keeps the rest of Core free to change while nothing is published.JobContext, is reviewed with that type, as the ADR says.IChangeSetEvents, the rule test named its member, and the baseline gained those two lines in this PR.Tests
ExtensionPointRulesTests:ISearchIndex.CheckRunJobConformanceTests,BulkEntryUpdatesConformanceTestsandWebhookDeliveryJobConformanceTests: each handler's type, itsRunAs, and four payloads it can't read.RetentionPurgeJobConformanceTests: its type andRunAs.InDatabaseSearchIndexConformanceTests: four checks, each on SQLite and PostgreSQL.WebhookPublishListenerConformanceTests: two checks, each on SQLite and PostgreSQL.The full suite ran locally against a
postgres:17container as well as SQLite, and markdownlint passes. No new package and no new project reference.Checklist
v2