MCPcopy Index your code
hub / github.com/apache/devlake / addGithub

Function addGithub

backend/plugins/github/api/blueprint_v200.go:198–229  ·  view source on GitHub ↗
(
	subtaskMetas []plugin.SubTaskMeta,
	connection *models.GithubConnection,
	entities []string,
	stage coreModels.PipelineStage,
	options *tasks.GithubOptions,
)

Source from the content-addressed store, hash-verified

196}
197
198func addGithub(
199 subtaskMetas []plugin.SubTaskMeta,
200 connection *models.GithubConnection,
201 entities []string,
202 stage coreModels.PipelineStage,
203 options *tasks.GithubOptions,
204) (coreModels.PipelineStage, errors.Error) {
205 // construct github(graphql) task
206 if connection.EnableGraphql {
207 // FIXME this need fix when 2 plugins merged
208 p, err := plugin.GetPlugin(`github_graphql`)
209 if err != nil {
210 return nil, err
211 }
212 if pluginGq, ok := p.(plugin.PluginTask); ok {
213 task, err := helper.MakePipelinePlanTask("github_graphql", pluginGq.SubTaskMetas(), entities, options)
214 if err != nil {
215 return nil, err
216 }
217 stage = append(stage, task)
218 } else {
219 return nil, errors.BadInput.New("plugin github_graphql does not support SubTaskMetas")
220 }
221 } else {
222 task, err := helper.MakePipelinePlanTask("github", subtaskMetas, entities, options)
223 if err != nil {
224 return nil, err
225 }
226 stage = append(stage, task)
227 }
228 return stage, nil
229}
230
231func getApiRepo(
232 op *tasks.GithubOptions,

Callers 1

Calls 3

GetPluginMethod · 0.80
SubTaskMetasMethod · 0.65
NewMethod · 0.65

Tested by

no test coverage detected