Commit Graph
22 Commits
Author SHA1 Message Date
forgejo-actions[bot] 3b8f84bb55 chore: regenerate workflows from KCL [skip ci] 2026-02-27 12:25:30 +00:00
Vlad MocanuandClaude Opus 4.6 ec1a718b2e chore: bump kcl-ci to v1.37.1 (Bash sub-patterns for claude.yml)
Picks up the allowed_tools fix from kcl-ci — claude.yml tag-mode
workflow now uses Bash(git:*),Bash(bun:*),Bash(curl:*) sub-patterns
instead of bare Bash, enabling auto-approval in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 12:49:01 +02:00
Vlad MocanuandClaude Opus 4.6 ec92cf4c28 fix: enable verbose output and full tool access for Claude workflows
- Add show_full_output: true to both claude.yml and upstream-sync.yml
- Add allowed_tools (Bash, Read, Write, etc.) to upstream-sync merge step
- Upgrade kcl-ci to v1.37.0 (defaults show_full_output and full tools)

Fixes: Claude was burning 38 turns hitting sandbox permission denials
trying to run bun test and git push during upstream sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 12:25:13 +02:00
Vlad MocanuandClaude Opus 4.6 4954e96cc5 feat: add Claude auto-merge to upstream-sync workflow
- New merge-upstream job: creates branch, merges upstream, runs Claude
  agent mode to review, resolve conflicts, run tests, and create a PR
- Dynamic fork impact analysis: computes overlap between fork-modified
  files and upstream-changed files to assess conflict risk
- Claude reviews ALL upstream changes for fork compatibility (renamed
  imports, changed APIs, GitHub-only assumptions) not just conflicts
