Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions backend/helpers/pluginhelper/api/pipeline_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ package api

import (
"fmt"
"strconv"
"strings"

"github.com/apache/incubator-devlake/core/config"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/models"
plugin "github.com/apache/incubator-devlake/core/plugin"
Expand Down Expand Up @@ -60,6 +63,25 @@ func MakePipelinePlanTask(
entities []string,
options interface{},
) (*models.PipelineTask, errors.Error) {
// get subtasks enabled by default
cfg := config.GetConfig()
enableSubtasksByDefault := cfg.GetString("ENABLE_SUBTASKS_BY_DEFAULT")
enableSubtasksList := strings.Split(enableSubtasksByDefault, ",")
for s := range subtaskMetas {
compareName := pluginName + ":" + subtaskMetas[s].Name
for _, enableSubtask := range enableSubtasksList {
subtaskInfo := strings.Split(enableSubtask, ":")
subtaskInfoName := subtaskInfo[0] + ":" + subtaskInfo[1]
if len(subtaskInfo) > 2 && (subtaskInfoName == compareName) {
v, err := strconv.ParseBool(subtaskInfo[2])
if err != nil {
break
}
subtaskMetas[s].EnabledByDefault = v
}
}
}

subtasks, err := MakePipelinePlanSubtasks(subtaskMetas, entities)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/jira/tasks/issue_changelog_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const RAW_CHANGELOG_TABLE = "jira_api_issue_changelogs"
var CollectIssueChangelogsMeta = plugin.SubTaskMeta{
Name: "collectIssueChangelogs",
EntryPoint: CollectIssueChangelogs,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "collect Jira Issue change logs, supports both timeFilter and diffSync.",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET, plugin.DOMAIN_TYPE_CROSS},
}
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/jira/tasks/issue_changelog_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var validID = regexp.MustCompile(`[0-9]+`)
var ConvertIssueChangelogsMeta = plugin.SubTaskMeta{
Name: "convertIssueChangelogs",
EntryPoint: ConvertIssueChangelogs,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "convert Jira Issue change logs",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET, plugin.DOMAIN_TYPE_CROSS},
}
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/jira/tasks/issue_changelog_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var _ plugin.SubTaskEntryPoint = ExtractIssueChangelogs
var ExtractIssueChangelogsMeta = plugin.SubTaskMeta{
Name: "extractIssueChangelogs",
EntryPoint: ExtractIssueChangelogs,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "extract Jira Issue change logs",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET, plugin.DOMAIN_TYPE_CROSS},
}
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/tapd/tasks/bug_changelog_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func CollectBugChangelogs(taskCtx plugin.SubTaskContext) errors.Error {
var CollectBugChangelogMeta = plugin.SubTaskMeta{
Name: "collectBugChangelogs",
EntryPoint: CollectBugChangelogs,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "collect Tapd bugChangelogs",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
2 changes: 1 addition & 1 deletion backend/plugins/tapd/tasks/bug_changelog_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func ConvertBugChangelog(taskCtx plugin.SubTaskContext) errors.Error {
var ConvertBugChangelogMeta = plugin.SubTaskMeta{
Name: "convertBugChangelog",
EntryPoint: ConvertBugChangelog,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "convert Tapd bug changelog",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
3 changes: 2 additions & 1 deletion backend/plugins/tapd/tasks/bug_changelog_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package tasks

import (
"encoding/json"

"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/plugin"
"github.com/apache/incubator-devlake/helpers/pluginhelper/api"
Expand All @@ -30,7 +31,7 @@ var _ plugin.SubTaskEntryPoint = ExtractBugChangelog
var ExtractBugChangelogMeta = plugin.SubTaskMeta{
Name: "extractBugChangelog",
EntryPoint: ExtractBugChangelog,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "Extract raw workspace data into tool layer table _tool_tapd_bug_changelogs",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/zentao/tasks/bug_repo_commits_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var _ plugin.SubTaskEntryPoint = CollectBugRepoCommits
var CollectBugRepoCommitsMeta = plugin.SubTaskMeta{
Name: "collectBugRepoCommits",
EntryPoint: CollectBugRepoCommits,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "Collect Bug Repo Commits data from Zentao api",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/zentao/tasks/bug_repo_commits_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var _ plugin.SubTaskEntryPoint = ConvertBugRepoCommits
var ConvertBugRepoCommitsMeta = plugin.SubTaskMeta{
Name: "convertBugRepoCommits",
EntryPoint: ConvertBugRepoCommits,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "convert Zentao bug repo commits",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/zentao/tasks/bug_repo_commits_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var _ plugin.SubTaskEntryPoint = ExtractBugRepoCommits
var ExtractBugRepoCommitsMeta = plugin.SubTaskMeta{
Name: "extractBugRepoCommits",
EntryPoint: ExtractBugRepoCommits,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "extract Zentao bug repo commits",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var _ plugin.SubTaskEntryPoint = CollectStoryRepoCommits
var CollectStoryRepoCommitsMeta = plugin.SubTaskMeta{
Name: "collectStoryRepoCommits",
EntryPoint: CollectStoryRepoCommits,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "Collect Story Repo Commits data from Zentao api",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
Expand Down
5 changes: 3 additions & 2 deletions backend/plugins/zentao/tasks/story_repo_commits_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ limitations under the License.
package tasks

import (
"github.com/spf13/cast"
"reflect"

"github.com/spf13/cast"

"github.com/apache/incubator-devlake/core/dal"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/models/domainlayer/crossdomain"
Expand All @@ -35,7 +36,7 @@ var _ plugin.SubTaskEntryPoint = ConvertStoryRepoCommits
var ConvertStoryRepoCommitsMeta = plugin.SubTaskMeta{
Name: "convertStoryRepoCommits",
EntryPoint: ConvertStoryRepoCommits,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "convert Zentao story repo commits",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
Expand Down
3 changes: 2 additions & 1 deletion backend/plugins/zentao/tasks/story_repo_commits_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package tasks

import (
"encoding/json"

"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/plugin"
"github.com/apache/incubator-devlake/helpers/pluginhelper/api"
Expand All @@ -30,7 +31,7 @@ var _ plugin.SubTaskEntryPoint = ExtractStoryRepoCommits
var ExtractStoryRepoCommitsMeta = plugin.SubTaskMeta{
Name: "extractStoryRepoCommits",
EntryPoint: ExtractStoryRepoCommits,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "extract Zentao story repo commits",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var _ plugin.SubTaskEntryPoint = CollectTaskRepoCommits
var CollectTaskRepoCommitsMeta = plugin.SubTaskMeta{
Name: "collectTaskRepoCommits",
EntryPoint: CollectTaskRepoCommits,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "Collect Task Repo Commits data from Zentao api",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
Expand Down
5 changes: 3 additions & 2 deletions backend/plugins/zentao/tasks/task_repo_commits_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ limitations under the License.
package tasks

import (
"github.com/spf13/cast"
"reflect"

"github.com/spf13/cast"

"github.com/apache/incubator-devlake/core/dal"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/models/domainlayer/crossdomain"
Expand All @@ -35,7 +36,7 @@ var _ plugin.SubTaskEntryPoint = ConvertTaskRepoCommits
var ConvertTaskRepoCommitsMeta = plugin.SubTaskMeta{
Name: "convertTaskRepoCommits",
EntryPoint: ConvertTaskRepoCommits,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "convert Zentao task repo commits",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
Expand Down
3 changes: 2 additions & 1 deletion backend/plugins/zentao/tasks/task_repo_commits_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package tasks

import (
"encoding/json"

"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/plugin"
"github.com/apache/incubator-devlake/helpers/pluginhelper/api"
Expand All @@ -30,7 +31,7 @@ var _ plugin.SubTaskEntryPoint = ExtractTaskRepoCommits
var ExtractTaskRepoCommitsMeta = plugin.SubTaskMeta{
Name: "extractTaskRepoCommits",
EntryPoint: ExtractTaskRepoCommits,
EnabledByDefault: true,
EnabledByDefault: false,
Description: "extract Zentao task repo commits",
DomainTypes: []string{plugin.DOMAIN_TYPE_TICKET},
}
Expand Down
3 changes: 3 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ SKIP_COMMIT_FILES=true
# Set if response error when requesting /connections/{connection_id}/test should be wrapped or not
##########################
WRAP_RESPONSE_ERROR=

# Enable subtasks by default: plugin_name:subtask_name:enabled
ENABLE_SUBTASKS_BY_DEFAULT="jira:collectIssueChangelogs:true,jira:extractIssueChangelogs:true,jira:convertIssueChangelogs:true,tapd:collectBugChangelogs:true,tapd:extractBugChangelogs:true,tapd:convertBugChangelogs:true,zentao:collectBugRepoCommits:true,zentao:extractBugRepoCommits:true,zentao:convertBugRepoCommits:true,zentao:collectStoryRepoCommits:true,zentao:extractStoryRepoCommits:true,zentao:convertStoryRepoCommits:true,zentao:collectTaskRepoCommits:true,zentao:extractTaskRepoCommits:true,zentao:convertTaskRepoCommits:true"