Repository navigation
Rebuild the XML reference pages from the XSD files and validate samples in CI - #109
Open
DavidLambauer wants to merge 7 commits into
Open
DavidLambauer wants to merge 7 commits into
DavidLambauer wants to merge 7 commits into
Conversation
The XML reference pages documented elements and attributes that the schemas reject, so copied samples failed in developer mode. Add a check that runs every complete XML sample (one with xsi:noNamespaceSchemaLocation) through xmllint against the XSD files of Mage-OS 4.0.0, resolving urn:magento:* locations through a generated XML catalog. Pull requests and pushes check only the pages they change, so older pages don't block unrelated work; a manual run checks every page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Magento reads cron jobs from etc/crontab.xml; no cron_jobs.xml file exists anywhere in the codebase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Most reference pages documented elements and attributes that the schemas reject, so copied samples failed validation in developer mode: roles and permissions in acl.xml, a method attribute on observers, dataType in db_schema.xml, snake_case field attributes in system.xml, an invented <method> element in webapi.xml, a <widget> layout element, and more. Rewrite all 18 pages from the XSD files and the core files of 4.0.0, with one structure: what the file does and who reads it, location and merging, a complete example that validates, an element and attribute reference with the defaults from the schema, and the related commands. Also document what the old pages left out, such as the db_schema whitelist, mview.xml, config_path schedules, layout view models, and that setup:upgrade --dry-run needs =1. There is no file called layout.xml, so the nav now says "Layout XML". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inks after methods run in ascending sortOrder unless an around method wraps them; the observers page is being merged into the events page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every complete example was installed in a module on a Mage-OS 4.0.0 store and its behavior checked. Corrections: - db_schema.xml: renaming a table with migrateDataFromAnotherTable copies rows by column position, so data can land in the wrong columns before the old table is dropped (now a warning); a renamed column must also be renamed in its keys; generate-whitelist writes nothing until the module is enabled. Confirmed that --dry-run without =1 runs the upgrade. - di.xml: plugins are compiled, so a new or changed plugin needs the generated classes removed or setup:upgrade; an object argument on an untyped parameter arrives as an array. - crontab.xml / cron_groups.xml: schedules use the store timezone; the five other core groups of 4.0.0; separate-process groups run in the background even with --group. - extension_attributes.xml: joined values appear in list calls but not in GET by id; the sample plugin now sets the value on the result. - fieldset.xml: checkout doesn't copy a custom quote field to the order on its own; the example now includes the observer that does. - menu.xml: changes need cache:clean config block_html. - routes.xml: a new controller needs cache:clean compiled_config; after only works with the module in <sequence>. - layout.xml: page layouts live in page_layout/, not layout/. - indexer.xml: realtime mode drops the changelog and marks the indexer invalid; updated_at-only changes aren't recorded. - webapi.xml: one method without @return breaks every REST request; admin tokens pass self routes with an empty %customer_id%. - widget.xml: the block class must be declared in a widget.xml or the directive renders nothing. - view.xml: read on every request; images merge by id and type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
39 tasks
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 XML reference pages documented elements and attributes that the Mage-OS schemas reject, so samples copied from them failed validation in developer mode. Some examples:
acl.xml, which live in the database;methodattribute on observers;dataTypeindb_schema.xml;system.xml;<method>element inwebapi.xml;cron_jobs.xmlfile, which doesn't exist; Magento readscrontab.xml.Changes
db_schema_whitelist.jsonworkflow;mview.xml;config_pathcron schedules and custom cron groups;<update>/<remove>inmenu.xml;setup:upgrade --dry-run=1pitfall:--dry-runwithout a value runs the upgrade for real.cron_jobs_xmlrenamed tocrontab_xml. The nav labellayout.xmlis now "Layout XML", because files are named after layout handles..github/workflows/xml-samples.yml+.github/scripts/validate_xml_samples.py):xsi:noNamespaceSchemaLocation, is validated withxmllintagainst the XSD files ofmage-os/mageos-magento2at4.0.0.urn:magento:*locations resolve through a generated XML catalog.```xml no-validate.All 28 complete XML samples validate, and the PHP samples pass
php -lon PHP 8.4.Tested on a running store
Every command and code sample on these pages was then run on a Mage-OS 4.0.0 store in Warden (PHP 8.4, MariaDB 11.8, OpenSearch 3.4, Valkey 8.1, Varnish 8.0, RabbitMQ 4.2), and the pages were corrected wherever the store behaved differently from what the code suggested. What needs several servers or outside services was checked in the code only.
Merge mage-os/devdocs-website#74 first: this pull request removes pages, and until that change is live the website answers a request for a removed page with a 500. #151 adds the redirects to the pages that replace them.
Merge order and notes for reviewers: #115.
🤖 Generated with Claude Code