- Maintainability principle: minimize fork divergence, prefer adapters
- Remove ANTHROPIC_API_KEY (using OAuth token only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:55:51 +02:00
Vlad MocanuandClaude Opus 4.6 5c014823e0 feat: migrate workflows to kcl-ci standard
- Add .forgejo/kcl-ci/ with kcl.mod, main.k, Taskfile.yaml
- claude.yml: use claude.k module (fixes #comment YAML validation error,
  removes duplicate pull_request_comment trigger)
- ci.yml: add paths-ignore for kcl-ci paths, named jobs for check constants
- test-action.yml: regenerated from KCL (functionally identical)
- upstream-sync.yml: regenerated from KCL (functionally identical)
- kcl-ci-build.yml: new auto-regeneration workflow (waits for CI checks)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:40:47 +02:00
Vlad MocanuandClaude Opus 4.6 f83eed97de docs: document Forgejo event behavior in workflow and trigger.ts
Add inline comments explaining:
- Forgejo never fires pull_request_review (sends pull_request_comment)
- Why workflow if-condition cannot gate on @claude for these events
  (payload fields are empty, confirmed by run 12084 being skipped)
- The @claude check is handled in trigger.ts via payload inspection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:32:36 +02:00
Vlad MocanuandClaude Opus 4.6 a033ec873e revert: undo workflow if-condition gating for pull_request_comment
Forgejo's pull_request_comment payload does not populate
github.event.comment.body or github.event.review.body in a way
the workflow contains() expression can read, causing legitimate
@claude reviews to be skipped (run 12084).

Revert to unconditional pass at the workflow level. The @claude
check is handled properly in trigger.ts which inspects the actual
payload fields with fallback logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:32:36 +02:00
Vlad MocanuandClaude Opus 4.6 42f6508d49 fix: gate Forgejo review/comment triggers on @claude mention
Previously, all pull_request_comment events on Forgejo triggered the
full Claude pipeline unconditionally — both in the workflow if-condition
and in trigger.ts. This wasted CI resources and API credits on reviews
without @claude mentions (e.g. plain "LGTM" reviews).

Workflow: add @claude check via contains() on comment.body and review.body.
Trigger validation: replace blind auto-trigger with payload-aware check
that inspects available body fields, falling back only when no body exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:32:36 +02:00
Vlad MocanuandClaude Opus 4.6 f3c92a2821 fix: move comments out of workflow if: expression block
Forgejo runner's expression parser rejects '#' characters inside
if: | blocks (run 52778: "unexpected character '#' while lexing
expression"). Move all comments above the if: key and switch from
block scalar (|) to folded scalar (>-) to avoid multiline issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:45:15 +02:00
Vlad MocanuandClaude Opus 4.6 401c35fdd2 docs: document Forgejo event behavior in workflow and trigger.ts
Add inline comments explaining:
- Forgejo never fires pull_request_review (sends pull_request_comment)
- Why workflow if-condition cannot gate on @claude for these events
  (payload fields are empty, confirmed by run 12084 being skipped)
- The @claude check is handled in trigger.ts via payload inspection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:45:09 +02:00
Vlad MocanuandClaude Opus 4.6 231a31ca39 revert: undo workflow if-condition gating for pull_request_comment
Forgejo's pull_request_comment payload does not populate
github.event.comment.body or github.event.review.body in a way
the workflow contains() expression can read, causing legitimate
@claude reviews to be skipped (run 12084).

Revert to unconditional pass at the workflow level. The @claude
check is handled properly in trigger.ts which inspects the actual
payload fields with fallback logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:45:09 +02:00
Vlad MocanuandClaude Opus 4.6 71fb686885 fix: gate Forgejo review/comment triggers on @claude mention
Previously, all pull_request_comment events on Forgejo triggered the
full Claude pipeline unconditionally — both in the workflow if-condition
and in trigger.ts. This wasted CI resources and API credits on reviews
without @claude mentions (e.g. plain "LGTM" reviews).

Workflow: add @claude check via contains() on comment.body and review.body.
Trigger validation: replace blind auto-trigger with payload-aware check
that inspects available body fields, falling back only when no body exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:45:09 +02:00
Vlad MocanuandClaude Opus 4.6 a864b1636f fix: move comments out of workflow if: expression block
Forgejo runner's expression parser rejects '#' characters inside
if: | blocks (run 52778: "unexpected character '#' while lexing
expression"). Move all comments above the if: key and switch from
block scalar (|) to folded scalar (>-) to avoid multiline issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:21:23 +02:00
Vlad MocanuandClaude Opus 4.6 414c7053eb fix: let all issues events through workflow gate on Forgejo
Forgejo does not populate github.event.action in the workflow if:
context for issues events (run 12061 was skipped despite action
being 'labeled'). Same pattern as pull_request_comment (M3).

Remove the action/body/title gating from the workflow condition
and let trigger.ts handle all validation (label, assignee, mention).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:19:39 +02:00
Vlad MocanuandClaude Opus 4.6 910c843122 chore: remove debug-event job, merge into failure step
The separate debug-event job ran on every event, wasting a runner.
Merged the event payload dump into the existing "Debug on failure"
step so it only runs when the claude job actually fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 08:43:57 +02:00
Vlad MocanuandClaude Opus 4.6 b4bc36810d fix: let pull_request_review_comment events through unconditionally
Forgejo's pull_request_review_comment event does not populate
github.event.comment.body in the workflow context (it's always
empty), so the contains() check never matches. The action code
does its own trigger phrase validation, so it's safe to let these
events through based on event name alone.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 23:49:19 +02:00
Vlad Mocanu 97dd0863c7 chore: improve debug-event job payload dump [skip ci] 2026-02-25 23:47:04 +02:00
Vlad Mocanu a129a15f61 feat(prd-6): verify workflow triggers and add assignee_trigger (#13) 2026-02-25 21:43:37 +00:00
claude-botandvtmocanu 2d8753c3db docs: rename bot from claude-bot to claude in CI and docs
Update all runtime-relevant references to the Forgejo bot username
from 'claude-bot' to 'claude' following the bot account rename.

- .forgejo/workflows/claude.yml: bot_name input
- docs/forgejo.md: setup guide, examples, and inline references
- CLAUDE.md: bot identity description

Test fixtures and historical PRD files are left unchanged as they
use 'claude-bot' as arbitrary mock data or historical record.

Co-authored-by: vtmocanu <vtmocanu@users.noreply.github.com>
2026-02-25 20:22:38 +00:00
Vlad MocanuandClaude Opus 4.6 b03ccb518c feat(prd-5): add dedicated claude-bot user for Forgejo
- Add bot_email action input for custom git commit email on Forgejo
- Update claude.yml to use CLAUDE_BOT_TOKEN with bot_id/bot_name/bot_email
- Update git-config.ts to use provided email over noreply format
- Add "Dedicated Bot User" setup guide to docs/forgejo.md
- Update CLAUDE.md with bot identity documentation

Infrastructure (done outside code):
- claude-bot user created (ID 48, non-admin, with avatar)
- Claude team with write access in all 12 orgs
- CLAUDE_BOT_TOKEN org-level secret in all 12 orgs

Progress: ~85% complete - pending E2E validation after merge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 20:56:55 +02:00
Vlad MocanuandClaude Opus 4.6 efe30422e7 ci: switch claude.yml to use claude-bot token [skip ci]
Use CLAUDE_BOT_TOKEN (dedicated bot user) instead of FORGEJO_CLAUDE_TOKEN
(personal token). Comments and commits will now appear as claude-bot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 20:45:11 +02:00
Vlad MocanuandClaude Opus 4.6 c2ea0a6dba feat: add tag mode workflow for Forgejo
Enables @claude mentions on issues, PR review comments,
issue assignment, and label triggers on Forgejo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 20:00:26 +02:00