Skip to content

[webhooks] configurable action keywords#41

Open
capcom6 wants to merge 3 commits into
masterfrom
webhooks/configurable-action-keywords
Open

[webhooks] configurable action keywords#41
capcom6 wants to merge 3 commits into
masterfrom
webhooks/configurable-action-keywords

Conversation

@capcom6

@capcom6 capcom6 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added configurable webhook commit-message keywords to automatically transition referenced tasks to mapped statuses.
    • Supports case-insensitive matching, keyword-qualified and bare task references, and deduplicates by task number.
    • Added webhook configuration for bot email and HMAC secret.
  • Bug Fixes
    • Improved validation for missing/empty keyword entries and invalid keyword status mappings, plus clearer webhook error handling.
  • Documentation
    • Updated the environment template with WEBHOOKS__ACTION_KEYWORDS (format, parsing rules, valid statuses, and examples).

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@capcom6, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a7156e29-51da-42ac-93bd-965b04aefe26

📥 Commits

Reviewing files that changed from the base of the PR and between c8fb669 and ac9d0a6.

📒 Files selected for processing (8)
  • .env.example
  • internal/config/config.go
  • internal/config/module.go
  • internal/webhooks/config.go
  • internal/webhooks/domain.go
  • internal/webhooks/errors.go
  • internal/webhooks/parser.go
  • internal/webhooks/service.go
📝 Walkthrough

Walkthrough

Webhook handling now supports configurable commit-message keywords that map task references to status transitions. Configuration, parser validation and matching, error definitions, and webhook service initialization are updated accordingly.

Changes

Configurable webhook parsing

Layer / File(s) Summary
Webhook configuration contract
.env.example, internal/config/config.go, internal/config/module.go, internal/webhooks/config.go
Webhook settings now include documented keyword mappings, typed keyword entries, default actions, and Fx wiring.
Keyword parser and validation
internal/webhooks/parser.go, internal/webhooks/domain.go, internal/webhooks/errors.go
Commit parsing moved into a configurable parser that validates statuses, matches keyword-qualified and bare task references, deduplicates task numbers, and defines webhook parsing errors.
Service parser initialization and processing
internal/webhooks/service.go
The service builds the parser during initialization and uses it to parse commit messages during processing.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant WebhookService
  participant KeywordParser
  participant TaskReferences
  WebhookService->>KeywordParser: ParseCommitMessage(commit message)
  KeywordParser->>TaskReferences: Extract keyword-qualified and bare `#number` references
  KeywordParser-->>WebhookService: Return ParsedReference entries with actions
Loading

Possibly related PRs

  • bit-issues/backend#33: Introduced the earlier webhook parsing and service flow that this configurable parser refactors.

Suggested reviewers: dudina-ma

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: making webhook action keywords configurable.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🤖 Pull request artifacts

Platform File
🐳 Docker GitHub Container Registry
🍎 Darwin arm64 backend_Darwin_arm64.tar.gz
🍎 Darwin x86_64 backend_Darwin_x86_64.tar.gz
🐧 Linux arm64 backend_Linux_arm64.tar.gz
🐧 Linux i386 backend_Linux_i386.tar.gz
🐧 Linux x86_64 backend_Linux_x86_64.tar.gz
🪟 Windows arm64 backend_Windows_arm64.zip
🪟 Windows i386 backend_Windows_i386.zip
🪟 Windows x86_64 backend_Windows_x86_64.zip

@capcom6

capcom6 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 44 minutes.

@capcom6

capcom6 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 45 minutes.

@capcom6

capcom6 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 38 minutes.

@capcom6

capcom6 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot requested a review from dudina-ma July 11, 2026 11:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/webhooks/parser.go`:
- Around line 41-42: Validate entries in NewKeywordParser before compiling
patterns, rejecting or skipping any keyword whose string is empty after
normalization. Ensure empty keywords cannot produce regex alternatives or
receive an action, while preserving existing handling for valid keywords.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e252844d-3466-4ddc-9218-a09ebf7b62e5

📥 Commits

Reviewing files that changed from the base of the PR and between 8d80806 and def92f1.

📒 Files selected for processing (8)
  • .env.example
  • internal/config/config.go
  • internal/config/module.go
  • internal/webhooks/config.go
  • internal/webhooks/domain.go
  • internal/webhooks/errors.go
  • internal/webhooks/parser.go
  • internal/webhooks/service.go

Comment thread internal/webhooks/parser.go
@capcom6 capcom6 force-pushed the webhooks/configurable-action-keywords branch from 63e1976 to ac9d0a6 Compare July 14, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant