Skip to content

Rewrite the API, testing, deployment and Mage-OS introduction pages - #111

Open
DavidLambauer wants to merge 8 commits into
mainfrom
docs/rewrite-api-testing-deployment
Open

DavidLambauer wants to merge 8 commits into
mainfrom
docs/rewrite-api-testing-deployment

Conversation

@DavidLambauer

@DavidLambauer DavidLambauer commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Rewrites the pages people copy from most, checked against the Mage-OS 4.0.0 code. There is one commit per topic, so you can review it commit by commit.

Web APIs (9 pages → 4)

The overview, web-api, REST, SOAP, api-reference and how-to pages repeated one walkthrough whose samples failed on 4.0:

  • products looked up by ID instead of SKU;
  • request bodies without the {"product": …} wrapper;
  • list calls without searchCriteria;
  • an admin token endpoint that 2FA blocks;
  • GraphQL queries without search/filter;
  • "extend" recipes that were fatal errors.

The replacements:

  • Web API overview: authentication including 2FA and the standalone Bearer setting, store codes, searchCriteria, Swagger, and the SOAP WSDL URL.
  • REST: the curl walkthrough, rewritten with SKUs, payload wrappers and error handling.
  • GraphQL: queries that work on 4.0, plus how to add your own query.
  • Create a web API endpoint (new): a complete Vendor_Module.

soap-apis, web-api, api-reference and how-to-use-and-extend-apis are removed.

Testing (PHPUnit 12)

  • Unit and integration testing: samples use PHPUnit 12 attributes and static data providers, and the integration setup has the 4.0.0 install-config keys.
  • Functional testing: covers MFTF 4.0.0 and API-functional tests.
  • Static testing: uses phpcs --standard=Magento2, plus the PHPStan and PHPMD configs that ship with Mage-OS.
  • JavaScript testing: covers the core Jasmine setup.
  • Removed: testing-tools, which documented MTF, a framework that no longer exists.

Production deployment (new page)

"Deploying to production" replaces the CI/CD page, which had no Mage-OS content. It covers:

  • connecting OpenSearch, Valkey/Redis, sessions, RabbitMQ, Varnish and cron;
  • production mode;
  • the config.php/env.php split;
  • a build and deploy sequence that runs setup:upgrade --keep-generated only when setup:db:status asks for it.

Server setup now lists current versions and wires PHP-FPM to nginx and Apache.

Found along the way: --session-save=valkey is accepted in 4.0.0, but no Valkey session handler exists, so sessions silently fall back to files. The page warns about this and uses the redis handler pointed at Valkey instead. This is worth an upstream issue.

Mage-OS identity

  • Overview of Mage-OS: says what Mage-OS is, and the website → store → store view order is corrected.
  • Core features: the Adobe Commerce-only features are removed. Each module Mage-OS adds is checked against a 4.0.0 install and linked to its release post.
  • Help and support: points to Mage-OS channels: Discord, GitHub, Stack Exchange and partners.
  • Contributing: describes the fork → branch → pull request flow and how a docs page counts as reviewed.
  • README: no longer asks for pull requests against version branches.

All XML samples validate against the 4.0.0 XSD files, and all PHP samples pass php -l on PHP 8.4. New pages keep the "pending human review" banner; set communityNote: false once you've reviewed a page.

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

DavidLambauer and others added 4 commits November 28, 2026 16:44
Nine pages repeated the same token-to-Bearer walkthrough, and their
samples failed against Mage-OS 4.0: products looked up by ID instead
of SKU, request bodies without the {"product": ...} wrapper, list
calls without searchCriteria, an admin token endpoint that 2FA blocks,
GraphQL queries without search or filter, and "extend" recipes that
were fatal errors.

Replace them with:
- Web API overview: REST, GraphQL and SOAP, authentication including
  2FA and the standalone Bearer token setting, store codes,
  searchCriteria, Swagger and the SOAP WSDL URL.
- REST: a curl walkthrough with SKUs, payload wrappers and errors.
- GraphQL: working queries, customer tokens, caching, and adding a
  query with schema.graphqls and a resolver.
- Create a web API endpoint (new): a complete Vendor_Module with a
  service contract, webapi.xml, acl.xml and an extension attribute.

Remove soap-apis (now part of the overview), web-api (folded into
REST), api-reference (it wasn't a reference; the store serves its own
schema) and how-to-use-and-extend-apis (replaced by the new page).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CI/CD page had no Mage-OS content at all, the workflows page's
deployment section had no commands, and the server setup page listed
end-of-life versions (CentOS, PHP 7/8.1, MySQL 8.0, Elasticsearch).

Add "Deploying to production": the services a production server
runs, connecting OpenSearch, Valkey or Redis, sessions, RabbitMQ,
Varnish and cron with bin/magento, production mode, the config.php
and env.php split, and a build and deploy sequence that runs
setup:upgrade --keep-generated only when setup:db:status asks for it.
It warns that --session-save=valkey silently falls back to file
sessions in 4.0.0 and uses the redis handler pointed at Valkey
instead.

Update server setup to current versions with PHP-FPM wired to nginx
and Apache, point the workflows page to the new page, and remove the
CI/CD page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The overview never said what Mage-OS is and had the website, store and
store view hierarchy backwards. Core features listed Adobe
Commerce-only features (staging, reward points, gift cards, private
sales) and none of Mage-OS's own. The help page sent readers to Adobe
support plans, and the contribution page pushed to the upstream repo
without a fork.

- Overview of Mage-OS: what it is, how it relates to Magento Open
  Source and Adobe Commerce, and how releases track upstream.
