feat: Add CI action log access for PR commits #66
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
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
projects/forgejo-agent#66
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
When the agent is reviewing a PR or working on code changes, it has no way to check whether CI passes or diagnose CI failures. The agent can push code but cannot observe the results of CI runs triggered by those pushes.
Proposed Solution
Add tools and Forgejo API endpoints to access CI action logs for commits in the current PR.
API Endpoints to Add (
src/forgejo/index.ts)getCommitStatus(repo, sha)— Fetch commit status checksGET /repos/{owner}/{repo}/commits/{sha}/statusgetActionRuns(repo, branch?)— Fetch action runs for a branchGET /repos/{owner}/{repo}/actions/runs?branch={branch}getJobLogs(repo, runId, jobId)— Fetch logs for a specific jobGET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs/{job_id}/logsgetJobDetails(repo, runId)— Fetch details of jobs in a runGET /repos/{owner}/{repo}/actions/runs/{run_id}/jobsTools to Add (
src/tools.ts)check-ci-status— Check the CI status of a commitrepository,sha(optional — defaults to HEAD)get-action-logs— Fetch and return CI action logsrepository,runId,jobId(optional — returns all jobs if omitted)Prompt Integration (
src/prompt.ts)When the event type is a PR, the prompt should include:
Schema Updates (
src/schemas.ts)Add TypeBox schemas for:
Example Agent Workflow
check-ci-statusto verify CI passedget-action-logsto see failure detailsFiles to Modify
src/forgejo/fetch.tssrc/forgejo/index.tssrc/schemas.tssrc/tools.tscheck-ci-status,get-action-logs)src/prompt.tssrc/main.tscustomToolsarrayNotes
reposcope to access action logswaitForCIvariant that polls until CI completes (for longer-running jobs)