1
0
Fork 0
forked from forgejo/forgejo

Vendor Update (#14496)

* update code.gitea.io/sdk/gitea v0.13.1 -> v0.13.2

* update github.com/go-swagger/go-swagger v0.25.0 -> v0.26.0

* update github.com/google/uuid v1.1.2 -> v1.2.0

* update github.com/klauspost/compress v1.11.3 -> v1.11.7

* update github.com/lib/pq 083382b7e6fc -> v1.9.0

* update github.com/markbates/goth v1.65.0 -> v1.66.1

* update github.com/mattn/go-sqlite3 v1.14.4 -> v1.14.6

* update github.com/mgechev/revive 246eac737dc7 -> v1.0.3

* update github.com/minio/minio-go/v7 v7.0.6 -> v7.0.7

* update github.com/niklasfasching/go-org v1.3.2 -> v1.4.0

* update github.com/olivere/elastic/v7 v7.0.21 -> v7.0.22

* update github.com/pquerna/otp v1.2.0 -> v1.3.0

* update github.com/xanzy/go-gitlab v0.39.0 -> v0.42.0

* update github.com/yuin/goldmark v1.2.1 -> v1.3.1
This commit is contained in:
6543 2021-01-28 17:56:38 +01:00 committed by GitHub
parent e45bf12a34
commit d1353e1f7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
403 changed files with 29737 additions and 14357 deletions

View file

@ -19,7 +19,6 @@ package gitlab
import (
"bytes"
"fmt"
"io"
"time"
)
@ -76,6 +75,29 @@ type Job struct {
User *User `json:"user"`
}
// Bridge represents a pipeline bridge.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/jobs.html#list-pipeline-bridges
type Bridge struct {
Commit *Commit `json:"commit"`
Coverage float64 `json:"coverage"`
AllowFailure bool `json:"allow_failure"`
CreatedAt *time.Time `json:"created_at"`
StartedAt *time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at"`
Duration float64 `json:"duration"`
ID int `json:"id"`
Name string `json:"name"`
Pipeline PipelineInfo `json:"pipeline"`
Ref string `json:"ref"`
Stage string `json:"stage"`
Status string `json:"status"`
Tag bool `json:"tag"`
WebURL string `json:"web_url"`
User *User `json:"user"`
DownstreamPipeline *PipelineInfo `json:"downstream_pipeline"`
}
// ListJobsOptions are options for two list apis
type ListJobsOptions struct {
ListOptions
@ -89,7 +111,7 @@ type ListJobsOptions struct {
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/jobs.html#list-project-jobs
func (s *JobsService) ListProjectJobs(pid interface{}, opts *ListJobsOptions, options ...RequestOptionFunc) ([]Job, *Response, error) {
func (s *JobsService) ListProjectJobs(pid interface{}, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Job, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@ -101,7 +123,7 @@ func (s *JobsService) ListProjectJobs(pid interface{}, opts *ListJobsOptions, op
return nil, nil, err
}
var jobs []Job
var jobs []*Job
resp, err := s.client.Do(req, &jobs)
if err != nil {
return nil, resp, err
@ -136,6 +158,32 @@ func (s *JobsService) ListPipelineJobs(pid interface{}, pipelineID int, opts *Li
return jobs, resp, err
}
// ListPipelineBridges gets a list of bridges for specific pipeline in a
// project.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/jobs.html#list-pipeline-jobs
func (s *JobsService) ListPipelineBridges(pid interface{}, pipelineID int, opts *ListJobsOptions, options ...RequestOptionFunc) ([]*Bridge, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("projects/%s/pipelines/%d/bridges", pathEscape(project), pipelineID)
req, err := s.client.NewRequest("GET", u, opts, options)
if err != nil {
return nil, nil, err
}
var bridges []*Bridge
resp, err := s.client.Do(req, &bridges)
if err != nil {
return nil, resp, err
}
return bridges, resp, err
}
// GetJob gets a single job of a project.
//
// GitLab API docs:
@ -165,7 +213,7 @@ func (s *JobsService) GetJob(pid interface{}, jobID int, options ...RequestOptio
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/job_artifacts.html#get-job-artifacts
func (s *JobsService) GetJobArtifacts(pid interface{}, jobID int, options ...RequestOptionFunc) (io.Reader, *Response, error) {
func (s *JobsService) GetJobArtifacts(pid interface{}, jobID int, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@ -183,7 +231,7 @@ func (s *JobsService) GetJobArtifacts(pid interface{}, jobID int, options ...Req
return nil, resp, err
}
return artifactsBuf, resp, err
return bytes.NewReader(artifactsBuf.Bytes()), resp, err
}
// DownloadArtifactsFileOptions represents the available DownloadArtifactsFile()
@ -200,7 +248,7 @@ type DownloadArtifactsFileOptions struct {
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/job_artifacts.html#download-the-artifacts-archive
func (s *JobsService) DownloadArtifactsFile(pid interface{}, refName string, opt *DownloadArtifactsFileOptions, options ...RequestOptionFunc) (io.Reader, *Response, error) {
func (s *JobsService) DownloadArtifactsFile(pid interface{}, refName string, opt *DownloadArtifactsFileOptions, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@ -218,7 +266,7 @@ func (s *JobsService) DownloadArtifactsFile(pid interface{}, refName string, opt
return nil, resp, err
}
return artifactsBuf, resp, err
return bytes.NewReader(artifactsBuf.Bytes()), resp, err
}
// DownloadSingleArtifactsFile download a file from the artifacts from the
@ -228,7 +276,7 @@ func (s *JobsService) DownloadArtifactsFile(pid interface{}, refName string, opt
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/job_artifacts.html#download-a-single-artifact-file-by-job-id
func (s *JobsService) DownloadSingleArtifactsFile(pid interface{}, jobID int, artifactPath string, options ...RequestOptionFunc) (io.Reader, *Response, error) {
func (s *JobsService) DownloadSingleArtifactsFile(pid interface{}, jobID int, artifactPath string, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@ -252,14 +300,14 @@ func (s *JobsService) DownloadSingleArtifactsFile(pid interface{}, jobID int, ar
return nil, resp, err
}
return artifactBuf, resp, err
return bytes.NewReader(artifactBuf.Bytes()), resp, err
}
// GetTraceFile gets a trace of a specific job of a project
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/jobs.html#get-a-trace-file
func (s *JobsService) GetTraceFile(pid interface{}, jobID int, options ...RequestOptionFunc) (io.Reader, *Response, error) {
func (s *JobsService) GetTraceFile(pid interface{}, jobID int, options ...RequestOptionFunc) (*bytes.Reader, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@ -277,7 +325,7 @@ func (s *JobsService) GetTraceFile(pid interface{}, jobID int, options ...Reques
return nil, resp, err
}
return traceBuf, resp, err
return bytes.NewReader(traceBuf.Bytes()), resp, err
}
// CancelJob cancels a single job of a project.