Repository navigation
Allow approval comments to include reasons - #234
Conversation
Keep exact-comment behavior as the default and add an opt-in first-line decision mode for explanatory follow-up text. Assisted-by: OpenAI Codex
|
Hi @CAOShurong Can you please test these changes and produce tests with both possible values for your new variable? |
…asons Signed-off-by: CAOShurong <170531907+CAOShurong@users.noreply.github.com>
Signed-off-by: CAOShurong <170531907+CAOShurong@users.noreply.github.com>
|
Added the requested explicit coverage in The full suite passed 20 repetitions on the byte-verified committed source. The exact-head fork CI also passed the upstream Linux Docker build, tests and v2.10.1 lint (zero issues). No production code was added in this test revision; the merge preserves the current upstream polling fixes. Prepared with OpenAI Codex (AI-generated code/tests/text). The PR description now corrects the earlier unsupported personal-review wording and records the local pinned-lint compatibility failure and untested race/ARM/deployment paths. Fork CI success is not maintainer approval or deployment evidence. |
|
Hi @CAOShurong Apologies for the delay in getting this resolved. Thanks a lot for adding in the test cases, but what I meant was that if you could publish a docker image from your branch to your own ghcr registry, then use that image to run the action and complete the end to end qa process. I am asking for this because the changes touch the core logic of these scripts, and I would like to make sure that multiple scenarios are validated before merging so we dont introduce any regressions. |
|
Built the exact PR revision ( With |
|
Thanks for adding the tests, @CAOShurong, that helps a lot. I have three small comments:
That is the last change,otherwise, the PR looks great!! |
|
Updated in |
|
Great! |
Summary
allow-comment-reasonsinput.Closes #21.
Requested test coverage
This update addresses the request to test both values explicitly. The same 11 parser scenarios each run with
falseandtrue(22 cases), covering reasons, CRLF, exact keywords, later/empty first lines, same-line prose, unauthorized users, and distinct versus duplicate approvers.Four
httptestpolling cases cover approval and denial in both modes. They verify whether the reason-bearing comment completes immediately or waits for an exact keyword, as well as the terminal comment, issue closure and exit code. This revision adds tests only; a normal merge retains the two current upstream polling fixes.Verification for
0d4edbdOn Go 1.26.7 / Windows amd64, including a clean archive byte-matched to commit
0d4edbd3a233d304a3e91230c88e70bc64e872ae:go test -json -count=20 -p=2 ./...: all 76 leaf cases pass in each repetition.go vet -p=2 ./...andgo build -p=2 -buildvcs=false -trimpath ... .: pass.golangci-lint v2.10.1 run -v: zero issues.The fork CI run also passed on exact head
0d4edbd3a233d304a3e91230c88e70bc64e872ae: the unchanged upstream workflow's Linux Docker build, full Go tests (including the explicit false/true cases), and Docker-basedgolangci-lint v2.10.1with zero issues. The completed run, job steps and logs were checked. This is fork execution, not upstream maintainer approval.Limitations: Windows is not a supported Action runner; the local program/API checks are synthetic, not deployed workflow proof. Race, ARM and a real approval/deployment workflow are not tested. The pinned pre-commit lint v1.52.2 panics with
unsupported version: 2on both this revision and the untouched pre-test baseline; the complete configured hook set is not claimed green. Its initial environment-install timeout is also retained. The old August run is not evidence for this revision. No container image or release is published by this update.Final review updates
approval-comment. Comments exceeding 64 KiB are logged with an empty output.1c531d7, including raw multiline output and the oversized-comment fallback.Provenance correction
Prepared with OpenAI Codex: AI-generated code, tests and PR text. The previous sentence suggesting personal review was not substantiated by the available records and has been removed. No personal or independent human review, production adoption, or maintainer acceptance is asserted.