Skip to content

[webhooks] configurable action keywords#41

Open
capcom6 wants to merge 1 commit into
masterfrom
webhooks/configurable-action-keywords
Open

[webhooks] configurable action keywords#41
capcom6 wants to merge 1 commit 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 WEBHOOKS__ACTION_KEYWORDS to drive webhook-driven task status transitions from commit-message keywords.
    • Supports case-insensitive matching for keyword-qualified keyword #<number> and bare #<number> references, with deduplication by task number.
    • Extended the environment template with WEBHOOKS__SECRET and the bot account email.
  • Bug Fixes
    • Improved configuration validation (rejects empty/invalid keywords and unsupported statuses) and webhook error reporting (including signature-related failures).
  • Documentation
    • Documented the required JSON mapping format (must start with {), example content, parsing expectations, and valid statuses for keyword entries.

@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: 58 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: 81efc424-b45f-4dcf-8493-6f4520d5ee6a

📥 Commits

Reviewing files that changed from the base of the PR and between 60bacaa and 2d74137.

📒 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.

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 service 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: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant WebhookService
  participant KeywordParser
  participant TaskReferences
  WebhookService->>KeywordParser: ParseCommitMessage(commit message)
  KeywordParser->>TaskReferences: Extract keyword-qualified and bare task 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.
  • bit-issues/backend#40: Expanded webhook commit-message keyword variants related to the configurable action mappings.

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 summarizes the main change: configurable action keywords for webhooks.
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
@capcom6 capcom6 added the ready PR is ready to merge label Jul 17, 2026
@capcom6
capcom6 force-pushed the webhooks/configurable-action-keywords branch from ac9d0a6 to 8039697 Compare July 18, 2026 01:35
@github-actions github-actions Bot removed the ready PR is ready to merge label Jul 18, 2026
@capcom6
capcom6 force-pushed the webhooks/configurable-action-keywords branch from 8039697 to 972be95 Compare July 18, 2026 08:26

@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 @.env.example:
- Around line 249-260: Set WEBHOOKS__ACTION_KEYWORDS in .env.example to the
documented default JSON object instead of leaving it empty, preserving all
listed keyword-to-status transitions and optional verbs so copied environments
retain the built-in webhook behavior.
🪄 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: 6a1746aa-cbe7-45a6-8cb9-cb09a2cd59e0

📥 Commits

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

📒 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
🚧 Files skipped from review as they are similar to previous changes (7)
  • internal/webhooks/errors.go
  • internal/config/module.go
  • internal/webhooks/config.go
  • internal/webhooks/domain.go
  • internal/config/config.go
  • internal/webhooks/service.go
  • internal/webhooks/parser.go

Comment thread .env.example Outdated
@capcom6
capcom6 force-pushed the webhooks/configurable-action-keywords branch from bd09440 to 60bacaa Compare July 20, 2026 05:09
@capcom6 capcom6 added the ready PR is ready to merge label Jul 20, 2026
@capcom6
capcom6 force-pushed the webhooks/configurable-action-keywords branch from 60bacaa to 2d74137 Compare July 21, 2026 00:05
@github-actions github-actions Bot removed the ready PR is ready to merge label Jul 21, 2026
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