Files
agentrunner/youtrack-comment-librarian
CI System 5903b69b2d Initial commit: ClearGrow Agent Runner
Automated task orchestration system for YouTrack + Gitea + Woodpecker CI:

- runner.py: Main orchestration engine with state machine workflow
- agent.py: Claude Code subprocess pool management
- youtrack_client.py: YouTrack API wrapper
- gitea_client.py: Gitea API + git CLI operations
- woodpecker_client.py: CI build monitoring
- webhook_server.py: Real-time event handling
- prompts/: Agent prompt templates (developer, qa, librarian)

Workflow: Ready → In Progress → Build → Verify → Document → Review → Done

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 21:05:31 -07:00

36 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# YouTrack comment helper for Librarian (documentation) agent
# Usage: youtrack-comment-librarian <issue-id> <comment-text>
set -e
ISSUE_ID="$1"
COMMENT_TEXT="$2"
if [ -z "$ISSUE_ID" ] || [ -z "$COMMENT_TEXT" ]; then
echo "Usage: youtrack-comment-librarian <issue-id> <comment-text>" >&2
exit 1
fi
YOUTRACK_URL="https://track.cleargrow.io"
YOUTRACK_TOKEN="perm:bGlicmFyaWFu.NDQtMw==.NWUhRcAvfABYNV1GX10Tv7nmj36fj4"
JSON_PAYLOAD=$(jq -n --arg text "$COMMENT_TEXT" '{"text": $text}')
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
-H "Authorization: Bearer $YOUTRACK_TOKEN" \
-H "Content-Type: application/json" \
-d "$JSON_PAYLOAD" \
"${YOUTRACK_URL}/api/issues/${ISSUE_ID}/comments")
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
BODY=$(echo "$RESPONSE" | sed '$d')
if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then
echo "Comment added to $ISSUE_ID (as Librarian Agent)"
else
echo "Error adding comment to $ISSUE_ID: HTTP $HTTP_CODE" >&2
echo "$BODY" >&2
exit 1
fi