Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
930f8257
Unverified
Commit
930f8257
authored
Aug 19, 2019
by
Sander van Harmelen
Committed by
GitHub
Aug 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #666 from alexkalderimis/add-head-pipeline
Add new pipeline fields
parents
34a5cacb
642cbc29
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
88 deletions
+83
-88
merge_requests.go
merge_requests.go
+59
-80
pipelines.go
pipelines.go
+24
-8
No files found.
merge_requests.go
View file @
930f8257
...
@@ -34,74 +34,43 @@ type MergeRequestsService struct {
...
@@ -34,74 +34,43 @@ type MergeRequestsService struct {
//
//
// GitLab API docs: https://docs.gitlab.com/ce/api/merge_requests.html
// GitLab API docs: https://docs.gitlab.com/ce/api/merge_requests.html
type
MergeRequest
struct
{
type
MergeRequest
struct
{
ID
int
`json:"id"`
ID
int
`json:"id"`
IID
int
`json:"iid"`
IID
int
`json:"iid"`
TargetBranch
string
`json:"target_branch"`
TargetBranch
string
`json:"target_branch"`
SourceBranch
string
`json:"source_branch"`
SourceBranch
string
`json:"source_branch"`
ProjectID
int
`json:"project_id"`
ProjectID
int
`json:"project_id"`
Title
string
`json:"title"`
Title
string
`json:"title"`
State
string
`json:"state"`
State
string
`json:"state"`
CreatedAt
*
time
.
Time
`json:"created_at"`
CreatedAt
*
time
.
Time
`json:"created_at"`
UpdatedAt
*
time
.
Time
`json:"updated_at"`
UpdatedAt
*
time
.
Time
`json:"updated_at"`
Upvotes
int
`json:"upvotes"`
Upvotes
int
`json:"upvotes"`
Downvotes
int
`json:"downvotes"`
Downvotes
int
`json:"downvotes"`
Author
struct
{
Author
*
MergeRequestUser
`json:"author"`
ID
int
`json:"id"`
Assignee
*
MergeRequestUser
`json:"assignee"`
Username
string
`json:"username"`
Assignees
[]
*
MergeRequestUser
`json:"assignees"`
Name
string
`json:"name"`
SourceProjectID
int
`json:"source_project_id"`
State
string
`json:"state"`
TargetProjectID
int
`json:"target_project_id"`
CreatedAt
*
time
.
Time
`json:"created_at"`
Labels
[]
string
`json:"labels"`
AvatarURL
string
`json:"avatar_url"`
Description
string
`json:"description"`
WebURL
string
`json:"web_url"`
WorkInProgress
bool
`json:"work_in_progress"`
}
`json:"author"`
Milestone
*
Milestone
`json:"milestone"`
Assignee
struct
{
MergeWhenPipelineSucceeds
bool
`json:"merge_when_pipeline_succeeds"`
ID
int
`json:"id"`
MergeStatus
string
`json:"merge_status"`
Username
string
`json:"username"`
MergeError
string
`json:"merge_error"`
Name
string
`json:"name"`
MergedBy
*
MergeRequestUser
`json:"merged_by"`
State
string
`json:"state"`
MergedAt
*
time
.
Time
`json:"merged_at"`
CreatedAt
*
time
.
Time
`json:"created_at"`
ClosedBy
*
MergeRequestUser
`json:"closed_by"`
AvatarURL
string
`json:"avatar_url"`
ClosedAt
*
time
.
Time
`json:"closed_at"`
WebURL
string
`json:"web_url"`
Subscribed
bool
`json:"subscribed"`
}
`json:"assignee"`
SHA
string
`json:"sha"`
SourceProjectID
int
`json:"source_project_id"`
MergeCommitSHA
string
`json:"merge_commit_sha"`
TargetProjectID
int
`json:"target_project_id"`
UserNotesCount
int
`json:"user_notes_count"`
Labels
[]
string
`json:"labels"`
ChangesCount
string
`json:"changes_count"`
Description
string
`json:"description"`
ShouldRemoveSourceBranch
bool
`json:"should_remove_source_branch"`
WorkInProgress
bool
`json:"work_in_progress"`
ForceRemoveSourceBranch
bool
`json:"force_remove_source_branch"`
Milestone
*
Milestone
`json:"milestone"`
WebURL
string
`json:"web_url"`
MergeWhenPipelineSucceeds
bool
`json:"merge_when_pipeline_succeeds"`
DiscussionLocked
bool
`json:"discussion_locked"`
MergeStatus
string
`json:"merge_status"`
Changes
[]
struct
{
MergeError
string
`json:"merge_error"`
MergedBy
struct
{
ID
int
`json:"id"`
Username
string
`json:"username"`
Name
string
`json:"name"`
State
string
`json:"state"`
CreatedAt
*
time
.
Time
`json:"created_at"`
AvatarURL
string
`json:"avatar_url"`
WebURL
string
`json:"web_url"`
}
`json:"merged_by"`
MergedAt
*
time
.
Time
`json:"merged_at"`
ClosedBy
struct
{
ID
int
`json:"id"`
Username
string
`json:"username"`
Name
string
`json:"name"`
State
string
`json:"state"`
CreatedAt
*
time
.
Time
`json:"created_at"`
AvatarURL
string
`json:"avatar_url"`
WebURL
string
`json:"web_url"`
}
`json:"closed_by"`
ClosedAt
*
time
.
Time
`json:"closed_at"`
Subscribed
bool
`json:"subscribed"`
SHA
string
`json:"sha"`
MergeCommitSHA
string
`json:"merge_commit_sha"`
UserNotesCount
int
`json:"user_notes_count"`
ChangesCount
string
`json:"changes_count"`
ShouldRemoveSourceBranch
bool
`json:"should_remove_source_branch"`
ForceRemoveSourceBranch
bool
`json:"force_remove_source_branch"`
WebURL
string
`json:"web_url"`
DiscussionLocked
bool
`json:"discussion_locked"`
Changes
[]
struct
{
OldPath
string
`json:"old_path"`
OldPath
string
`json:"old_path"`
NewPath
string
`json:"new_path"`
NewPath
string
`json:"new_path"`
AMode
string
`json:"a_mode"`
AMode
string
`json:"a_mode"`
...
@@ -111,22 +80,32 @@ type MergeRequest struct {
...
@@ -111,22 +80,32 @@ type MergeRequest struct {
RenamedFile
bool
`json:"renamed_file"`
RenamedFile
bool
`json:"renamed_file"`
DeletedFile
bool
`json:"deleted_file"`
DeletedFile
bool
`json:"deleted_file"`
}
`json:"changes"`
}
`json:"changes"`
TimeStats
*
TimeStats
`json:"time_stats"`
TimeStats
*
TimeStats
`json:"time_stats"`
Squash
bool
`json:"squash"`
Squash
bool
`json:"squash"`
Pipeline
struct
{
Pipeline
*
PipelineInfo
`json:"pipeline"`
ID
int
`json:"id"`
HeadPipeline
*
Pipeline
`json:"head_pipeline"`
Ref
string
`json:"ref"`
DiffRefs
struct
{
SHA
string
`json:"sha"`
Status
string
`json:"status"`
}
`json:"pipeline"`
DiffRefs
struct
{
BaseSha
string
`json:"base_sha"`
BaseSha
string
`json:"base_sha"`
HeadSha
string
`json:"head_sha"`
HeadSha
string
`json:"head_sha"`
StartSha
string
`json:"start_sha"`
StartSha
string
`json:"start_sha"`
}
`json:"diff_refs"`
}
`json:"diff_refs"`
DivergedCommitsCount
int
`json:"diverged_commits_count"`
DivergedCommitsCount
int
`json:"diverged_commits_count"`
RebaseInProgress
bool
`json:"rebase_in_progress"`
RebaseInProgress
bool
`json:"rebase_in_progress"`
ApprovalsBeforeMerge
int
`json:"approvals_before_merge"`
ApprovalsBeforeMerge
int
`json:"approvals_before_merge"`
Reference
string
`json:"reference"`
}
// MergeRequestUser represents a GitLab User record within a MergeRequest
//
// GitLab API docs: https://docs.gitlab.com/ce/api/merge_requests.html
type
MergeRequestUser
struct
{
ID
int
`json:"id"`
Username
string
`json:"username"`
Name
string
`json:"name"`
State
string
`json:"state"`
CreatedAt
*
time
.
Time
`json:"created_at"`
AvatarURL
string
`json:"avatar_url"`
WebURL
string
`json:"web_url"`
}
}
func
(
m
MergeRequest
)
String
()
string
{
func
(
m
MergeRequest
)
String
()
string
{
...
...
pipelines.go
View file @
930f8257
...
@@ -56,14 +56,30 @@ type Pipeline struct {
...
@@ -56,14 +56,30 @@ type Pipeline struct {
AvatarURL
string
`json:"avatar_url"`
AvatarURL
string
`json:"avatar_url"`
WebURL
string
`json:"web_url"`
WebURL
string
`json:"web_url"`
}
}
UpdatedAt
*
time
.
Time
`json:"updated_at"`
UpdatedAt
*
time
.
Time
`json:"updated_at"`
CreatedAt
*
time
.
Time
`json:"created_at"`
CreatedAt
*
time
.
Time
`json:"created_at"`
StartedAt
*
time
.
Time
`json:"started_at"`
StartedAt
*
time
.
Time
`json:"started_at"`
FinishedAt
*
time
.
Time
`json:"finished_at"`
FinishedAt
*
time
.
Time
`json:"finished_at"`
CommittedAt
*
time
.
Time
`json:"committed_at"`
CommittedAt
*
time
.
Time
`json:"committed_at"`
Duration
int
`json:"duration"`
Duration
int
`json:"duration"`
Coverage
string
`json:"coverage"`
Coverage
string
`json:"coverage"`
WebURL
string
`json:"web_url"`
WebURL
string
`json:"web_url"`
DetailedStatus
*
DetailedStatus
`json:"detailed_status"`
}
// DetailedStatus contains detailed information about the status of a pipeline
type
DetailedStatus
struct
{
Icon
string
`json:"icon"`
Text
string
`json:"text"`
Label
string
`json:"label"`
Group
string
`json:"group"`
Tooltip
string
`json:"tooltip"`
HasDetails
bool
`json:"has_details"`
DetailsPath
string
`json:"details_path"`
Illustration
*
struct
{
Image
string
`json:"image"`
}
`json:"illustration"`
Favicon
string
`json:"favicon"`
}
}
func
(
i
Pipeline
)
String
()
string
{
func
(
i
Pipeline
)
String
()
string
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment