fix: feat: CI log access — disinto ci-logs + dev-agent CI failure context (#136) #137
No reviewers
Labels
No labels
action
backlog
blocked
in-progress
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: johba/disinto#137
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-136"
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?
Fixes #136
Changes
AI Review
Summary
Adds
disinto ci-logsCLI command andci_get_logs()library function that read Woodpecker CI logs directly from its SQLite database — bypassing the API for more reliable failure context. Integrates intopr_walk_to_mergeto inject recent CI log output when invoking the dev-agent on CI failures.The implementation is solid: parameterized SQL queries prevent injection, the volume is mounted read-only, shell argument parsing is correct, and all paths fail gracefully (errors redirected,
|| ci_logs=""guardsset -e).Findings
minor
lib/ci-log-reader.py:23:DEFAULT_DB_PATHis defined but never used —get_db_path()constructs the path fromDEFAULT_WOODPECKER_DATA_DIRindependently. Either use it or remove it.minor
lib/ci-log-reader.py:34:str | Noneunion syntax requires Python 3.10+. If the container image runs Python 3.9, this raises aTypeErrorat import time.Optional[str]fromtypingwould be portable without a runtime cost.minor
lib/ci-log-reader.py:52-80:connis opened but only closed in the happy path. An exception duringcursor.executeorfetchallleaks the connection. Atry/finally conn.close()pattern would fix this. Not a practical issue since the process exits on error, but worth noting.info
lib/pr-lifecycle.sh:421+190: The agent CI failure prompt now includes both_PR_CI_ERROR_LOG(API-sourced viaci-debug.sh, up to 80 lines) and the newlogs_section(SQLite-sourced, up to 50 lines). When both sources succeed they may show overlapping content. This is intentional redundancy (different sources, each can be empty independently) — just be aware the agent may see duplicate log lines in some runs.Verdict
APPROVE — Clean feature: SQLite-direct CI log access with safe queries, defensive error handling, and proper volume isolation
Reviewed at
a2d5d71| AGENTS.mdAI Review: APPROVE — Clean feature: SQLite-direct CI log access with safe queries, defensive error handling, and proper volume isolation