dev #29
@@ -17,7 +17,9 @@ jobs:
|
||||
|
|
||||
ai-chat:
|
||||
# Only run if comment mentions the bot but NOT a specific command
|
||||
# This prevents duplicate runs with ai-comment-reply.yml and ai-issue-triage.yml
|
||||
# CRITICAL: Ignore bot's own comments to prevent infinite loops (bot username: Bartender)
|
||||
|
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes. Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and reduce risk of inconsistent updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
**Recommendation:** Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and reduce risk of inconsistent updates.
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes. Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and ease future updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
**Recommendation:** Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and ease future updates.
|
||||
if: |
|
||||
github.event.comment.user.login != 'Bartender' &&
|
||||
|
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes. Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and reduce risk of inconsistent updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
**Recommendation:** Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and reduce risk of inconsistent updates.
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes. Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and ease future updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
**Recommendation:** Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and ease future updates.
|
||||
contains(github.event.comment.body, '@codebot') &&
|
||||
!contains(github.event.comment.body, '@codebot triage') &&
|
||||
!contains(github.event.comment.body, '@codebot help') &&
|
||||
|
||||
|
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes. Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and reduce risk of inconsistent updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
**Recommendation:** Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and reduce risk of inconsistent updates.
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes. Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and reduce risk of inconsistent updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
**Recommendation:** Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and reduce risk of inconsistent updates.
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes. Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and ease future updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
**Recommendation:** Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and ease future updates.
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes. Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and ease future updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
**Recommendation:** Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and ease future updates.
|
||||
@@ -17,7 +17,9 @@ jobs:
|
||||
|
Bartender
commented
[LOW] Maintainability Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow. Recommendation: Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors. **[LOW] Maintainability**
Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow.
**Recommendation:** Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors.
Bartender
commented
[LOW] Maintainability Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow. Recommendation: Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors. **[LOW] Maintainability**
Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow.
**Recommendation:** Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors.
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows. Recommendation: Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows.
**Recommendation:** Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates.
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows. Recommendation: Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows.
**Recommendation:** Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates.
|
||||
runs-on: ubuntu-latest
|
||||
# Only run for specific commands (not free-form chat or triage)
|
||||
# This prevents duplicate runs with ai-chat.yml and ai-issue-triage.yml
|
||||
# CRITICAL: Ignore bot's own comments to prevent infinite loops (bot username: Bartender)
|
||||
|
Bartender
commented
[LOW] Maintainability Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow. Recommendation: Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors. **[LOW] Maintainability**
Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow.
**Recommendation:** Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors.
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows. Recommendation: Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows.
**Recommendation:** Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates.
|
||||
if: |
|
||||
github.event.comment.user.login != 'Bartender' &&
|
||||
|
Bartender
commented
[LOW] Maintainability Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow. Recommendation: Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors. **[LOW] Maintainability**
Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow.
**Recommendation:** Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors.
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows. Recommendation: Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows.
**Recommendation:** Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates.
|
||||
(contains(github.event.comment.body, '@codebot help') ||
|
||||
contains(github.event.comment.body, '@codebot explain') ||
|
||||
contains(github.event.comment.body, '@codebot suggest') ||
|
||||
|
||||
|
Bartender
commented
[LOW] Maintainability Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow. Recommendation: Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors. **[LOW] Maintainability**
Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow.
**Recommendation:** Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors.
Bartender
commented
[LOW] Maintainability Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow. Recommendation: Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors. **[LOW] Maintainability**
Same hardcoded bot username 'Bartender' used to prevent infinite loops in this workflow.
**Recommendation:** Extract bot username to a shared variable or secret to ease maintenance and reduce risk of errors.
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows. Recommendation: Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows.
**Recommendation:** Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates.
Bartender
commented
[LOW] Maintainability The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows. Recommendation: Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates. **[LOW] Maintainability**
The bot username 'Bartender' is hardcoded in the workflow condition to prevent infinite loops, duplicated across multiple workflows.
**Recommendation:** Use a centralized variable or secret for the bot username to reduce duplication and risk of inconsistent updates.
|
||||
@@ -12,7 +12,10 @@ jobs:
|
||||
|
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops. Recommendation: Extract bot username to a shared variable or secret for maintainability. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops.
**Recommendation:** Extract bot username to a shared variable or secret for maintainability.
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops. Recommendation: Extract bot username to a shared variable or secret for maintainability. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops.
**Recommendation:** Extract bot username to a shared variable or secret for maintainability.
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers. Recommendation: Centralize the bot username in a variable or environment setting to simplify maintenance. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers.
**Recommendation:** Centralize the bot username in a variable or environment setting to simplify maintenance.
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers. Recommendation: Centralize the bot username in a variable or environment setting to simplify maintenance. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers.
**Recommendation:** Centralize the bot username in a variable or environment setting to simplify maintenance.
|
||||
ai-triage:
|
||||
runs-on: ubuntu-latest
|
||||
# Only run if comment contains @codebot triage
|
||||
if: contains(github.event.comment.body, '@codebot triage')
|
||||
|
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops. Recommendation: Extract bot username to a shared variable or secret for maintainability. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops.
**Recommendation:** Extract bot username to a shared variable or secret for maintainability.
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers. Recommendation: Centralize the bot username in a variable or environment setting to simplify maintenance. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers.
**Recommendation:** Centralize the bot username in a variable or environment setting to simplify maintenance.
|
||||
# CRITICAL: Ignore bot's own comments to prevent infinite loops (bot username: Bartender)
|
||||
|
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops. Recommendation: Extract bot username to a shared variable or secret for maintainability. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops.
**Recommendation:** Extract bot username to a shared variable or secret for maintainability.
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers. Recommendation: Centralize the bot username in a variable or environment setting to simplify maintenance. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers.
**Recommendation:** Centralize the bot username in a variable or environment setting to simplify maintenance.
|
||||
if: |
|
||||
|
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops. Recommendation: Extract bot username to a shared variable or secret for maintainability. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops.
**Recommendation:** Extract bot username to a shared variable or secret for maintainability.
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers. Recommendation: Centralize the bot username in a variable or environment setting to simplify maintenance. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers.
**Recommendation:** Centralize the bot username in a variable or environment setting to simplify maintenance.
|
||||
github.event.comment.user.login != 'Bartender' &&
|
||||
|
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops. Recommendation: Extract bot username to a shared variable or secret for maintainability. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops.
**Recommendation:** Extract bot username to a shared variable or secret for maintainability.
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers. Recommendation: Centralize the bot username in a variable or environment setting to simplify maintenance. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers.
**Recommendation:** Centralize the bot username in a variable or environment setting to simplify maintenance.
|
||||
contains(github.event.comment.body, '@codebot triage')
|
||||
|
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops. Recommendation: Extract bot username to a shared variable or secret for maintainability. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops.
**Recommendation:** Extract bot username to a shared variable or secret for maintainability.
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers. Recommendation: Centralize the bot username in a variable or environment setting to simplify maintenance. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers.
**Recommendation:** Centralize the bot username in a variable or environment setting to simplify maintenance.
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
||||
|
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops. Recommendation: Extract bot username to a shared variable or secret for maintainability. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops.
**Recommendation:** Extract bot username to a shared variable or secret for maintainability.
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops. Recommendation: Extract bot username to a shared variable or secret for maintainability. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops.
**Recommendation:** Extract bot username to a shared variable or secret for maintainability.
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers. Recommendation: Centralize the bot username in a variable or environment setting to simplify maintenance. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers.
**Recommendation:** Centralize the bot username in a variable or environment setting to simplify maintenance.
Bartender
commented
[LOW] Maintainability Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers. Recommendation: Centralize the bot username in a variable or environment setting to simplify maintenance. **[LOW] Maintainability**
Hardcoded bot username 'Bartender' used to prevent infinite loops in workflow triggers.
**Recommendation:** Centralize the bot username in a variable or environment setting to simplify maintenance.
|
||||
16
CLAUDE.md
@@ -190,7 +190,7 @@ Workflows are located in `.gitea/workflows/` and are **mutually exclusive** to p
|
||||
|
||||
- **enterprise-ai-review.yml** - Triggered on PR open/sync
|
||||
- **ai-issue-triage.yml** - Triggered ONLY on `@codebot triage` in comments
|
||||
- **ai-comment-reply.yml** - Triggered on specific commands: `help`, `explain`, `suggest`, `security`, `summarize`, `review-again`, `setup-labels`
|
||||
- **ai-comment-reply.yml** - Triggered on specific commands: `help`, `explain`, `suggest`, `security`, `summarize`, `changelog`, `explain-diff`, `review-again`, `setup-labels`
|
||||
- **ai-chat.yml** - Triggered on `@codebot` mentions that are NOT specific commands (free-form questions)
|
||||
- **ai-codebase-review.yml** - Scheduled weekly analysis
|
||||
|
||||
@@ -201,6 +201,20 @@ Workflows are located in `.gitea/workflows/` and are **mutually exclusive** to p
|
||||
|
||||
This prevents the issue where all three workflows would trigger on every `@codebot` mention, causing massive duplication.
|
||||
|
||||
**CRITICAL: Bot Self-Trigger Prevention**
|
||||
|
||||
All workflows include `github.event.comment.user.login != 'Bartender'` to prevent infinite loops. Without this check:
|
||||
- Bot posts comment mentioning `@codebot`
|
||||
- Workflow triggers, bot posts another comment with `@codebot`
|
||||
- Triggers again infinitely → 10+ duplicate runs
|
||||
|
||||
**If you change the bot username**, update all three workflow files:
|
||||
- `.gitea/workflows/ai-comment-reply.yml`
|
||||
- `.gitea/workflows/ai-chat.yml`
|
||||
- `.gitea/workflows/ai-issue-triage.yml`
|
||||
|
||||
Look for: `github.event.comment.user.login != 'Bartender'` and replace `'Bartender'` with your bot's username.
|
||||
|
||||
**Note**: Issue triage is now **opt-in** via `@codebot triage` command, not automatic on issue creation.
|
||||
|
||||
Key workflow pattern:
|
||||
|
||||
@@ -479,6 +479,15 @@ if: contains(github.event.comment.body, '@codebot')
|
||||
|
||||
Change `@codebot` to your new bot name.
|
||||
|
||||
**Step 3 (CRITICAL):** Update bot username to prevent infinite loops:
|
||||
|
||||
In all three workflow files, find:
|
||||
```yaml
|
||||
github.event.comment.user.login != 'Bartender'
|
||||
```
|
||||
|
||||
Replace `'Bartender'` with your bot's Gitea username. This prevents the bot from triggering itself when it posts comments containing `@codebot`, which would cause infinite loops and 10+ duplicate workflow runs.
|
||||
|
||||
---
|
||||
|
||||
## Security Scanning
|
||||
|
||||
[LOW] Maintainability
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and reduce risk of inconsistent updates.
[LOW] Maintainability
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and reduce risk of inconsistent updates.
[LOW] Maintainability
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and ease future updates.
[LOW] Maintainability
The bot username 'Bartender' is hardcoded in multiple workflow files to prevent infinite loops. This creates a maintenance burden if the bot username changes.
Recommendation: Consider extracting the bot username into a reusable workflow variable or environment variable to avoid duplication and ease future updates.