docs / enforce
Enforce: what it blocks, and what it doesn't
enforce is the stricter of the two modes. In assist, the extension tells you a comment breaks the convention and lets you send it anyway. In enforce, it holds the comment back until it is fixed. That is a guard on sending, in the browser of whoever has the extension installed. It is not a condition on merging, and it was never meant to be one.
When a comment is blocked
Writing "mode": "enforce" is not enough on its own. Two conditions must hold together at the moment you send:
- 1The effective mode is
enforceThe mode is resolved from the three configuration levels — the enterprise floor, the organization's document, the repository's file. It is never assumed locally. - 2The configuration was actually readIf the extension could not reach the configuration, it does not refuse anything: nobody is blocked in the name of a rule that could not be read. A repository that simply has no configuration file is not in that case.
If the configuration could not be read, the extension behaves as it does in assist: it shows its diagnostics and lets the comment through. If the effective mode is assist, it does the same. If the effective mode is off, it does nothing at all — no diagnostics, no blocking. Nothing else enters the decision — neither the age of the pull request, nor any state published on it.
When both hold, a comment with an error cannot be sent. The send button looks disabled and stays reachable with the keyboard, so that the reason is announced to a screen reader: Sending blocked: the comment is not compliant, followed by what is wrong. Warnings never block; they are advice.
| What you do | In enforce |
|---|---|
| Click the send button with a non-compliant comment | Blocked |
| Publish from the keyboard — Ctrl+Enter (or ⌘+Enter) in the field, for example | Blocked |
| Send a comment that only raises warnings | Sent |
| Approve a pull request without writing anything | Sent |
Send a slash command such as /rebase, with "/*" in toolCommands | Sent |
Reply in a thread, while validateReplies is left off | Sent |
Two details behind that table. toolCommands is empty by default: until a repository adds "/*", a bare /rebase is a non-compliant comment like any other. A slash command cannot be exempted on its own — an entry such as "/rebase" is ignored, with a configuration notice; "/*" exempts them all. Bots are exempted one by one, by their exact handle: "@dependabot". And a reply that starts with decision: is always checked, whatever validateReplies says. Both settings are described under configuration.
It re-reads the configuration before blocking
The extension keeps the configuration in a cache — for an hour by default — and has no way to learn that a remote file changed in the meantime. A block decided on that cache could hold back a comment in a repository that went back to assist ten minutes ago.
So before it blocks anything, the extension reads the repository's and the organization's configuration again, bypassing its cache. If the fresh configuration no longer justifies the block, it releases the button and says so:
Configuration re-read: this comment is no longer blocked. Send it again.
It does not send the comment for you: you click again. The practical consequence is for whoever runs a rollout: stepping back from enforce takes effect at the next send attempt, without waiting for anyone's cache to expire.
Relaxing the organization's document does not reach everything. A repository that writes "mode": "enforce" in its own file keeps it, and so does an enterprise floor that requires it. The rollback order is on the adoption page.
There is no “send anyway” button
That is deliberate. An extension can be switched off in two clicks, so a bypass button would add no real control: only a ceremony, and the impression of a safeguard where there is none. The guard exists to catch the slip — the comment sent without its label — which is the common case. It has never claimed to stop someone determined.
What enforce does not do
It does not cover every way to comment
A comment posted through the platform's API, a command-line tool, an IDE, another browser or a machine without the extension is not checked by anything. No special permission is needed to get around the guard: it is enough not to have it.
It never blocks a merge
The banner at the top of a pull request counts its unresolved blocking threads and lists them. It informs. The extension publishes no status on the pull request and leaves the merge button alone, in every mode.
It never blocks on GitLab
The extension cannot read a repository's configuration on GitLab yet. The second condition above is therefore never met there: merge requests get the toolbar, the live validation, the badges and the banner, and every comment goes through.
If you want merges to wait for resolved threads
That is your platform's job, and it does it with its own settings — requiring that conversations be resolved before a pull request can be merged, for example. Such a rule holds for everyone, with or without the extension, which is exactly what a browser extension cannot promise.
The two fit together. The convention says which threads are blocking, and the extension keeps them visible; the platform decides whether an unresolved thread holds the merge.
Turning it on
One setting, at whichever level you manage: the repository's file for a pilot, the organization's document for everyone.
{ "version": 1, "mode": "enforce" }
Before 1.0.0-rc.1, enforce only blocked pull requests created after an activation date that was not set by default, so most installations in enforce never blocked anything. That condition is gone. A repository that already writes "mode": "enforce" blocks non-compliant comments on every pull request as soon as its reviewers update the extension.
The adoption page describes the path that leads here — assist everywhere, enforce on a pilot repository, then the rollout — and what to prepare before the switch. Configuration explains where mode is read from and which level wins.