Skip to content

Commit

Permalink
refactor(gitlab): remove unused codes
Browse files Browse the repository at this point in the history
  • Loading branch information
d4x1 committed Oct 16, 2023
1 parent 1278b30 commit 67199aa
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions backend/plugins/gitlab/tasks/deployment_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ limitations under the License.
package tasks

import (
"fmt"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/plugin"
helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
"net/url"
"time"
)

var _ plugin.SubTaskEntryPoint = CollectDeployment
Expand Down Expand Up @@ -62,40 +59,3 @@ func CollectDeployment(taskCtx plugin.SubTaskContext) errors.Error {
}
return collector.Execute()
}

func IncrementalCollectDeployment(taskCtx plugin.SubTaskContext) errors.Error {
rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_DEPLOYMENT)
collectorWithState, err := helper.NewStatefulApiCollector(*rawDataSubTaskArgs)
if err != nil {
return err
}
err = collectorWithState.InitCollector(helper.ApiCollectorArgs{
RawDataSubTaskArgs: *rawDataSubTaskArgs,
ApiClient: data.ApiClient,
PageSize: 100,
UrlTemplate: "projects/{{ .Params.ProjectId }}/deployments",
Query: func(reqData *helper.RequestData) (url.Values, errors.Error) {
query, err := GetQuery(reqData)
if err != nil {
return query, err
}
// https://gitlab.com/gitlab-org/gitlab/-/issues/328500
// https://docs.gitlab.com/ee/api/deployments.html#list-project-deployments
query.Set("order_by", "updated_at")
if collectorWithState.Since != nil {
query.Set("updated_after", collectorWithState.Since.Format(time.RFC3339))
}
if collectorWithState.Before != nil {
query.Set("updated_before", collectorWithState.Before.Format(time.RFC3339))
}
fmt.Printf("query: %+v\n", query)
return query, nil
},
GetTotalPages: GetTotalPagesFromResponse,
ResponseParser: GetRawMessageFromResponse,
})
if err != nil {
return err
}
return collectorWithState.Execute()
}

0 comments on commit 67199aa

Please sign in to comment.