Fixes three defects that the trial of the English-comments check found on the instance (MIL-013 task 8, #204). The trial ran on the throwaway pull request 213 (closed, not merged).
The defects
A Danish line next to an English one was missed. The check joined the lines of a block and judged the mixed text, which counted as English. Run 433 at @main flagged only the Malay comment that stood alone.
No comment was written on the pull request. In a called workflow gitea.event_name is workflow_call, not pull_request, so the step "Tell the author" was skipped (seen in a debug workflow: event_name=workflow_call number=213 author=Tirsvad base_ref=main). The step now asks for gitea.event.pull_request.number != '', which was shown to hold.
The link in the comment pointed at the wrong run. It used the run number (440); the address of a run on the instance holds the run id (2485).
The changes
A block of several consecutive comment lines is judged line by line first (at least four words, probability 0.7), then as a whole when no line is flagged. A single comment line is judged once, as before. The stricter line values come from the 464 comment lines of this repository: lines at 0.6 and three words gave three false positives in real code, at 0.7 and four words none.
The condition of the author step and the run link, each with a test that reads the workflow.
The guide, the wiki pages (English, Danish, Bahasa Malaysia) and ADR-0012 describe the line-by-line judgement.
678 tests pass; coverage of tools/ 98 %.
What the trial showed on the instance (calling this branch)
The check found the Danish (da 1.0) and the Malay (id 0.66) comments and skipped the one marked english-comments: ignore; the run failed.
The Actions bot wrote one comment that mentions the author (@Tirsvad) with the findings.
A re-run with a changed Danish comment updated that comment (same id, still one comment).
With both comments rewritten the run passed, the failing step was skipped and the comment was marked resolved, without a mention.
No credential appears in the logs of the four english-comments jobs: REPORT_TOKEN is shown as ***, the clone header as AUTHORIZATION: basic ***, and a search for token <chars>, basic <base64> and bearer found nothing else.
Not shown: a pull request from a fork (read-only token), a custom REPORT_TOKEN secret, and the check as a required status (task 9).
Commits carry Task: MIL-013#4, #5 and #10 trailers. Not merged by the author.
Fixes three defects that the trial of the English-comments check found on the instance (MIL-013 task 8, #204). The trial ran on the throwaway pull request 213 (closed, not merged).
## The defects
1. **A Danish line next to an English one was missed.** The check joined the lines of a block and judged the mixed text, which counted as English. Run 433 at `@main` flagged only the Malay comment that stood alone.
2. **No comment was written on the pull request.** In a called workflow `gitea.event_name` is `workflow_call`, not `pull_request`, so the step "Tell the author" was skipped (seen in a debug workflow: `event_name=workflow_call number=213 author=Tirsvad base_ref=main`). The step now asks for `gitea.event.pull_request.number != ''`, which was shown to hold.
3. **The link in the comment pointed at the wrong run.** It used the run number (440); the address of a run on the instance holds the run id (2485).
## The changes
- A block of several consecutive comment lines is judged line by line first (at least four words, probability 0.7), then as a whole when no line is flagged. A single comment line is judged once, as before. The stricter line values come from the 464 comment lines of this repository: lines at 0.6 and three words gave three false positives in real code, at 0.7 and four words none.
- The condition of the author step and the run link, each with a test that reads the workflow.
- The guide, the wiki pages (English, Danish, Bahasa Malaysia) and ADR-0012 describe the line-by-line judgement.
678 tests pass; coverage of `tools/` 98 %.
## What the trial showed on the instance (calling this branch)
- The check found the Danish (da 1.0) and the Malay (id 0.66) comments and skipped the one marked `english-comments: ignore`; the run failed.
- The Actions bot wrote **one** comment that mentions the author (`@Tirsvad`) with the findings.
- A re-run with a changed Danish comment **updated** that comment (same id, still one comment).
- With both comments rewritten the run passed, the failing step was skipped and the comment was marked resolved, without a mention.
- No credential appears in the logs of the four `english-comments` jobs: `REPORT_TOKEN` is shown as `***`, the clone header as `AUTHORIZATION: basic ***`, and a search for `token <chars>`, `basic <base64>` and `bearer` found nothing else.
Not shown: a pull request from a fork (read-only token), a custom `REPORT_TOKEN` secret, and the check as a required status (task 9).
## Issues
No issue closed.
Refs #200
Refs #201
Refs #204
Commits carry `Task: MIL-013#4`, `#5` and `#10` trailers. Not merged by the author.
The trial of the English-comments check found that a Danish comment line next
to an English one was missed: the joined block counted as English. A block of
several lines is now judged line by line first (at least four words and a
probability of 0.7), and as a whole when no line is flagged. Found and fixed
while preparing MIL-013 task 8; the guide, the wiki and ADR-0012 say so.
Refs #200
Refs #204
Task: MIL-013#4
Task: MIL-013#10
The trial on the instance showed that gitea.event_name is workflow_call inside
a called workflow, so the step that comments on the pull request was skipped.
The pull request number, its author and the base ref are available there, and
the step now runs when the number is set.
Refs #201
Refs #204
Task: MIL-013#5
The trial showed that the web address of a run on the instance holds the id of
the run, not its number, so the link in the comment pointed to another run.
Refs #201
Refs #204
Task: MIL-013#5
Tirsvad
changed title from Judge each line of a comment block, then the block (English-comments check) to Fix three defects of the English-comments check found in the trial (task 8)2026-10-21 04:36:53 +02:00
Tirsvad
merged commit a772088730 into main2026-10-21 05:47:53 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes three defects that the trial of the English-comments check found on the instance (MIL-013 task 8, #204). The trial ran on the throwaway pull request 213 (closed, not merged).
The defects
@mainflagged only the Malay comment that stood alone.gitea.event_nameisworkflow_call, notpull_request, so the step "Tell the author" was skipped (seen in a debug workflow:event_name=workflow_call number=213 author=Tirsvad base_ref=main). The step now asks forgitea.event.pull_request.number != '', which was shown to hold.The changes
678 tests pass; coverage of
tools/98 %.What the trial showed on the instance (calling this branch)
english-comments: ignore; the run failed.@Tirsvad) with the findings.english-commentsjobs:REPORT_TOKENis shown as***, the clone header asAUTHORIZATION: basic ***, and a search fortoken <chars>,basic <base64>andbearerfound nothing else.Not shown: a pull request from a fork (read-only token), a custom
REPORT_TOKENsecret, and the check as a required status (task 9).Issues
No issue closed.
Refs #200
Refs #201
Refs #204
Commits carry
Task: MIL-013#4,#5and#10trailers. Not merged by the author.Judge each line of a comment block, then the block (English-comments check)to Fix three defects of the English-comments check found in the trial (task 8)