From 56ea22733cb11182a1465acaae9232f6c56c3a1d Mon Sep 17 00:00:00 2001 From: "halil.donmezbilek" Date: Tue, 25 Aug 2026 11:10:10 +0300 Subject: [PATCH] feat: add IVE review/ask/knowledge-graph templates and bot identity fixes --- .gitea/workflows/knowledge-graph-template.yml | 46 +++++++++++++++++ .gitea/workflows/pr-ask-template.yml | 49 +++++++++++++++++++ .gitea/workflows/pr-review-template.yml | 44 +++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 .gitea/workflows/knowledge-graph-template.yml create mode 100644 .gitea/workflows/pr-ask-template.yml create mode 100644 .gitea/workflows/pr-review-template.yml diff --git a/.gitea/workflows/knowledge-graph-template.yml b/.gitea/workflows/knowledge-graph-template.yml new file mode 100644 index 0000000..9817132 --- /dev/null +++ b/.gitea/workflows/knowledge-graph-template.yml @@ -0,0 +1,46 @@ +name: Knowledge Graph (Template) + +on: + workflow_call: + +jobs: + update-graph: + runs-on: ive + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + + - name: Install graphify + run: pip install --quiet --user --break-system-packages 'graphifyy[openai]' + + - name: Link graphify-out under .gitea/ + run: | + mkdir -p .gitea/graphify-out + ln -sfn .gitea/graphify-out graphify-out + + - name: Update knowledge graph (incremental, AST-only, no LLM) + run: | + export PATH="$HOME/.local/bin:$PATH" + graphify update . + + - name: Name communities via local LLM (incremental, missing labels only) + run: | + export PATH="$HOME/.local/bin:$PATH" + export OPENAI_BASE_URL="http://10.2.2.54:5625/v1" + export OPENAI_MODEL="ive-brain" + export OPENAI_API_KEY="not-needed" + graphify label . --missing-only --backend openai --model ive-brain --max-concurrency 1 + + - name: Drop graphify's dated backup snapshot + run: rm -rf .gitea/graphify-out/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] + + - name: Commit graph if it changed + run: | + git config user.name "ive" + git config user.email "system-ive-code-review@technarts.com" + git add .gitea/graphify-out/ + if git diff --cached --quiet; then + exit 0 + fi + git commit -m "chore: update graphify knowledge graph [skip-graphify]" + git push origin HEAD:main diff --git a/.gitea/workflows/pr-ask-template.yml b/.gitea/workflows/pr-ask-template.yml new file mode 100644 index 0000000..84d9200 --- /dev/null +++ b/.gitea/workflows/pr-ask-template.yml @@ -0,0 +1,49 @@ +name: PR Ask With IVE (Template) + +on: + workflow_call: + inputs: + issue_number: + description: "issue/PR number the comment was made on" + required: true + type: "string" + + comment_id: + description: "id of the triggering comment" + required: true + type: "string" + + comment_body: + description: "full body of the triggering comment, including the /ask prefix" + required: true + type: "string" + + pull_request_html: + description: "html url of the pull request being asked about" + required: true + type: "string" + +jobs: + pr-ask: + runs-on: ive + timeout-minutes: 300 + + steps: + - name: Answer /ask command + env: + COMMENT_BODY: ${{ inputs.comment_body }} + ISSUE_NUMBER: ${{ inputs.issue_number }} + COMMENT_ID: ${{ inputs.comment_id }} + PULL_REQUEST_HTML: ${{ inputs.pull_request_html }} + run: | + question="${COMMENT_BODY#/ask}" + question="$(echo "$question" | sed -e 's/^[[:space:]]*//')" + container="pr-ask-${ISSUE_NUMBER}-${COMMENT_ID}" + docker rm -f "$container" 2>/dev/null || true + timeout 300m docker run --rm --name "$container" \ + -e LLM_BASE_URL="http://10.2.2.54:5625/v1" \ + -e LLM_MODEL="ive-brain" \ + -e GRAPH_PATH_REPO=".gitea/graphify-out/graph.json" \ + pr-review-agent:local \ + --pr-url="$PULL_REQUEST_HTML" \ + --ask="$question" diff --git a/.gitea/workflows/pr-review-template.yml b/.gitea/workflows/pr-review-template.yml new file mode 100644 index 0000000..aaecf8d --- /dev/null +++ b/.gitea/workflows/pr-review-template.yml @@ -0,0 +1,44 @@ +name: PR Review With IVE + +on: + workflow_call: + inputs: + review_project_rules: + description: "Repo based prompts" + required: true + type: "string" + default: "" + + pull_request_number: + description: "pull request number" + required: true + type: "string" + + pull_request_html_url: + description: "string html for pull request" + required: true + type: "string" +jobs: + pr-review: + runs-on: ive + timeout-minutes: 300 + + steps: + - name: Run PR Review With IVE + env: + REVIEW_PROJECT_RULES: ${{inputs.review_project_rules}} + PULL_REQUEST_NUMBER: ${{inputs.pull_request_number}} + PULL_REQUEST_HTML: ${{inputs.pull_request_html_url}} + run: | + echo "Project rules: $REVIEW_PROJECT_RULES" + echo "Pull request number: $PULL_REQUEST_NUMBER" + echo "Pull request html url: $PULL_REQUEST_HTML" + container="pr-review-$PULL_REQUEST_NUMBER" + docker rm -f "$container" 2>/dev/null || true + timeout 300m docker run --rm --name "$container" \ + -e LLM_BASE_URL="http://10.2.2.54:5625/v1" \ + -e LLM_MODEL="ive-brain" \ + -e GRAPH_PATH_REPO=".gitea/graphify-out/graph.json" \ + -e REVIEW_PROJECT_RULES \ + pr-review-agent:local \ + --pr-url=$PULL_REQUEST_HTML