Skip to content

Commit

Permalink
fix: add jira jql checker debug log (#7376)
Browse files Browse the repository at this point in the history
  • Loading branch information
abeizn authored and action_bot committed Apr 25, 2024
1 parent 154d4f5 commit a3c8c22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions backend/plugins/jira/tasks/board_filter_begin_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,19 @@ func CollectBoardFilterBegin(taskCtx plugin.SubTaskContext) errors.Error {
if err != nil {
return errors.Default.Wrap(err, fmt.Sprintf("error updating record in _tool_jira_boards table for connection_id:%d board_id:%d", data.Options.ConnectionId, data.Options.BoardId))
}
logger.Info("full sync mode, update jql to %s", record.Jql)
}
return nil
}

// first run
if record.Jql == "" {
record.Jql = jql
err = db.Update(&record, dal.Where("connection_id = ? AND board_id = ? ", data.Options.ConnectionId, data.Options.BoardId))
if err != nil {
return errors.Default.Wrap(err, fmt.Sprintf("error updating record in _tool_jira_boards table for connection_id:%d board_id:%d", data.Options.ConnectionId, data.Options.BoardId))
}
logger.Info("first run, update jql to %s", record.Jql)
return nil
}
// change
Expand Down
3 changes: 1 addition & 2 deletions backend/plugins/jira/tasks/board_filter_end_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ func CollectBoardFilterEnd(taskCtx plugin.SubTaskContext) errors.Error {
if err != nil {
return errors.Default.Wrap(err, fmt.Sprintf("error getting board filter jql for connection_id:%d board_id:%d", data.Options.ConnectionId, data.Options.BoardId))
}
logger.Info("collect board filter jql:%s", filterInfo.Jql)

jql := filterInfo.Jql
logger.Info("collect board filter jql:%s", jql)

Expand All @@ -63,6 +61,7 @@ func CollectBoardFilterEnd(taskCtx plugin.SubTaskContext) errors.Error {
if err != nil {
return errors.Default.Wrap(err, fmt.Sprintf("error finding record in _tool_jira_boards table for connection_id:%d board_id:%d", data.Options.ConnectionId, data.Options.BoardId))
}
logger.Info("get board filter jql:%s", record.Jql)

if record.Jql != jql {
return errors.Default.New(fmt.Sprintf("connection_id:%d board_id:%d filter jql has changed, please use fullSync mode. And the previous jql is %s, now jql is %s", data.Options.ConnectionId, data.Options.BoardId, record.Jql, jql))
Expand Down

0 comments on commit a3c8c22

Please sign in to comment.