Page MenuHomePhabricator

Deploy the OpenAPI linter in CI
Open, In Progress, MediumPublic5 Estimated Story Points

Description

Add the OpenAPI linter test to the API tests job to lint the MediaWiki REST API OAD in CI.

This task requires the wikimedia-spectral-ruleset package to be published and should be done after T425627.

To complete this task, you might need to look into Quibble (https://doc.wikimedia.org/quibble/) and make changes to the https://gerrit.wikimedia.org/g/integration/config repository. The full name of the api tests job is quibble-apitests-only-vendor-php83.

Conditions of acceptance

  • A new test exists for running the OpenAPI linter in CI as part of the api tests job.
  • The test runs the linter on the MediaWiki REST API OAD, currently available in the Special:RestSandbox (e.g. on mediawiki.org) under "MediaWiki REST API (routes not in modules)". The exact URL on mediawiki.org is: https://www.mediawiki.org/w/rest.php/specs/v0/module/-.
    • Optional: the linter only evaluates the paths that start with /v1/.
  • Before the test runs, the appropriate NPM packages (Spectral + wikimedia-spectral-ruleset) are installed. Note that the exact Spectral packages needed will depend on the implementation. This could be either @stoplight/spectral-cli, or @stoplight/spectral-core, and others.
  • The test never fails but always returns/lists all the detected issues. To achieve this, a local configuration must override the wikimedia-spectral-ruleset settings and downgrade all errors to warnings. The linter must then be configured to only fail on errors (effectively preventing the test from failing).
  • The linter is configured to return the list of detected issues in a format readable as part of test output. This might require a change to Spectral's issue formatting in CLI, for example from the default stylish format, to junit, text, or pretty.
  • The test runs on every changeset in MediaWiki core.

Event Timeline

KBach renamed this task from Deploy the linter in CI to Deploy the OpenAPI linter in CI.Thu, Jun 25, 9:35 AM
KBach triaged this task as Medium priority.
KBach updated the task description. (Show Details)

This is a type of work we don't usually do, and there is therefore some uncertainty regarding effort level.

If it turns out that a portion of the work is more effort than the estimation allows, it could be broken into a subtask.

AGhirelli-WMF set the point value for this task to 5.Thu, Jun 25, 3:23 PM