Add Vale content linting for release post items
Closes #7139 (closed)
Summary
Implements Vale content linting for release post name and description fields, using the gitlab_base rules from gitlab-org/gitlab. This addresses the problem described in #7139 (closed) where typos, URL issues, and stylistic inconsistencies slip through the release post process due to the volume of content.
How it works
- A shell script (
scripts/lint-release-post-content.sh) runs in CI on merge requests when.ymlfiles underdata/release_posts/are changed. It can also be run locally or via a lefthook pre-push hook. - The
gitlab_baseVale rules (includingspelling-exceptions.txt) and thevale-json.tmplcode quality template are committed directly in the repo under.vale/styles/gitlab_base/and.vale/, sourced fromgitlab-org/gitlab. To update the rules, copy the latest files from that repository. - It uses
git diffto identify only the changed (non-deleted) YAML files in the MR, excluding files without afeatureskey (e.g.,mvp.yml,upgrade*.yml). In CI it usesCI_MERGE_REQUEST_*variables; locally it usesgit merge-base origin/master HEAD(following thelint-doc.sh/lefthook.ymlpattern fromgitlab-org/gitlab). - Vale lints the YAML files directly using a Vale View (
ReleasePostItem) that extracts thenameanddescriptionfields via the dasel engine - If Vale is not installed locally, the script falls back to running Vale via a container runtime (docker or nerdctl)
Scoping
-
Only
nameanddescriptionfields are linted (not URLs, reporter names, stage names, etc.) - Only changed files are linted (historical posts are not retroactively checked)
-
In CI, only triggers on
.ymlfile changes underdata/release_posts/in MR pipelines -
Locally, compares against
origin/masteror accepts specific files as arguments - No other content in the repository is evaluated by Vale
-
Non-feature files (
mvp.yml,upgrade*.yml) are excluded from linting
Files added
-
.vale.ini— Vale configuration, targeting YAML files via theReleasePostItemView -
.vale/styles/config/views/ReleasePostItem.yml— Vale View definition (dasel engine) to extractnameanddescriptionfields -
.vale/styles/gitlab_base/— Vale rules committed locally fromgitlab-org/gitlab -
.vale/vale-json.tmpl— Code quality report template fromgitlab-org/gitlab -
scripts/lint-release-post-content.sh— Lint script that works in CI, locally, and via lefthook (with container fallback)
Files changed
-
.gitignore— Uses universal**/.DS_Storepattern -
.gitlab-ci.yml— Newlint release-post-content valeCI job -
lefthook.yml— Newvalepre-push hook for local linting -
FILES— Updated to include.valeand.vale.ini
Validation
The script can be tested in CI, locally, and via lefthook.
CI test: correctly failed with vale errors: https://gitlab.com/gitlab-com/www-gitlab-com/-/jobs/13268993938#L101
Testing locally
The script handles setup automatically. Run it directly:
# Lint changed files on your branch (compares against origin/master)
scripts/lint-release-post-content.sh
# Lint specific files
scripts/lint-release-post-content.sh data/release_posts/18_9/some-file.yml
# Lint an entire release directory
scripts/lint-release-post-content.sh data/release_posts/18_9/*.yml
The lefthook pre-push hook also runs automatically on git push for any changed release post YAML files.
Note: target specific directories or files rather than the entire data/release_posts/ directory, as files without a features key will cause the View to error.
Local test example results
vale --minAlertLevel warning data/release_posts/18_9
data/release_posts/18_9/01-ai-powered-selfhosted-duo-agent-platform-cloud-ga.yml
1:207 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
22:46 warning Use 'GitLab Duo' instead of gitlab_base.SubstitutionWarning
'Duo'.
data/release_posts/18_9/04-verify-read-inputs-from-a-file.yml
3:358 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
19:59 warning Use 'in' instead of 'within'. gitlab_base.SubstitutionWarning
data/release_posts/18_9/03-create-repository-file-tree-navigation.yml
23:27 warning Check the spelling of gitlab_base.Spelling
'resizable'. If the spelling
is correct, ask a Technical
Writer to add this word to the
spelling exception list.
data/release_posts/18_9/07-security-risk-management-vulnerabilities-by-age-chart.yml
1:123 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
3:249 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
21:91 warning Use 'because' or 'after' gitlab_base.SubstitutionWarning
instead of 'since'.
data/release_posts/18_9/application-security-testing-ds-analyzer-java-maven-support--manif.yml
1:193 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
2:99 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
3:186 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
data/release_posts/18_9/application-security-testing-ds-analyzer-python-support--manifest-.yml
1:204 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
2:88 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
3:194 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
4:114 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
data/release_posts/18_9/create-disable-personal-snippets-enterprise-users.yml
1:94 warning Remove whitespace characters gitlab_base.EOLWhitespace
from the end of the line.
data/release_posts/18_9/growth-ultimate-with-dap-trial.yml
19:184 warning Use 'GitLab Duo' instead of gitlab_base.SubstitutionWarning
'Duo'.
data/release_posts/18_9/06-package_docker_virtual_registry_beta.yml
22:38 warning Remove 'currently'. The gitlab_base.CurrentStatus
documentation reflects the
current state of the product.
data/release_posts/18_9/jetbrains-oauth-self-managed-dedicated.yml
4:48 warning The offerings are 'GitLab gitlab_base.Offerings
Self-Managed' and 'GitLab
Dedicated', with that exact
capitalization.
data/release_posts/18_9/helm-chart-ZDU.yml
25:70 warning The offerings are 'GitLab gitlab_base.Offerings
Self-Managed' and 'GitLab
Dedicated', with that exact
capitalization.
data/release_posts/18_9/runtime-feature-flag-rollout-of-archive-group.yml
29:160 warning Remove 'simple'. Be precise gitlab_base.Simplicity
instead of subjective.
data/release_posts/18_9/security-platform-management-profiles.yml
38:33 warning Remove 'Easily'. Be precise gitlab_base.Simplicity
instead of subjective.
data/release_posts/18_9/valkey-optionally-available.yml
4:12 warning Check the spelling of gitlab_base.Spelling
'Valkey'. If the spelling
is correct, ask a Technical
Writer to add this word to the
spelling exception list.
19:27 warning Check the spelling of gitlab_base.Spelling
'Valkey'. If the spelling
is correct, ask a Technical
Writer to add this word to the
spelling exception list.
21:66 warning Check the spelling of gitlab_base.Spelling
'Valkey'. If the spelling
is correct, ask a Technical
Writer to add this word to the
spelling exception list.
25:30 warning Check the spelling of gitlab_base.Spelling
'Valkey'. If the spelling
is correct, ask a Technical
Writer to add this word to the
spelling exception list.
25:110 warning Check the spelling of gitlab_base.Spelling
'Valkey'. If the spelling
is correct, ask a Technical
Writer to add this word to the
spelling exception list.
25:138 warning Check the spelling of gitlab_base.Spelling
'Valkey'. If the spelling
is correct, ask a Technical
Writer to add this word to the
spelling exception list.
27:26 warning Check the spelling of gitlab_base.Spelling
'Valkey'. If the spelling
is correct, ask a Technical
Writer to add this word to the
spelling exception list.
31:69 warning Check the spelling of gitlab_base.Spelling
'Valkey'. If the spelling
is correct, ask a Technical
Writer to add this word to the
spelling exception list.
data/release_posts/18_9/verify-show-security-reports-from-a-child-pipeline-in-a-mr.yml
19:104 warning Use a comma before the last gitlab_base.OxfordComma
'and' or 'or' in a list of
four or more items.
19:105 warning Use a comma before the last gitlab_base.OxfordComma
'and' or 'or' in a list of
four or more items.
✖ 0 errors, 32 warnings and 0 suggestions in 26 files.