You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "bujjibabukatta (via GitHub)" <gi...@apache.org> on 2026/06/13 07:02:35 UTC
[PR] [Feature][Webhook] Allow closing incidents via request body (fixes #8910) [devlake]
bujjibabukatta opened a new pull request, #8921:
URL: https://github.com/apache/devlake/pull/8921
## Summary
Fixes #8910
Kibana v8.x webhook connectors require a fixed URL per connector and
cannot dynamically construct URLs using alert context values. This made
it impossible to implement a "create + close" incident workflow in Kibana
because the existing close endpoint requires `issueKey` in the URL path.
## Changes
Added two new endpoints that accept `issueKey` in the JSON request body
instead of the URL path, while keeping all existing endpoints untouched
for full backward compatibility.
### New endpoints
| Endpoint | Handler | issueKey source |
|---|---|---|
| `POST /connections/:connectionId/issue/close` | `CloseIssueByBody` | JSON body |
| `POST /connections/by-name/:connectionName/issue/close` | `CloseIssueByBodyByName` | JSON body |
### Files changed
- `backend/plugins/webhook/api/issues.go` — added `CloseIssueByBodyRequest` struct, `CloseIssueByBody` and `CloseIssueByBodyByName` handlers
- `backend/plugins/webhook/impl/impl.go` — registered 3 new routes (including legacy prefix variant)
## How it works
Both new handlers decode `issueKey` from the request body and inject it
into `input.Params["issueKey"]` before delegating to the existing shared
`closeIssue()` helper — zero business logic duplicated.
## Usage (Kibana or any fixed-URL client)
```bash
# Before (broken in Kibana — issueKey in URL, can't be dynamic)
POST /plugins/webhook/connections/1/issue/DLK-1234/close
# After (works in Kibana — fixed URL, issueKey in body)
POST /plugins/webhook/connections/1/issue/close
Content-Type: application/json
{
"issueKey": "DLK-1234",
"resolutionDate": "2026-06-13T10:00:00Z"
}
```
## Notes
- No breaking changes — all existing path-based endpoints remain untouched
- Route conflict is not an issue: Gin gives static segment `/issue/close`
priority over wildcard `/issue/:issueKey/close`
- Swagger docs regenerated via `make swag`
## Type of change
- [x] New feature (non-breaking)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Webhook] Allow closing incidents via request body (fixes #8910) [devlake]
Posted by "bujjibabukatta (via GitHub)" <gi...@apache.org>.
bujjibabukatta commented on PR #8921:
URL: https://github.com/apache/devlake/pull/8921#issuecomment-4697876585
Hi @klesh could you please review and approve the PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Webhook] Allow closing incidents via request body (fixes #8910) [devlake]
Posted by "bujjibabukatta (via GitHub)" <gi...@apache.org>.
bujjibabukatta commented on PR #8921:
URL: https://github.com/apache/devlake/pull/8921#issuecomment-4701065216
Hi, thank you for the feedback! I have fixed the linting issues — corrected the indentation from spaces to tabs and removed the trailing whitespace. The golangci-lint should pass now. Please take a look.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Webhook] Allow closing incidents via request body (fixes #8910) [devlake]
Posted by "bujjibabukatta (via GitHub)" <gi...@apache.org>.
bujjibabukatta closed pull request #8921: [Feature][Webhook] Allow closing incidents via request body (fixes #8910)
URL: https://github.com/apache/devlake/pull/8921
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Webhook] Allow closing incidents via request body (fixes #8910) [devlake]
Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh commented on code in PR #8921:
URL: https://github.com/apache/devlake/pull/8921#discussion_r3420909310
##########
backend/plugins/webhook/api/issues.go:
##########
@@ -265,16 +329,6 @@ func closeIssue(input *plugin.ApiResourceInput, err errors.Error, connection *mo
}
domainIssue.Status = ticket.DONE
domainIssue.OriginalStatus = ``
- now := time.Now()
Review Comment:
why you deleted these code?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Webhook] Allow closing incidents via request body (fixes #8910) [devlake]
Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh commented on PR #8921:
URL: https://github.com/apache/devlake/pull/8921#issuecomment-4700899070
Hi. Please fix the linting first.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature][Webhook] Allow closing incidents via request body (fixes #8910) [devlake]
Posted by "bujjibabukatta (via GitHub)" <gi...@apache.org>.
bujjibabukatta commented on code in PR #8921:
URL: https://github.com/apache/devlake/pull/8921#discussion_r3423142632
##########
backend/plugins/webhook/api/issues.go:
##########
@@ -265,16 +329,6 @@ func closeIssue(input *plugin.ApiResourceInput, err errors.Error, connection *mo
}
domainIssue.Status = ticket.DONE
domainIssue.OriginalStatus = ``
- now := time.Now()
Review Comment:
Sorry about that! The ResolutionDate logic was accidentally removed
during a merge. It has been restored now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org