Skip to content

[webhooks] configurable action keywords#41

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

[webhooks] configurable action keywords#41
capcom6 wants to merge 2 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 WEBHOOKS__ACTION_KEYWORDS to configure commit-message keywords (with status-driven transitions) for webhook automation.
    • Supports case-insensitive keyword matching, keyword-qualified and bare #<number> references, and deduplicates references by task number.
    • Extended webhook environment template with bot email and WEBHOOKS__SECRET.
  • Bug Fixes
    • Improved validation and error handling for signature issues and malformed/invalid keyword/status configurations.
  • Documentation
    • Updated the environment template with the required JSON mapping format, parsing rules, valid statuses, and examples.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ff43a3e8-a96b-4575-af74-2e592c5f0e24

📥 Commits

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

📒 Files selected for processing (1)
  • .env.example
🚧 Files skipped from review as they are similar to previous changes (1)
  • .env.example

📝 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: 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 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 describes 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
@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
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