main #22

Merged
Latte merged 4 commits from main into dev 2025-12-29 10:36:22 +00:00
Owner
No description provided.
Latte added 4 commits 2025-12-29 10:36:18 +00:00
Reviewed-on: #14
fix: Prevent duplicate workflow runs on @codebot mentions
All checks were successful
Enterprise AI Code Review / ai-review (pull_request) Successful in 40s
21470c7a4a
Critical fix for workflow routing that was causing 3x duplication on every
@codebot mention. All three workflows (ai-chat, ai-comment-reply, ai-issue-triage)
were triggering simultaneously.

Changes:
- ai-issue-triage.yml: Only runs on '@codebot triage' (unchanged, already specific)
- ai-comment-reply.yml: Only runs on specific commands (help, explain, suggest, etc)
- ai-chat.yml: Only runs on free-form questions (excludes all specific commands)

Workflow routing logic:
1. '@codebot triage' → ai-issue-triage.yml ONLY
2. '@codebot <command>' → ai-comment-reply.yml ONLY
3. '@codebot <question>' → ai-chat.yml ONLY (fallback)

This prevents the massive duplication issue where every @codebot mention
triggered all three workflows simultaneously, causing 10+ redundant runs.

Updated documentation in CLAUDE.md with workflow routing architecture.
Merge branch 'main' into hotfix/workflow-duplication
All checks were successful
Enterprise AI Code Review / ai-review (pull_request) Successful in 1m3s
c6a801c781
Merge pull request 'hotfix/workflow-duplication' (#21) from hotfix/workflow-duplication into main
All checks were successful
Enterprise AI Code Review / ai-review (pull_request) Successful in 32s
f5ef66b43d
Reviewed-on: #21
Latte merged commit c6dbb0acf6 into dev 2025-12-29 10:36:22 +00:00
Owner

📋 Pull Request Summary

This PR refines the GitHub Actions workflows for the AI bot by clearly separating responsibilities among three workflows to prevent duplicate runs. It introduces explicit conditional checks to route issue comments to the appropriate workflow based on specific commands or free-form chat mentions. Additionally, the documentation is updated to reflect this new mutually exclusive workflow routing logic.

Type: ♻️ Refactor

Changes

Added:

  • Explicit conditional filters in ai-chat.yml to exclude specific commands
  • Explicit conditional filters in ai-comment-reply.yml to include only specific commands
  • Workflow routing explanation in CLAUDE.md to clarify mutually exclusive workflow triggers

📝 Modified:

  • ai-chat.yml: added detailed if-condition to run only on free-form @codebot mentions excluding commands
  • ai-comment-reply.yml: refined if-condition to run only on specific @codebot commands
  • ai-issue-triage.yml: added comments clarifying it handles only the 'triage' command
  • CLAUDE.md: updated workflow architecture section to describe mutually exclusive workflow routing

Files Affected

  • 📝 .gitea/workflows/ai-chat.yml - Refactored workflow to run only on free-form @codebot mentions excluding specific commands to prevent duplicate runs
  • 📝 .gitea/workflows/ai-comment-reply.yml - Refined workflow to trigger only on specific @codebot commands, avoiding overlap with other workflows
  • 📝 .gitea/workflows/ai-issue-triage.yml - Added clarifying comments that this workflow handles only the 'triage' command
  • 📝 CLAUDE.md - Updated documentation to explain the mutually exclusive workflow routing logic and prevent duplicate workflow runs

Impact

🟡 Scope: Medium
These changes improve workflow efficiency by preventing multiple workflows from triggering on the same comment, reducing redundant processing and potential confusion. The clearer routing logic also aids maintainability and onboarding.

## 📋 Pull Request Summary This PR refines the GitHub Actions workflows for the AI bot by clearly separating responsibilities among three workflows to prevent duplicate runs. It introduces explicit conditional checks to route issue comments to the appropriate workflow based on specific commands or free-form chat mentions. Additionally, the documentation is updated to reflect this new mutually exclusive workflow routing logic. **Type:** ♻️ Refactor ## Changes **✅ Added:** - Explicit conditional filters in ai-chat.yml to exclude specific commands - Explicit conditional filters in ai-comment-reply.yml to include only specific commands - Workflow routing explanation in CLAUDE.md to clarify mutually exclusive workflow triggers **📝 Modified:** - ai-chat.yml: added detailed if-condition to run only on free-form @codebot mentions excluding commands - ai-comment-reply.yml: refined if-condition to run only on specific @codebot commands - ai-issue-triage.yml: added comments clarifying it handles only the 'triage' command - CLAUDE.md: updated workflow architecture section to describe mutually exclusive workflow routing ## Files Affected - 📝 `.gitea/workflows/ai-chat.yml` - Refactored workflow to run only on free-form @codebot mentions excluding specific commands to prevent duplicate runs - 📝 `.gitea/workflows/ai-comment-reply.yml` - Refined workflow to trigger only on specific @codebot commands, avoiding overlap with other workflows - 📝 `.gitea/workflows/ai-issue-triage.yml` - Added clarifying comments that this workflow handles only the 'triage' command - 📝 `CLAUDE.md` - Updated documentation to explain the mutually exclusive workflow routing logic and prevent duplicate workflow runs ## Impact 🟡 **Scope:** Medium These changes improve workflow efficiency by preventing multiple workflows from triggering on the same comment, reducing redundant processing and potential confusion. The clearer routing logic also aids maintainability and onboarding.
Bartender reviewed 2025-12-29 10:36:49 +00:00
Bartender left a comment
Owner

AI Code Review - Inline Comments

AI Code Review - Inline Comments
Owner

[LOW] Maintainability

The 'if' condition for filtering out specific commands in the ai-chat workflow is long and repetitive, which could be error-prone and hard to maintain as commands grow.

Recommendation: Consider defining a reusable list of commands or using a regex pattern to simplify the condition and improve maintainability.

**[LOW] Maintainability** The 'if' condition for filtering out specific commands in the ai-chat workflow is long and repetitive, which could be error-prone and hard to maintain as commands grow. **Recommendation:** Consider defining a reusable list of commands or using a regex pattern to simplify the condition and improve maintainability.
Owner

[LOW] Security

The workflow uses multiple secrets (OPENAI_API_KEY, OPENROUTER_API_KEY, OLLAMA_HOST, SEARXNG_URL) as environment variables. While this is standard, there is no explicit validation or masking mentioned in the workflow.

Recommendation: Ensure that these secrets are properly stored in the repository secrets and that logs do not expose these values. Consider adding steps to mask or redact secrets in logs if not already handled by the platform.

**[LOW] Security** The workflow uses multiple secrets (OPENAI_API_KEY, OPENROUTER_API_KEY, OLLAMA_HOST, SEARXNG_URL) as environment variables. While this is standard, there is no explicit validation or masking mentioned in the workflow. **Recommendation:** Ensure that these secrets are properly stored in the repository secrets and that logs do not expose these values. Consider adding steps to mask or redact secrets in logs if not already handled by the platform.
Owner

[LOW] Readability

The updated documentation on workflow routing is helpful but could benefit from clearer formatting and explicit mention that the routing logic is implemented via the 'if' conditions in the workflows.

Recommendation: Add a note linking the documented routing logic to the actual 'if' conditions in the workflow YAML files for easier traceability by maintainers.

**[LOW] Readability** The updated documentation on workflow routing is helpful but could benefit from clearer formatting and explicit mention that the routing logic is implemented via the 'if' conditions in the workflows. **Recommendation:** Add a note linking the documented routing logic to the actual 'if' conditions in the workflow YAML files for easier traceability by maintainers.
Owner

AI Code Review

The PR improves workflow routing for the AI bot by clearly separating triggers for free-form chat, specific commands, and triage commands to prevent duplicate runs. The changes enhance maintainability and clarity of workflow triggers and update documentation accordingly. No security, correctness, or performance issues were found. Minor improvements could be made in documentation clarity and environment variable usage.

Summary

Severity Count
HIGH 0
MEDIUM 0
LOW 3

Review Findings

  • [LOW] .gitea/workflows/ai-chat.yml:18 - The 'if' condition for filtering out specific commands in the ai-chat workflow is long and repetitive, which could be error-prone and hard to maintain as commands grow.
  • [LOW] .gitea/workflows/ai-chat.yml:38 - The workflow uses multiple secrets (OPENAI_API_KEY, OPENROUTER_API_KEY, OLLAMA_HOST, SEARXNG_URL) as environment variables. While this is standard, there is no explicit validation or masking mentioned in the workflow.
  • [LOW] CLAUDE.md:190 - The updated documentation on workflow routing is helpful but could benefit from clearer formatting and explicit mention that the routing logic is implemented via the 'if' conditions in the workflows.

Overall Severity: LOW
AI Recommendation: Approve

<!-- AI_PR_REVIEW --> ## AI Code Review The PR improves workflow routing for the AI bot by clearly separating triggers for free-form chat, specific commands, and triage commands to prevent duplicate runs. The changes enhance maintainability and clarity of workflow triggers and update documentation accordingly. No security, correctness, or performance issues were found. Minor improvements could be made in documentation clarity and environment variable usage. ### Summary | Severity | Count | |----------|-------| | HIGH | 0 | | MEDIUM | 0 | | LOW | 3 | ### Review Findings - **[LOW]** `.gitea/workflows/ai-chat.yml:18` - The 'if' condition for filtering out specific commands in the ai-chat workflow is long and repetitive, which could be error-prone and hard to maintain as commands grow. - **[LOW]** `.gitea/workflows/ai-chat.yml:38` - The workflow uses multiple secrets (OPENAI_API_KEY, OPENROUTER_API_KEY, OLLAMA_HOST, SEARXNG_URL) as environment variables. While this is standard, there is no explicit validation or masking mentioned in the workflow. - **[LOW]** `CLAUDE.md:190` - The updated documentation on workflow routing is helpful but could benefit from clearer formatting and explicit mention that the routing logic is implemented via the 'if' conditions in the workflows. --- **Overall Severity:** `LOW` **AI Recommendation:** Approve
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Hiddenden/openrabbit#22