Skip to content

Commit

Permalink
fix(ci): Remove OrderBy field from pipeline list options
Browse files Browse the repository at this point in the history
This field is not supported in GitLab 11.11. This doesn't allow this
command to be run against this version of GitLab.

Since this ordering is not that important easiest is just to remove it.

See: https://docs.gitlab.com/11.11/ee/api/pipelines.html#list-project-pipelines

Fixes profclems#335
  • Loading branch information
zemzale committed Nov 28, 2020
1 parent f1c3ee8 commit 9de907e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions commands/pipeline/ci/trace/pipeline_ci_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ func TraceCmdFunc(cmd *cobra.Command, args []string, f *cmdutils.Factory) error
jobID = utils.StringToInt(args[0])
} else {
l := &gitlab.ListProjectPipelinesOptions{
Ref: gitlab.String(branch),
OrderBy: gitlab.String("updated_at"),
Sort: gitlab.String("desc"),
Ref: gitlab.String(branch),
Sort: gitlab.String("desc"),
}

l.Page = 1
Expand Down
5 changes: 2 additions & 3 deletions commands/pipeline/status/pipeline_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ func NewCmdStatus(f *cmdutils.Factory) *cobra.Command {
}
}
l := &gitlab.ListProjectPipelinesOptions{
Ref: gitlab.String(branch),
OrderBy: gitlab.String("updated_at"),
Sort: gitlab.String("desc"),
Ref: gitlab.String(branch),
Sort: gitlab.String("desc"),
}
l.Page = 1
l.PerPage = 1
Expand Down
5 changes: 2 additions & 3 deletions pkg/api/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,8 @@ var GetPipelineFromBranch = func(client *gitlab.Client, ref, repo string) ([]*gi
}
}
l := &gitlab.ListProjectPipelinesOptions{
Ref: gitlab.String(ref),
OrderBy: gitlab.String("updated_at"),
Sort: gitlab.String("desc"),
Ref: gitlab.String(ref),
Sort: gitlab.String("desc"),
}
l.Page = 1
l.PerPage = 1
Expand Down

0 comments on commit 9de907e

Please sign in to comment.