- Core features: what Magento Open Source provides, plus the modules
  Mage-OS 4.0 adds (returns, passkeys, SEO, admin activity log, the
  installer and more), each checked against a 4.0.0 install and
  linked to the release post that introduced it.
- Help and support: Discord, GitHub issues, Stack Exchange, security
  reports and partners.
- Contributing: discuss first, fork, branch and open a pull request
  against main, upstream vs Mage-OS, and how to contribute to these
  docs, including how a page counts as reviewed.

The README no longer asks for pull requests against version branches;
the repository only has main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mage-OS 4.0 uses PHPUnit 12, which ignores @test and @dataProvider
annotations and requires static data providers, so the samples on the
unit and integration pages errored. The functional testing page
invented a browser API and never mentioned MFTF, the static testing
page never named the Magento2 coding standard, and the JavaScript page
was a generic Jest tutorial.

- Unit and integration testing: PHPUnit 12 attributes, the project's
  own phpunit configs, the 4.0.0 install-config keys for OpenSearch,
  MySQL 8 users, and #[DataFixture]/#[DbIsolation]/#[Config].
- Functional testing: MFTF 4.0.0 setup and runs, and API-functional
  tests in dev/tests/api-functional.
- Performance testing: fixture profiles, the profiler, the query log
  and cache-hit headers.
- Static testing: phpcs --standard=Magento2 from
  mage-os/magento-coding-standard, and the PHPStan and PHPMD configs
  in dev/tests/static.
- JavaScript testing: the core Jasmine setup with grunt spec.

Remove the testing tools page; it documented MTF, which no longer
exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DavidLambauer and others added 3 commits November 28, 2026 22:00
Every REST, SOAP and GraphQL call, both sample modules and the 2FA
flow were run against a Mage-OS 4.0.0 store. Corrections:

- Admin and customer tokens both expire after 60 minutes
  (webapi/jwtauth/*_expiration); the OAuth setting doesn't apply.
- With admin 2FA on and no provider selected (the default), the
  admin token call fails with "configure 2FA first".
- Integrations need the admin password to save and HMAC-SHA256 to
  sign; HMAC-SHA1 is rejected.
- Async bulk routes with a path parameter reject every request with
  "Request body must be an array".
- Plugins are compiled into generated code, so a new plugin needs
  generated/ cleared, not only cache:flush.
- REST samples now run in order, with real store codes; POST with an
  existing SKU updates the product.
- GraphQL: the extension sample needed its resolver class; through
  Varnish, clients don't see X-Magento-Tags.
- Automatic translation is off by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unit, integration, API-functional, static and JavaScript test
setups were run on a Mage-OS 4.0.0 store. Corrections:

- Unit tests: run from dev/tests/unit; from the project root PHPUnit
  exits 1 on an Allure config warning even when the tests pass.
- JavaScript tests: grunt spec hangs because grunt-contrib-jasmine
  downloads Jasmine 7, which lacks the boot files the runner loads;
  the page shows how to pin Jasmine 5. Luma then runs 1,518 specs.
- Static tests: dev:tests:run static fails on an untouched project
  and skips untracked files; PHPMD 3 needs the analyze syntax.
- Performance: the fixture profiles fail at "Generating admin users"
  because of the 12-character admin password rule; the workaround is
  a profile copy without admin users next to the original.
  varnish:vcl:generate needs all four Varnish settings on 4.0.0.
  cache:disable full_page keeps serving pages from Varnish until
  cache:flush.
- Functional tests: REST and SOAP API tests authenticate through an
  OAuth integration; TESTS_WEBSERVICE_USER isn't read.
- Integration tests: MariaDB still accepts GRANT ... IDENTIFIED BY.
- Samples no longer use final classes, which the Magento2 coding
  standard rejects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every command on these pages was run on a Mage-OS 4.0.0 store, with
the build tested in a copy and the deploy script tested with release
directories and a current symlink. Corrections:

- varnish:vcl:generate doesn't apply its documented defaults, its
  version 7 output leaves {{ host }} placeholders and its version 6
  output contains &#123;. The page now generates the VCL, repairs it
  and checks it with varnishd -C.
- The deploy script stopped at a confirmation prompt when stores
  changed and left the store in maintenance mode; app:config:import
  and setup:upgrade now run with --no-interaction.
- A build without a database needs the stores in config.php
  (app:config:dump scopes), and bin/magento must not run before
  composer install -o.
- setup:db:status returns 0 for a new module without schema or
  patches, and 255 when the database is unreachable.
- app:config:dump without arguments exports every module default.
- Server setup lacked the fileinfo and sockets PHP extensions; the
  workflow page now describes what .gitignore.sample really ignores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gregor-RW

Copy link
Copy Markdown

PR 111 has two wrong claims that break things when someone copies them. The rest is accurate, apart from minor issues. The structure repeats the PR 110 problems: 6 deleted pages will return 404, and much of the content overlaps PR 113.

  • production-deployment.md line 308: in production mode, setup:db:status exits with 2, not 255.
  • Because of that, the deploy script leaves the store in maintenance mode.
  • performance-testing.md line 86: Varnish keeps its pages unless you flush before you disable full_page.
  • production-deployment.md line 295: reload PHP-FPM before the cache flush.
  • create-a-web-api-endpoint.md line 585: the orders call returns 401, because the token lacks the Sales permission.
  • core-features.md line 10: Mage-OS removed the Adobe analytics modules, so it does not contain all of 2.4.9.

…-OS modules are developed

The deploy script ended maintenance mode before the PHP-FPM reload and the cache flush. Mage-OS 4.0 doesn't contain everything in Magento Open Source 2.4.9. The MageOS_ modules have their own repositories.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants