ci: Add the no-context comments check #45
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
blocked
draft
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
s1d3sw1ped/jiggablend!45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ash/comments-check-37"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 tocheck-comments.pythere (compared with the checker's owncode_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 fromcomments.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 HEADpasses on this branch against develop249cf62; existing comments are ignored.// explain thistointernal/runner/runner.go:87fails and names the file and line.comments: no-context passcommit that only adds a comment passes; one that also addsvar _ = 1fails.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
GO from me on
cd0c125.scripts/check-comments.pyhas the same code as forge-standardscheck-comments.pyat bfd015a. I checked with the checker's owncode_only, and the only comment left in the copy is the shebang, so this commit adds no comments of its own..forgejo/workflows/comments.ymlmatches the adoption snippet incomments.md. It runs onpull_requestonly, withcontents: read, no secrets and noworkflow_dispatch.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 security review: APPROVE on head
cd0c125030(base develop249cf62466).The diff adds two new files and changes nothing else.
.forgejo/workflows/comments.ymlmatches the approved forge-standards#8 snippet:permissions: contents: readand uses no secrets.actions/checkout@v4with fetch-depth 0.github.base_refreaches the shell only throughenv: BASE_REFand is quoted ("$BASE_REF"). Nothing is interpolated intorun:directly.Compared with forge-standards bfd015a, the only differences are:
scripts/check-comments.py;test_check_comments.pystep 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 bfd015acheck-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.Actions runs for the comments check:
cd0c125)f78a8f0adds// explain thisatinternal/runner/runner.go:87, and the same commit fails locally withcoder commit adds a comment)