ci: Add the no-context comments check #45

Merged
linus merged 1 commit from ash/comments-check-37 into develop 2026-11-02 19:52:50 +00:00
Collaborator

Rolls the forge comments rule (forge-standards comments.md) out to jiggablend.

  • scripts/check-comments.py: copied from forge-standards master (bfd015a). The code is identical to check-comments.py there (compared with the checker's own code_only); its commenter-pass comments are left out so this coder commit adds none, same as LewdZ b2ebc04. jiggablend gets its own commenter pass.
  • .forgejo/workflows/comments.yml: the adoption snippet from comments.md, byte for byte (permissions: contents: read, fetch-depth: 0, base ref via env).

Tested locally on the jumpbox:

  • python3 scripts/check-comments.py origin/develop HEAD passes on this branch against develop 249cf62; existing comments are ignored.
  • A coder commit adding // explain this to internal/runner/runner.go:87 fails and names the file and line.
  • A coder commit adding only an upstream URL comment and an SPDX line passes.
  • A comments: no-context pass commit that only adds a comment passes; one that also adds var _ = 1 fails.

Red and green Actions runs get linked in a comment below.

Risk: CI only; a false positive blocks a PR until the checker is fixed. Rollback: git revert.

Closes #37

Rolls the forge comments rule (forge-standards `comments.md`) out to jiggablend. - `scripts/check-comments.py`: copied from forge-standards master (bfd015a). The code is identical to `check-comments.py` there (compared with the checker's own `code_only`); its commenter-pass comments are left out so this coder commit adds none, same as LewdZ b2ebc04. jiggablend gets its own commenter pass. - `.forgejo/workflows/comments.yml`: the adoption snippet from `comments.md`, byte for byte (`permissions: contents: read`, `fetch-depth: 0`, base ref via env). Tested locally on the jumpbox: - `python3 scripts/check-comments.py origin/develop HEAD` passes on this branch against develop 249cf62; existing comments are ignored. - A coder commit adding `// explain this` to `internal/runner/runner.go:87` fails and names the file and line. - A coder commit adding only an upstream URL comment and an SPDX line passes. - A `comments: no-context pass` commit that only adds a comment passes; one that also adds `var _ = 1` fails. Red and green Actions runs get linked in a comment below. Risk: CI only; a false positive blocks a PR until the checker is fixed. Rollback: `git revert`. Closes #37
ci: Add the no-context comments check
All checks were successful
Comments / comments (pull_request) Successful in 6s
CI / check-and-test (pull_request) Successful in 58s
cd0c125030
Copy check-comments.py and the comments workflow from forge-standards
master (bfd015a), following the adoption snippet in comments.md. The
checker code is identical to the forge-standards copy; its commenter-pass
comments are left out so this coder commit adds none, and jiggablend gets
its own pass.
ash requested reviews from eva, blake 2026-11-02 19:48:19 +00:00
eva approved these changes 2026-11-02 19:50:41 +00:00
eva left a comment

GO from me on cd0c125.

  • scripts/check-comments.py has the same code as forge-standards check-comments.py at bfd015a. I checked with the checker's own code_only, and the only comment left in the copy is the shebang, so this commit adds no comments of its own.
  • .forgejo/workflows/comments.yml matches the adoption snippet in comments.md. It runs on pull_request only, with contents: read, no secrets and no workflow_dispatch.
  • The head sits on the current develop tip (249cf62), and both Comments and CI are green on it.

This touches CI, so Blake is on it as a reviewer. Linus can merge once Blake gives his GO.

GO from me on cd0c125. - `scripts/check-comments.py` has the same code as forge-standards `check-comments.py` at bfd015a. I checked with the checker's own `code_only`, and the only comment left in the copy is the shebang, so this commit adds no comments of its own. - `.forgejo/workflows/comments.yml` matches the adoption snippet in `comments.md`. It runs on `pull_request` only, with `contents: read`, no secrets and no `workflow_dispatch`. - The head sits on the current develop tip (249cf62), and both Comments and CI are green on it. This touches CI, so Blake is on it as a reviewer. Linus can merge once Blake gives his GO.
blake approved these changes 2026-11-02 19:52:18 +00:00
blake left a comment

Blake security review: APPROVE on head cd0c125030 (base develop 249cf62466).

The diff adds two new files and changes nothing else.

  • .forgejo/workflows/comments.yml matches the approved forge-standards#8 snippet:

    • The only trigger is pull_request (opened, synchronize, reopened).
    • The job has permissions: contents: read and uses no secrets.
    • Checkout is actions/checkout@v4 with fetch-depth 0.
    • github.base_ref reaches the shell only through env: BASE_REF and is quoted ("$BASE_REF"). Nothing is interpolated into run: directly.

    Compared with forge-standards bfd015a, the only differences are:

    • two comment lines removed;
    • the checker path is scripts/check-comments.py;
    • the standard's test_check_comments.py step is left out, which is fine because that test lives in the standards repo.
  • scripts/check-comments.py (mode 755): this file is not byte-identical to forge-standards bfd015a check-comments.py. The PR file's sha256 is d1090b66…0e76bb and the standard's is 757a780c…0262c7. With comment lines stripped from both, the code is identical. The only change is 30 removed comment lines (307 → 277), the same pattern I approved in LewdZ#153 (review 1070). It has no security impact. If the goal is a verbatim copy that a sha256 check can track for drift, copy the file byte for byte.

Blake security review: APPROVE on head cd0c125030 (base develop 249cf62466). The diff adds two new files and changes nothing else. - `.forgejo/workflows/comments.yml` matches the approved forge-standards#8 snippet: - The only trigger is pull_request (opened, synchronize, reopened). - The job has `permissions: contents: read` and uses no secrets. - Checkout is `actions/checkout@v4` with fetch-depth 0. - `github.base_ref` reaches the shell only through `env: BASE_REF` and is quoted ("$BASE_REF"). Nothing is interpolated into `run:` directly. Compared with forge-standards bfd015a, the only differences are: - two comment lines removed; - the checker path is `scripts/check-comments.py`; - the standard's `test_check_comments.py` step is left out, which is fine because that test lives in the standards repo. - `scripts/check-comments.py` (mode 755): this file is **not byte-identical** to forge-standards bfd015a `check-comments.py`. The PR file's sha256 is d1090b66…0e76bb and the standard's is 757a780c…0262c7. With comment lines stripped from both, the code is identical. The only change is 30 removed comment lines (307 → 277), the same pattern I approved in LewdZ#153 (review 1070). It has no security impact. If the goal is a verbatim copy that a sha256 check can track for drift, copy the file byte for byte.
linus merged commit d2f7276ca8 into develop 2026-11-02 19:52:50 +00:00
linus deleted branch ash/comments-check-37 2026-11-02 19:52:50 +00:00
Author
Collaborator

Actions runs for the comments check:

Actions runs for the comments check: - green: https://git.s1d3sw1ped.com/s1d3sw1ped/jiggablend/actions/runs/70 (this head, cd0c125) - red: https://git.s1d3sw1ped.com/s1d3sw1ped/jiggablend/actions/runs/72 (throwaway #46, closed unmerged; its coder commit f78a8f0 adds `// explain this` at `internal/runner/runner.go:87`, and the same commit fails locally with `coder commit adds a comment`)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
s1d3sw1ped/jiggablend!45
No description provided.