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
ee48e93a
Commit
ee48e93a
authored
Nov 17, 2017
by
Sander van Harmelen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixup the `MergeRequest` and `MergeCommentEvent` structs
parent
b0143419
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
69 deletions
+67
-69
events.go
events.go
+37
-42
merge_requests.go
merge_requests.go
+30
-27
No files found.
events.go
View file @
ee48e93a
...
...
@@ -213,7 +213,6 @@ type MergeCommentEvent struct {
WebURL
string
`json:"web_url"`
Visibility
VisibilityValue
`json:"visibility"`
}
`json:"project"`
Repository
*
Repository
`json:"repository"`
ObjectAttributes
struct
{
ID
int
`json:"id"`
Note
string
`json:"note"`
...
...
@@ -230,57 +229,53 @@ type MergeCommentEvent struct {
StDiff
*
Diff
`json:"st_diff"`
URL
string
`json:"url"`
}
`json:"object_attributes"`
Repository
*
Repository
`json:"repository"`
MergeRequest
struct
{
ID
int
`json:"id"`
TargetBranch
string
`json:"target_branch"`
SourceBranch
string
`json:"source_branch"`
SourceProjectID
int
`json:"source_project_id"`
AuthorID
int
`json:"author_id"`
AssigneeID
int
`json:"assignee_id"`
Title
string
`json:"title"`
CreatedAt
string
`json:"created_at"`
// Should be *time.Time (see Gitlab issue #21468)
UpdatedAt
string
`json:"updated_at"`
// Should be *time.Time (see Gitlab issue #21468)
StCommits
[]
*
Commit
`json:"st_commits"`
StDiffs
[]
*
Diff
`json:"st_diffs"`
MilestoneID
int
`json:"milestone_id"`
State
string
`json:"state"`
MergeStatus
string
`json:"merge_status"`
TargetProjectID
int
`json:"target_project_id"`
Iid
int
`json:"iid"`
Description
string
`json:"description"`
Position
int
`json:"position"`
LockedAt
string
`json:"locked_at"`
UpdatedByID
int
`json:"updated_by_id"`
MergeError
string
`json:"merge_error"`
ID
int
`json:"id"`
TargetBranch
string
`json:"target_branch"`
SourceBranch
string
`json:"source_branch"`
SourceProjectID
int
`json:"source_project_id"`
AuthorID
int
`json:"author_id"`
AssigneeID
int
`json:"assignee_id"`
Title
string
`json:"title"`
CreatedAt
string
`json:"created_at"`
UpdatedAt
string
`json:"updated_at"`
MilestoneID
int
`json:"milestone_id"`
State
string
`json:"state"`
MergeStatus
string
`json:"merge_status"`
TargetProjectID
int
`json:"target_project_id"`
IID
int
`json:"iid"`
Description
string
`json:"description"`
Position
int
`json:"position"`
LockedAt
string
`json:"locked_at"`
UpdatedByID
int
`json:"updated_by_id"`
MergeError
string
`json:"merge_error"`
MergeParams
struct
{
ForceRemoveSourceBranch
string
`json:"force_remove_source_branch"`
}
`json:"merge_params"`
MergeWhenBuildSucceeds
bool
`json:"merge_when_build_succeeds"`
MergeUserID
int
`json:"merge_user_id"`
MergeCommitSha
string
`json:"merge_commit_sha"`
DeletedAt
string
`json:"deleted_at"`
ApprovalsBeforeMerge
string
`json:"approvals_before_merge"`
RebaseCommitSha
string
`json:"rebase_commit_sha"`
InProgressMergeCommitSha
string
`json:"in_progress_merge_commit_sha"`
LockVersion
int
`json:"lock_version"`
TimeEstimate
int
`json:"time_estimate"`
Source
*
Repository
`json:"source"`
Target
*
Repository
`json:"target"`
LastCommit
struct
{
MergeWhenPipelineSucceeds
bool
`json:"merge_when_pipeline_succeeds"`
MergeUserID
int
`json:"merge_user_id"`
MergeCommitSha
string
`json:"merge_commit_sha"`
DeletedAt
string
`json:"deleted_at"`
InProgressMergeCommitSha
string
`json:"in_progress_merge_commit_sha"`
LockVersion
int
`json:"lock_version"`
ApprovalsBeforeMerge
string
`json:"approvals_before_merge"`
RebaseCommitSha
string
`json:"rebase_commit_sha"`
TimeEstimate
int
`json:"time_estimate"`
Squash
bool
`json:"squash"`
LastEditedAt
string
`json:"last_edited_at"`
LastEditedByID
int
`json:"last_edited_by_id"`
Source
*
Repository
`json:"source"`
Target
*
Repository
`json:"target"`
LastCommit
struct
{
ID
string
`json:"id"`
Message
string
`json:"message"`
Timestamp
*
time
.
Time
`json:"timestamp"`
URL
string
`json:"url"`
Author
*
Author
`json:"author"`
}
`json:"last_commit"`
WorkInProgress
bool
`json:"work_in_progress"`
URL
string
`json:"url"`
Action
string
`json:"action"`
Assignee
struct
{
Name
string
`json:"name"`
Username
string
`json:"username"`
AvatarURL
string
`json:"avatar_url"`
}
`json:"assignee"`
WorkInProgress
bool
`json:"work_in_progress"`
TotalTimeSpent
int
`json:"total_time_spent"`
}
`json:"merge_request"`
}
...
...
merge_requests.go
View file @
ee48e93a
...
...
@@ -35,39 +35,39 @@ type MergeRequestsService struct {
//
// GitLab API docs: https://docs.gitlab.com/ce/api/merge_requests.html
type
MergeRequest
struct
{
ID
int
`json:"id"`
IID
int
`json:"iid"`
ProjectID
int
`json:"project_id"`
Title
string
`json:"title"`
Description
string
`json:"description"`
WorkInProgress
bool
`json:"work_in_progress"`
State
string
`json:"state"`
CreatedAt
string
`json:"created_at"`
UpdatedAt
string
`json:"updated_at"`
TargetBranch
string
`json:"target_branch"`
SourceBranch
string
`json:"source_branch"`
Upvotes
int
`json:"upvotes"`
Downvotes
int
`json:"downvotes"`
Author
struct
{
Name
string
`json:"name"`
Username
string
`json:"username"`
ID
int
`json:"id"`
State
string
`json:"state"`
AvatarURL
string
`json:"avatar_url"`
ID
int
`json:"id"`
IID
int
`json:"iid"`
TargetBranch
string
`json:"target_branch"`
SourceBranch
string
`json:"source_branch"`
ProjectID
int
`json:"project_id"`
Title
string
`json:"title"`
State
string
`json:"state"`
CreatedAt
*
time
.
Time
`json:"created_at"`
UpdatedAt
*
time
.
Time
`json:"updated_at"`
Upvotes
int
`json:"upvotes"`
Downvotes
int
`json:"downvotes"`
Author
struct
{
ID
int
`json:"id"`
Username
string
`json:"username"`
Name
string
`json:"name"`
State
string
`json:"state"`
CreatedAt
*
time
.
Time
`json:"created_at"`
}
`json:"author"`
Assignee
struct
{
Name
string
`json:"name
"`
Username
string
`json:"username"`
ID
int
`json:"id
"`
State
string
`json:"state"`
AvatarURL
string
`json:"avatar_url
"`
ID
int
`json:"id
"`
Username
string
`json:"username"`
Name
string
`json:"name
"`
State
string
`json:"state"`
CreatedAt
*
time
.
Time
`json:"created_at
"`
}
`json:"assignee"`
SourceProjectID
int
`json:"source_project_id"`
TargetProjectID
int
`json:"target_project_id"`
Labels
[]
string
`json:"labels"`
Description
string
`json:"description"`
WorkInProgress
bool
`json:"work_in_progress"`
Milestone
struct
{
ID
int
`json:"id"`
I
id
int
`json:"iid"`
I
ID
int
`json:"iid"`
ProjectID
int
`json:"project_id"`
Title
string
`json:"title"`
Description
string
`json:"description"`
...
...
@@ -78,11 +78,15 @@ type MergeRequest struct {
}
`json:"milestone"`
MergeWhenPipelineSucceeds
bool
`json:"merge_when_pipeline_succeeds"`
MergeStatus
string
`json:"merge_status"`
SHA
string
`json:"sha"`
Subscribed
bool
`json:"subscribed"`
SHA
string
`json:"sha"`
MergeCommitShaSHA
string
`json:"merge_commit_sha"`
UserNotesCount
int
`json:"user_notes_count"`
ChangesCount
int
`json:"changes_count"`
SouldRemoveSourceBranch
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"`
NewPath
string
`json:"new_path"`
...
...
@@ -93,7 +97,6 @@ type MergeRequest struct {
RenamedFile
bool
`json:"renamed_file"`
DeletedFile
bool
`json:"deleted_file"`
}
`json:"changes"`
WebURL
string
`json:"web_url"`
}
func
(
m
MergeRequest
)
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