-
Notifications
You must be signed in to change notification settings - Fork 190
docs: Clarify documentation gaps across the project #5701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jmuzina
wants to merge
4
commits into
main
Choose a base branch
from
new-maintainer-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # Continuous Integration and automated checks | ||
|
|
||
| This guide explains what runs locally versus in CI, how visual testing works, and how to act on failures. | ||
|
|
||
| ## Overview | ||
|
|
||
| - Local: `yarn test` (or `npm run test`) via `dotrun test` runs spelling, formatting/linting, Parker metrics, and Jest | ||
| tests. Some tasks (e.g., Percy) are CI-only. | ||
| - CI (GitHub Actions): Percy visual tests run on PRs that meet selectivity rules or when labeled. | ||
| See [Percy workflow](/guides/percy-workflow.md). | ||
| - Legacy deployment jobs run in Jenkins for PS5 (high-level only; see [Deployment](/guides/deployment.md)). | ||
|
|
||
| ## Local checks | ||
|
|
||
| It's good practice to run these checks locally before pushing changes. | ||
|
|
||
| ``` | ||
| npx prettier -c -w . # Formatting/linting, applying safe fixes | ||
| yarn test # Spellcheck, Parker metrics, Jest tests | ||
| ``` | ||
|
|
||
| Locally, you’ll see failures from: | ||
|
|
||
| - Spelling (`mdspell`): currently configured with en‑GB; our policy for new docs is en‑US. Use `.spelling` to ignore | ||
| valid en‑US words and technical terms. See [Language policy](/guides/language.md). | ||
| - Format/lint (e.g., Prettier/Stylelint): Read the output for fix details. | ||
| - Parker CSS metrics: see [Parker CSS metrics](#parker-css-metrics) below for details. | ||
| - Jest tests: snapshot configuration tests; see [Snapshot generation tests (Jest)](#snapshot-generation-tests-jest) | ||
| below for details. | ||
|
|
||
| ## Visual testing (Percy) | ||
|
|
||
| Percy runs visual snapshot tests against the examples site. On PRs, it triggers when: | ||
|
|
||
| - The PR targets `main`, and either: | ||
| - It passes the selectivity filters (changes to `scss/`, `templates/docs/examples/`, `templates/_macros/`, | ||
| `tokens/`, or `sd.config.json`, and it’s not a draft), or | ||
| - The PR carries the label `Review: Percy needed`. | ||
|
|
||
| Key points: | ||
|
|
||
| - Examples are discovered by `snapshots.js` and include both regular and `standalone/` variants for many paths. | ||
| - Combined examples (`combined.html`) reduce snapshot counts by aggregating variants; this helps control quota. | ||
| - Examples are snapshotted in all themes (light, dark, paper), at the large screen size. On the light theme, examples | ||
| are also snapshotted at the small screen size. If an example is "responsive" (indicated by including "responsive" in | ||
| the filename), it will be snapshotted at the medium screen size. | ||
| See [Percy workflow](/guides/percy-workflow.md) for device widths, themes, and combined-behavior rules. | ||
| - Reviewing Percy: follow the flow in the Percy guide; when in doubt, re-run the job by re-applying the "Review: Percy | ||
| needed" label. | ||
|
|
||
| ## Snapshot generation tests (Jest) | ||
|
|
||
| The file `tests/snapshots.test.js` validates that `snapshots.js` returns a correct set of snapshots: | ||
|
|
||
| - Ensures unique names and URLs. | ||
| - Ensures correct base URL and expected widths. | ||
| - Special-cases combined examples that embed responsive examples. | ||
|
|
||
| If you add a `combined.html` for a group that should be treated as responsive, and the test does not infer it from | ||
| filenames, update `RESPONSIVE_COMBINED_EXAMPLES` in `tests/snapshots.test.js`. | ||
|
|
||
| ## Parker CSS metrics | ||
|
|
||
| Parker provides coarse CSS complexity/size guardrails. It’s unmaintained upstream but still catches regressions. | ||
| Thresholds live in `tests/parker.js` (e.g., “Stylesheet size”, “Top specificity”). Example failure: | ||
|
|
||
| ``` | ||
| $ node -e 'require("./tests/parker").parkerTest()' | ||
| ✘ - Stylesheet size (519994) exceeds threshold (422850) | ||
| error Command failed with exit code 1. | ||
| ``` | ||
|
|
||
| If your change is justified, update the relevant thresholds in `tests/parker.js` and explain the rationale in your PR. | ||
|
|
||
| ## Cypress (limited) | ||
|
|
||
| Cypress usage is experimental and not central to our process. Some specs exist (for example, | ||
| `cypress/e2e/patterns/accordion.cy.js`). Flakes can happen; re-running in GitHub Actions often resolves transient | ||
| failures. Prefer Percy and unit-level checks unless an E2E adds clear value. | ||
|
|
||
| ## Spelling (`mdspell`) | ||
|
|
||
| Scripts currently use en‑GB dictionaries. Our policy is to write new docs in en‑US. If `mdspell` flags a valid en‑US | ||
| spelling or a technical term, add it to `.spelling`. See [Language policy](/guides/language.md). | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.