You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ab...@apache.org on 2024/08/01 06:32:54 UTC
(incubator-devlake) branch release-v1.0 updated: feat(webhook): calculate `LeadTimeMinutes` if necessary (#7814) (#7817)
This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch release-v1.0
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/release-v1.0 by this push:
new cb51897fc feat(webhook): calculate `LeadTimeMinutes` if necessary (#7814) (#7817)
cb51897fc is described below
commit cb51897fcf73f86aed38b26973559ebd9b9003e7
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Thu Aug 1 14:32:49 2024 +0800
feat(webhook): calculate `LeadTimeMinutes` if necessary (#7814) (#7817)
* feat(webhook): calculate `LeadTimeMinutes` if necessary
* fix(webhook): disable SA9003
* fix(webhook): fix lint errors
Co-authored-by: Lynwee <15...@qq.com>
---
backend/plugins/webhook/api/issues.go | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/backend/plugins/webhook/api/issues.go b/backend/plugins/webhook/api/issues.go
index 7ee19e062..88f7e859d 100644
--- a/backend/plugins/webhook/api/issues.go
+++ b/backend/plugins/webhook/api/issues.go
@@ -138,6 +138,13 @@ func PostIssue(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, error
Severity: request.Severity,
Component: request.Component,
}
+ if *domainIssue.LeadTimeMinutes == 0 {
+ if domainIssue.ResolutionDate != nil && domainIssue.CreatedDate != nil {
+ temp := uint(domainIssue.ResolutionDate.Sub(*domainIssue.CreatedDate).Minutes())
+ domainIssue.LeadTimeMinutes = &temp
+ }
+ }
+ // FIXME we have no idea about how to calculate domainIssue.TimeRemainingMinutes and domainIssue.TimeSpentMinutes.
if request.CreatorId != "" {
domainIssue.CreatorId = fmt.Sprintf("%s:%d:%s", "webhook", connection.ID, request.CreatorId)
}