Repository navigation
feat: add system.v3, describing the Craft install and not just its disk - #13
Merged
Merged
Conversation
The runtime report has always described the disk a site sits on - volume sizes, free space, PHP limits - and said nothing about the Craft install doing the sitting. system.v3 adds four sections a site can answer about itself and nothing outside it can observe: deprecation and session counts, whether a security key is set and whether the control panel is still at the default trigger; the database size; whether Craft's writable directories are writable; and which required PHP extensions are absent, plus which imaging library is available. The database size is the one worth calling out. Backups are the reason this package exists, and until now the report described every asset volume and the disk underneath them while saying nothing about the size of the thing being backed up - which is the figure that decides whether a backup finishes. v1 and v2 are untouched, so every existing combination of connector and platform keeps working and neither side has to be upgraded first. Each addition has a more useful shape that is deliberately refused, and the tests are what keep refusing it. A deprecation warning is easier to act on with its message, but the message names the site's own templates; a database size is easier to act on with a table breakdown, but table names describe somebody's business; a moved control panel is easier to find if you know where it moved to, which is exactly what moving it was meant to prevent. So this sends the count, the total and the boolean. missing_extensions is a closed enum of Craft's published requirements rather than free strings, so it cannot become the loaded-extension inventory that php.extensions is reduced to a count to avoid, and paths is a fixed set of Craft's own directory names because a free-form label is a filesystem path with extra steps. Response compression is not here. It is decided at the edge, so a site behind a CDN would report its origin's answer rather than the one a visitor gets.
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.
The runtime report has always described the disk a site sits on — volume sizes, free space, PHP limits — and said nothing about the Craft install doing the sitting.
system.v3adds four sections a site can answer about itself and nothing outside it can observe.What it adds
craftdeprecation_count,session_rows,security_key_set,cp_trigger_defaultdatabasesize_bytespathsstorage,cpresources,config_projectphpmissing_extensions,image_driverThe database size is the one worth calling out. Backups are the reason this package exists, and until now the report described every asset volume and the disk underneath them while saying nothing about the size of the thing being backed up — which is the figure that decides whether a backup finishes.
Compatibility
system.v1andsystem.v2are untouched, byte for byte. A connector sending either keeps working against any platform that accepted it before, and a platform that has not been upgraded keeps receiving exactly what it received: the connector picks the newest version both sides know, so neither has to move first.What was left out, and why
Every addition has a more useful shape that this schema refuses, and the tests are what keep refusing it.
cp_trigger_defaultis a boolean, and there is no field for the trigger itself. A site that moved its control panel moved it somewhere it would rather not have written down; reporting the new address in somebody else's dashboard would undo the change being reported.security_key_setis presence, never the key.missing_extensionsis a closed enum of Craft's published requirements, so it cannot become the loaded-extension inventory thatphp.extensionsis reduced to a count to avoid.pathsis a fixed set of Craft's own directory names for the same reason a volume sends a handle rather than a path — a free-form label is a filesystem path with extra steps.image_driveris which library, never which version. The version belongs to the host.Checks
vendor/bin/pest— 400 passed, 2848 assertions.vendor/bin/phpstan analyse— no errors. The new fixtures cover both directions: a realistic v3 report, and one carrying the identifying half of every fact v3 added, asserted to be refused without the rejected values ever appearing in the error text.CHANGELOG.mdand the version incomposer.jsonandProtocol::VERSIONmove with the change, in this commit.