Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,61 @@ this file collects what users and scripts need to know.

## Unreleased

## 0.28.0 (2026-11-25)

### New

- `norcube cms validate --quality` also runs the content quality checks:
search (titles, descriptions, share images, noindex), accessibility (alt
text, heading levels, link text), languages (missing and incomplete
translations) and media (heavy images, unused files). Quality findings
are warnings (high and medium impact) or notices (low impact and
information only); they are never errors, and notices never fail a run.
`--strict-quality` turns quality warnings into errors. The table names
what the quality checks skipped or guessed, and shows the language of a
finding about one language of a page that holds every language
(`title.en [en]`).
- `cms validate --quality --git` reads the checkout's git history to find
outdated translations (`quality.translation_outdated`): a language
version whose source, the page in the site's default language, changed
a text since the version last changed or was marked current. Changed
links, images, numbers, select values and white space are not texts to
translate and never count, and a version whose history can't be read
(a file git doesn't know, or older than the history read) is not
judged. `--git` needs `--quality`; if git cannot read the history, the
run stops with an error (`usage_error` outside a checkout, `timeout`,
`error`). A shallow clone is refused with `usage_error`, because its
history would make every translation look current: in CI, check out
with `fetch-depth: 0` (`actions/checkout`) or run `git fetch
--unshallow` first.
- `cms validate` uses cms-schema 0.11.1: language versions
(`translations.by`), field roles (`role:`, `whenEmpty`,
`titleTemplate`), image alt text (`alt:`, `decorative`), languages held
in one file (`localized: true`), `translations.locales`, translation
marks and the schema rules that check them.
- `cms validate` on a repository whose site lives in a folder (a monorepo
with the site in `website/`) names that folder when the path holds no
site: "The site is in website/: run nrc cms validate website". Passing
the folder validates it, `--git` included (the history is read for the
folder's files).

### Changes for scripts

- `cms validate -o json`: `summary.notices` counts notices, and with
`--quality` the report has a `quality` object (per rule how many
instances were checked, the rules turned off, skipped or guessed about).
A finding's `severity` may be `notice`; quality findings also carry
`impact`, `value`, `measure`, `basis` and `locale`. A
`quality.translation_outdated` finding sits at the path of the first
changed text, its `measure` counts the changed texts (unit
`changedTexts`) and its `value` is the source's path and blob id
(`<path>@<blob>`).
- `cms validate -o text`: a finding about one language of a page that holds
every language shows the language after its path in the third column
(`title.en [en]`). Only quality findings have a language.

## 0.27.0 (2026-11-15)

### New

- `norcube cms validate [path]` checks a Norcube CMS site from its
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,41 @@ On a machine without a browser, `norcube login --device` signs you in with a
code you approve on your phone or laptop. See
[CI and automation](https://docs.norcube.com/platform/cli#ci-and-automation).

## Checking a Norcube CMS site

`norcube cms validate` reads a checkout of the site's repository and runs
the checks the Norcube CMS editor runs, offline and without a sign-in. It
exits 1 when a finding is an error (`--fail-on warning` or `none` changes
that), so it can guard a site's CI.

```bash
norcube cms validate ./site # schema, content and links
norcube cms validate ./site --quality # plus content quality
norcube cms validate ./site --quality --git --strict-quality # in CI
```

- `--quality` adds the content quality checks: titles and descriptions for
search, alt text, headings and link text, missing and incomplete
translations, heavy images and unused files. Their findings are warnings
or notices, never errors, and notices never fail a run.
- `--strict-quality` (with `--quality`) turns quality warnings into errors.
- `--git` (with `--quality`) reads the checkout's git history, so a
translation whose source changed a text since the translation last
changed is found; changed links, images and numbers don't count. It
needs git and a full clone of the repository; if git cannot read the
history, the command stops with an error. A shallow clone is refused,
so in CI check out with `fetch-depth: 0`:

```yaml
- uses: actions/checkout@v4
with:
fetch-depth: 0 # cms validate --git reads the whole history
- run: norcube cms validate --quality --git --strict-quality
```

`-o json` prints every finding with its rule id, and with `--quality` a
`quality` summary of what was checked, skipped and guessed.

## Documentation

- [CLI guide](https://docs.norcube.com/platform/cli): login, profiles,
Expand Down
4 changes: 3 additions & 1 deletion docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ flag; [CHANGELOG.md](../CHANGELOG.md) says when each arrived.
| `billing` | `status`; `subscriptions list`; `usage estimate | metrics`; `invoices list | download`; `budget get | set` |
| `monitor` | `status` (`--fail-on`); `monitors list | get | create | update | delete | pause | resume | run` (`--wait`), `monitors bulk pause | resume | delete`, `monitors results list`, `monitors status-changes list`, `monitors stats get`, `monitors availability get`, `monitors certificate get`, `monitors alerts get | set`; `incidents list | get | acknowledge | summary`; `channels list | get | create | update | delete | test | verify`, `channels deliveries list`; `status-pages list | get | create | update | delete | publish | unpublish | preview-link`, `status-pages layout get | set`, `status-pages incidents list | get | create | update`, `status-pages incidents updates create`, `status-pages subscribers list | delete`; `maintenance list | get | create | update | cancel | finish` |
| PromptHub | No command group; `nrc api prompthub ...` |
| `cms` | `validate` (`--only schema|content|links`, `--collection`, `--fail-on`), offline on a site checkout; the CMS has no public API, so there are no resource commands |
| `cms` | `validate` (`--only schema|content|links`, `--collection`, `--fail-on`, `--quality`, `--strict-quality`, `--git`), offline on a site checkout; the CMS has no public API, so there are no resource commands |

CI token scopes, as defined by Norcube Auth and listed by
`nrc auth ci-token scopes`: `backup.read`, `backup.write` (run backups
Expand Down Expand Up @@ -801,6 +801,8 @@ changelog, and the owner's decisions in the planning sessions of
| 2026-11-06 | `-o id` prints only the result's id. Deploy scripts capture what they create with `id=$(... -o id)`, and `-o text` prints the state as well, so it would need `cut`. It is a global output value rather than a flag of one command, so it means the same everywhere (P1, P13) | Named in the owner's maintenance windows plan. Rejected: `--query id -o text` as the documented form, which still works but is too long for the one thing every script needs | owner |
| 2026-11-05 | `--auto-post` is the one page setting `create` doesn't require: the flag came after 0.23.0, so requiring it would break scripts that create pages, and the API keeps it off unless asked. `--notify` is sent only when given, and exists only on writes that add an update | Compatibility rule P10; owner's brief | owner |
| 2026-11-15 | `cms validate`: a `cms` group whose first command works on a site checkout, offline, with no sign-in. The checks live in the public `github.com/norcubeplatform/cms-schema` module, which the CMS service and the dashboard's fixtures share, so the CLI is a thin wrapper and cannot drift from the editor. `--fail-on` defaults to `error` (unlike `monitor status`, whose default is `none`) because a validator that exits 0 on errors would be useless in CI; findings keep their severity whatever `--fail-on` says. A failed run uses the new code `invalid`, not `unhealthy`: `unhealthy` describes a service's state, `invalid` what the command checked. The report is printed before the error so CI keeps it. The path argument completes directories only | Owner's brief: validate a whole site against every page, locally and in CI, with the rules the editor runs. Rejected: putting the checks in the CLI module (the private backend would then depend on the CLI's releases and dependency graph); a `--strict` flag (the tree already has `--fail-on` for this); naming the command `cms schema validate` (content and links are checked too) | owner |
| 2026-11-23 | `cms validate --quality` (cms-schema 0.10.0): the content quality checks run only when asked for, as in the module, because their findings are advice rather than breakage; they are warnings and notices, never errors, and notices never fail a run whatever `--fail-on` says. `--strict-quality` fails on quality warnings alone (unlike `--fail-on warning`, which also fails on correctness warnings). `--git` reads when each file last changed from `git log` with a deadline; it needs `--quality`, and a git failure ends the run with its own code (`usage_error` outside a checkout, `timeout`, `error`) instead of silently skipping the outdated-translation check the person asked for. Quality is a flag, not an `--only` value, so `--only` keeps meaning the correctness checks. A finding about one language of a page that holds every language shows the language after its path in the PATH column (`title.en [en]`); `-o json` has it as `locale` | Owner's brief: run the module's quality checks from the CLI, mirroring `cms-schema-validate`. Rejected: a LOCALE column (mostly empty, and placed after MESSAGE in `-o text`); skipping the outdated check when git fails (the person asked for it) | owner |
| 2026-11-25 | `cms validate --git` with cms-schema 0.11.0: an outdated translation is one whose source changed a translatable text since the translation last changed or was marked current, so `--git` hands the module a reader of the source's earlier versions (`gitlog.SourceBases`) instead of file dates. The history is read only when the checks have language versions to judge, under the same deadline; a read failure still ends the run with the same codes, and the deadline or an interrupt decides the code before what git printed (a killed `git rev-parse` reads as "not a repository"). A shallow clone is refused with `usage_error` (cms-schema 0.11.1, `gitlog.ErrShallowHistory`): its oldest commit lists every file as added, so every translation would look current, a silent pass in CI, where `actions/checkout` clones with depth 1 | A date says nothing about what changed: a changed link or a commit in another folder made a translation "outdated". Rejected: reading the history up front to fail early on a site without language versions (twice the git work for a check with nothing to judge) | owner |

---

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/gofrs/flock v0.13.0
github.com/google/uuid v1.6.0
github.com/jmespath-community/go-jmespath v1.1.1
github.com/norcubeplatform/cms-schema v0.1.1
github.com/norcubeplatform/cms-schema v0.11.1
github.com/oapi-codegen/runtime v1.4.0
github.com/pelletier/go-toml/v2 v2.3.1
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELU
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
github.com/norcubeplatform/cms-schema v0.1.1 h1:19HHWyqDrTGG2THK54TvzngCdhUNxWFywsuUrhLzAbU=
github.com/norcubeplatform/cms-schema v0.1.1/go.mod h1:fY05NpvoygKgMBZjj3+R6KI1vko9CSJPJKS02n6WRh0=
github.com/norcubeplatform/cms-schema v0.11.1 h1:GWief9ru4UOTNlEjidKZ3LACcKWRDavJwz66l51gu1I=
github.com/norcubeplatform/cms-schema v0.11.1/go.mod h1:fY05NpvoygKgMBZjj3+R6KI1vko9CSJPJKS02n6WRh0=
github.com/oapi-codegen/runtime v1.4.0 h1:KLOSFOp7UzkbS7Cs1ms6NBEKYr0WmH2wZG0KKbd2er4=
github.com/oapi-codegen/runtime v1.4.0/go.mod h1:5sw5fxCDmnOzKNYmkVNF8d34kyUeejJEY8HNT2WaPec=
github.com/oasdiff/yaml v0.1.1 h1:6nHx+pn9gBRM6YpBlFZFQGCCd1nuvqOBtTD3KKTgGxY=
Expand Down
Loading
Loading