Commit ef66f24d authored by James Ramsay's avatar James Ramsay

Consistently use `SHA`

parent d3666a4c
...@@ -34,7 +34,7 @@ type Deployment struct { ...@@ -34,7 +34,7 @@ type Deployment struct {
ID int `json:"id"` ID int `json:"id"`
IID int `json:"iid"` IID int `json:"iid"`
Ref string `json:"ref"` Ref string `json:"ref"`
Sha string `json:"sha"` SHA string `json:"sha"`
CreatedAt *time.Time `json:"created_at"` CreatedAt *time.Time `json:"created_at"`
User *ProjectUser `json:"user"` User *ProjectUser `json:"user"`
Environment *Environment `json:"environment"` Environment *Environment `json:"environment"`
...@@ -54,7 +54,7 @@ type Deployment struct { ...@@ -54,7 +54,7 @@ type Deployment struct {
Commit *Commit `json:"commit"` Commit *Commit `json:"commit"`
Pipeline struct { Pipeline struct {
ID int `json:"id"` ID int `json:"id"`
Sha string `json:"sha"` SHA string `json:"sha"`
Ref string `json:"ref"` Ref string `json:"ref"`
Status string `json:"status"` Status string `json:"status"`
} `json:"pipeline"` } `json:"pipeline"`
......
...@@ -1236,7 +1236,7 @@ func TestParseBuildHook(t *testing.T) { ...@@ -1236,7 +1236,7 @@ func TestParseBuildHook(t *testing.T) {
t.Errorf("BuildAllowFailure is %v, want %v", event.BuildAllowFailure, false) t.Errorf("BuildAllowFailure is %v, want %v", event.BuildAllowFailure, false)
} }
if event.Commit.Sha != "2293ada6b400935a1378653304eaf6221e0fdb8f" { if event.Commit.SHA != "2293ada6b400935a1378653304eaf6221e0fdb8f" {
t.Errorf("Commit SHA is %v, want %v", event.Commit.Sha, "2293ada6b400935a1378653304eaf6221e0fdb8f") t.Errorf("Commit SHA is %v, want %v", event.Commit.SHA, "2293ada6b400935a1378653304eaf6221e0fdb8f")
} }
} }
...@@ -29,7 +29,7 @@ type PushEvent struct { ...@@ -29,7 +29,7 @@ type PushEvent struct {
Before string `json:"before"` Before string `json:"before"`
After string `json:"after"` After string `json:"after"`
Ref string `json:"ref"` Ref string `json:"ref"`
CheckoutSha string `json:"checkout_sha"` CheckoutSHA string `json:"checkout_sha"`
UserID int `json:"user_id"` UserID int `json:"user_id"`
UserName string `json:"user_name"` UserName string `json:"user_name"`
UserEmail string `json:"user_email"` UserEmail string `json:"user_email"`
...@@ -77,7 +77,7 @@ type TagEvent struct { ...@@ -77,7 +77,7 @@ type TagEvent struct {
Before string `json:"before"` Before string `json:"before"`
After string `json:"after"` After string `json:"after"`
Ref string `json:"ref"` Ref string `json:"ref"`
CheckoutSha string `json:"checkout_sha"` CheckoutSHA string `json:"checkout_sha"`
UserID int `json:"user_id"` UserID int `json:"user_id"`
UserName string `json:"user_name"` UserName string `json:"user_name"`
UserAvatar string `json:"user_avatar"` UserAvatar string `json:"user_avatar"`
...@@ -290,12 +290,12 @@ type MergeCommentEvent struct { ...@@ -290,12 +290,12 @@ type MergeCommentEvent struct {
} `json:"merge_params"` } `json:"merge_params"`
MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"` MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"`
MergeUserID int `json:"merge_user_id"` MergeUserID int `json:"merge_user_id"`
MergeCommitSha string `json:"merge_commit_sha"` MergeCommitSHA string `json:"merge_commit_sha"`
DeletedAt string `json:"deleted_at"` DeletedAt string `json:"deleted_at"`
InProgressMergeCommitSha string `json:"in_progress_merge_commit_sha"` InProgressMergeCommitSHA string `json:"in_progress_merge_commit_sha"`
LockVersion int `json:"lock_version"` LockVersion int `json:"lock_version"`
ApprovalsBeforeMerge string `json:"approvals_before_merge"` ApprovalsBeforeMerge string `json:"approvals_before_merge"`
RebaseCommitSha string `json:"rebase_commit_sha"` RebaseCommitSHA string `json:"rebase_commit_sha"`
TimeEstimate int `json:"time_estimate"` TimeEstimate int `json:"time_estimate"`
Squash bool `json:"squash"` Squash bool `json:"squash"`
LastEditedAt string `json:"last_edited_at"` LastEditedAt string `json:"last_edited_at"`
...@@ -456,11 +456,11 @@ type MergeEvent struct { ...@@ -456,11 +456,11 @@ type MergeEvent struct {
} `json:"merge_params"` } `json:"merge_params"`
MergeWhenBuildSucceeds bool `json:"merge_when_build_succeeds"` MergeWhenBuildSucceeds bool `json:"merge_when_build_succeeds"`
MergeUserID int `json:"merge_user_id"` MergeUserID int `json:"merge_user_id"`
MergeCommitSha string `json:"merge_commit_sha"` MergeCommitSHA string `json:"merge_commit_sha"`
DeletedAt string `json:"deleted_at"` DeletedAt string `json:"deleted_at"`
ApprovalsBeforeMerge string `json:"approvals_before_merge"` ApprovalsBeforeMerge string `json:"approvals_before_merge"`
RebaseCommitSha string `json:"rebase_commit_sha"` RebaseCommitSHA string `json:"rebase_commit_sha"`
InProgressMergeCommitSha string `json:"in_progress_merge_commit_sha"` InProgressMergeCommitSHA string `json:"in_progress_merge_commit_sha"`
LockVersion int `json:"lock_version"` LockVersion int `json:"lock_version"`
TimeEstimate int `json:"time_estimate"` TimeEstimate int `json:"time_estimate"`
Source *Repository `json:"source"` Source *Repository `json:"source"`
...@@ -562,8 +562,8 @@ type PipelineEvent struct { ...@@ -562,8 +562,8 @@ type PipelineEvent struct {
ID int `json:"id"` ID int `json:"id"`
Ref string `json:"ref"` Ref string `json:"ref"`
Tag bool `json:"tag"` Tag bool `json:"tag"`
Sha string `json:"sha"` SHA string `json:"sha"`
BeforeSha string `json:"before_sha"` BeforeSHA string `json:"before_sha"`
Status string `json:"status"` Status string `json:"status"`
Stages []string `json:"stages"` Stages []string `json:"stages"`
CreatedAt string `json:"created_at"` CreatedAt string `json:"created_at"`
...@@ -638,8 +638,8 @@ type BuildEvent struct { ...@@ -638,8 +638,8 @@ type BuildEvent struct {
ObjectKind string `json:"object_kind"` ObjectKind string `json:"object_kind"`
Ref string `json:"ref"` Ref string `json:"ref"`
Tag bool `json:"tag"` Tag bool `json:"tag"`
BeforeSha string `json:"before_sha"` BeforeSHA string `json:"before_sha"`
Sha string `json:"sha"` SHA string `json:"sha"`
BuildID int `json:"build_id"` BuildID int `json:"build_id"`
BuildName string `json:"build_name"` BuildName string `json:"build_name"`
BuildStage string `json:"build_stage"` BuildStage string `json:"build_stage"`
...@@ -657,7 +657,7 @@ type BuildEvent struct { ...@@ -657,7 +657,7 @@ type BuildEvent struct {
} `json:"user"` } `json:"user"`
Commit struct { Commit struct {
ID int `json:"id"` ID int `json:"id"`
Sha string `json:"sha"` SHA string `json:"sha"`
Message string `json:"message"` Message string `json:"message"`
AuthorName string `json:"author_name"` AuthorName string `json:"author_name"`
AuthorEmail string `json:"author_email"` AuthorEmail string `json:"author_email"`
......
...@@ -571,7 +571,7 @@ type AcceptMergeRequestOptions struct { ...@@ -571,7 +571,7 @@ type AcceptMergeRequestOptions struct {
MergeCommitMessage *string `url:"merge_commit_message,omitempty" json:"merge_commit_message,omitempty"` MergeCommitMessage *string `url:"merge_commit_message,omitempty" json:"merge_commit_message,omitempty"`
ShouldRemoveSourceBranch *bool `url:"should_remove_source_branch,omitempty" json:"should_remove_source_branch,omitempty"` ShouldRemoveSourceBranch *bool `url:"should_remove_source_branch,omitempty" json:"should_remove_source_branch,omitempty"`
MergeWhenPipelineSucceeds *bool `url:"merge_when_pipeline_succeeds,omitempty" json:"merge_when_pipeline_succeeds,omitempty"` MergeWhenPipelineSucceeds *bool `url:"merge_when_pipeline_succeeds,omitempty" json:"merge_when_pipeline_succeeds,omitempty"`
Sha *string `url:"sha,omitempty" json:"sha,omitempty"` SHA *string `url:"sha,omitempty" json:"sha,omitempty"`
} }
// AcceptMergeRequest merges changes submitted with MR using this API. If merge // AcceptMergeRequest merges changes submitted with MR using this API. If merge
......
...@@ -47,7 +47,7 @@ type PipelineSchedule struct { ...@@ -47,7 +47,7 @@ type PipelineSchedule struct {
Owner *User `json:"owner"` Owner *User `json:"owner"`
LastPipeline struct { LastPipeline struct {
ID int `json:"id"` ID int `json:"id"`
Sha string `json:"sha"` SHA string `json:"sha"`
Ref string `json:"ref"` Ref string `json:"ref"`
Status string `json:"status"` Status string `json:"status"`
} `json:"last_pipeline"` } `json:"last_pipeline"`
......
...@@ -45,8 +45,8 @@ type Pipeline struct { ...@@ -45,8 +45,8 @@ type Pipeline struct {
ID int `json:"id"` ID int `json:"id"`
Status string `json:"status"` Status string `json:"status"`
Ref string `json:"ref"` Ref string `json:"ref"`
Sha string `json:"sha"` SHA string `json:"sha"`
BeforeSha string `json:"before_sha"` BeforeSHA string `json:"before_sha"`
Tag bool `json:"tag"` Tag bool `json:"tag"`
YamlErrors string `json:"yaml_errors"` YamlErrors string `json:"yaml_errors"`
User struct { User struct {
...@@ -77,7 +77,7 @@ type PipelineList []struct { ...@@ -77,7 +77,7 @@ type PipelineList []struct {
ID int `json:"id"` ID int `json:"id"`
Status string `json:"status"` Status string `json:"status"`
Ref string `json:"ref"` Ref string `json:"ref"`
Sha string `json:"sha"` SHA string `json:"sha"`
} }
func (i PipelineList) String() string { func (i PipelineList) String() string {
......
...@@ -69,10 +69,10 @@ type TodoTarget struct { ...@@ -69,10 +69,10 @@ type TodoTarget struct {
// Only available for type MergeRequest // Only available for type MergeRequest
ApprovalsBeforeMerge bool `json:"approvals_before_merge"` ApprovalsBeforeMerge bool `json:"approvals_before_merge"`
ForceRemoveSourceBranch bool `json:"force_remove_source_branch"` ForceRemoveSourceBranch bool `json:"force_remove_source_branch"`
MergeCommitSha string `json:"merge_commit_sha"` MergeCommitSHA string `json:"merge_commit_sha"`
MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"` MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"`
MergeStatus string `json:"merge_status"` MergeStatus string `json:"merge_status"`
Sha string `json:"sha"` SHA string `json:"sha"`
ShouldRemoveSourceBranch bool `json:"should_remove_source_branch"` ShouldRemoveSourceBranch bool `json:"should_remove_source_branch"`
SourceBranch string `json:"source_branch"` SourceBranch string `json:"source_branch"`
SourceProjectID int `json:"source_project_id"` SourceProjectID int `json:"source_project_id"`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment