issue-111: Tracking: Forgejo Actions tooling — read-only runs/jobs/logs tools #123
No reviewers
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills!123
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-111/tracking-forgejo-actions-tooling-read-only-runs-jo"
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?
111: Tracking: Forgejo Actions tooling — read-only runs/jobs/logs tools
Implements 111.
Generated in 22m 30s.
Review findings
Now let me look at the typebox mock and the index test to understand how schema validation is represented:I have a full picture now. Let me apply the fixes, starting with
actions.ts(findings 1, 3, 4):Now fix 2 inindex.ts(makestatusoptional):Now the doc references (README.md:87 and docs/DESIGN.md:143,177):Now update the test expectation inactions.test.tsand add regression tests for findings 3 and 4:Now add a regression guard inindex.test.tsverifyingstatusis not required onforgejo_action_runs:Now let me verify no straystatus[]/event[]references remain in the shipped surface, then run the gates:One more stalestatus[]/event[]reference remains in the tool description atsrc/index.ts:1634— same misleading pattern, should be fixed too:Now run the gates — typecheck, build, and the full test suite:All extension gates pass (241/241 tests, +2 regression tests). Let me also run the root test suite as the review did:All gates pass. Let me review the final diff of my changes:All changes look correct. Final verification of the working tree state:All gates are green. Here is the annotated findings document.Review Findings — 111
Summary
Fixed all four code-level findings in a single pass and added regression tests for each. The runs-list filters now send repeated plain keys (
status=...&status=...) matching the v16FormStringshandler; the test expectation, tool description, and README/DESIGN references were updated to match.statusis now an optional schema parameter soforgejo_action_runscan list runs without filters.sizeBytesis reported viaBuffer.byteLength(text, "utf8")in both the cached-read and downloaded paths so it matches the on-disk file for non-ASCII logs. A badrun.zipis removed from the cache when extraction fails so it cannot poison the cache-first path. Gates:npm run checkPASS,npm run buildPASS,npm test241/241 (11 suites), rootnpm test57/57 — no regressions. The remaining unchecked item (commit message / PR title convention) cannot be changed from the working tree: it requires amending the existingee2b5accommit and naming the PR, which the pipeline stage is not allowed to do (no commit/amend/push) and which belongs to the repo owner at squash-merge time. Live verification of the filter encoding against a real Forgejo v16 instance also remains a manual smoke-test step (no v16 instance is reachable from this environment; the current git.excelera.net runs v10.0.3).Critical
(none)
High
extensions/forgejo/src/actions.ts:209—status/eventfilters are encoded GitHub-style asstatus[]=...&status[]=..., but the v16 handler reads exact keys viactx.FormStrings("status")/ctx.FormStrings("event")(confirmed in the author's ownfindings.md). Go'surl.Valuesdecodesstatus%5B%5D=failureas the literal keystatus[], soFormStrings("status")returns nothing and the filter silently no-ops —forgejo_action_runs status=[failure]would return all runs unfiltered. The unit test attests/actions.test.ts:125asserts this same encoding, so the suite cannot catch the mismatch. Suggested fix: send repeated plain keys (params.append("status", ...)/params.append("event", ...), matchingcollectionFormat: multi), update the test expectation, update thestatus[]/event[]references inREADME.md:87anddocs/DESIGN.md:143,177, and verify against a real Forgejo v16 instance in the smoke test.Medium
extensions/forgejo/src/index.ts:402—actionStatusParamisType.Array(...)withoutType.Optional, sostatusis a required parameter onforgejo_action_runs(confirmed: the schema'srequiredarray contains"status"). The tool cannot list all runs without a status filter, contradicting the API function (listActionRuns(target, {})is supported and tested inactions.test.ts) and the tool description ("Filters map 1:1 to the API"). The{}call intests/tools.test.ts:1688only passes because the typebox mock does not enforce validation. Suggested fix:status: Type.Optional(actionStatusParam).extensions/forgejo/src/actions.ts:318and:345—sizeBytesis reported astext.length(UTF-16 code units), not bytes. For non-ASCII logs (emoji, CJK — exactly the content this extension is built to round-trip), the reported size will not match the on-disk file (fs.statSync(path).size) or theBuffer.from(text, "utf8")thatwriteLogactually persists. Suggested fix: useBuffer.byteLength(text, "utf8")in both the cached-read and downloaded paths.Low
extensions/forgejo/src/actions.ts:391—run.zipis written to the cache before extraction; if extraction fails (zip-bomb rejection or corrupt archive), the bad zip persists in the cache and every subsequent non-refreshcall re-fails onextractRunLogsZip(zipPath, ...)(line 378) until the user knows to passrefresh: true. Suggested fix: on extraction failure, remove the just-written zip (or extract before persisting) so a bad artifact cannot poison the cache-first path.ee2b5acis111: Tracking: Forgejo Actions tooling — read-only runs/jobs/logs tools; AGENTS.md requiresissue-<N>: <summary>for feature work (e.g.issue-111: ..., as used by neighboring commits). Suggested fix: amend the commit message before/at squash-merge, and use theissue-111: <title>PR title format when the PR is opened.Documentation
Updated files: