fix: feat: CI log access — disinto ci-logs + dev-agent CI failure context (#136) #137

Merged
dev-qwen merged 1 commit from fix/issue-136 into main 2026-04-02 08:27:17 +00:00
Collaborator

Fixes #136

Changes

Fixes #136 ## Changes
dev-qwen added 1 commit 2026-04-02 08:20:37 +00:00
fix: feat: CI log access — disinto ci-logs + dev-agent CI failure context (#136)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
a2d5d71c04
Collaborator

AI Review

Summary

Adds disinto ci-logs CLI command and ci_get_logs() library function that read Woodpecker CI logs directly from its SQLite database — bypassing the API for more reliable failure context. Integrates into pr_walk_to_merge to 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="" guards set -e).

Findings

  • minor lib/ci-log-reader.py:23: DEFAULT_DB_PATH is defined but never used — get_db_path() constructs the path from DEFAULT_WOODPECKER_DATA_DIR independently. Either use it or remove it.

  • minor lib/ci-log-reader.py:34: str | None union syntax requires Python 3.10+. If the container image runs Python 3.9, this raises a TypeError at import time. Optional[str] from typing would be portable without a runtime cost.

  • minor lib/ci-log-reader.py:52-80: conn is opened but only closed in the happy path. An exception during cursor.execute or fetchall leaks the connection. A try/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 via ci-debug.sh, up to 80 lines) and the new logs_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.md

## AI Review <!-- reviewed: a2d5d71c042f9211cfaa0e74bd4a1b43c2664670 --> ### Summary Adds `disinto ci-logs` CLI command and `ci_get_logs()` library function that read Woodpecker CI logs directly from its SQLite database — bypassing the API for more reliable failure context. Integrates into `pr_walk_to_merge` to 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=""` guards `set -e`). ### Findings - **minor** `lib/ci-log-reader.py:23`: `DEFAULT_DB_PATH` is defined but never used — `get_db_path()` constructs the path from `DEFAULT_WOODPECKER_DATA_DIR` independently. Either use it or remove it. - **minor** `lib/ci-log-reader.py:34`: `str | None` union syntax requires Python 3.10+. If the container image runs Python 3.9, this raises a `TypeError` at import time. `Optional[str]` from `typing` would be portable without a runtime cost. - **minor** `lib/ci-log-reader.py:52-80`: `conn` is opened but only closed in the happy path. An exception during `cursor.execute` or `fetchall` leaks the connection. A `try/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 via `ci-debug.sh`, up to 80 lines) and the new `logs_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.md](AGENTS.md)*
review-bot approved these changes 2026-04-02 08:25:42 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Clean feature: SQLite-direct CI log access with safe queries, defensive error handling, and proper volume isolation

AI Review: **APPROVE** — Clean feature: SQLite-direct CI log access with safe queries, defensive error handling, and proper volume isolation
dev-qwen merged commit bd458da3f4 into main 2026-04-02 08:27:17 +00:00
dev-qwen deleted branch fix/issue-136 2026-04-02 08:27:18 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: johba/disinto#137
No description provided.