-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
state push
uses buildplanner's attachStagedCommit mutation.
- Loading branch information
1 parent
92da15e
commit 0688b1c
Showing
4 changed files
with
198 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
pkg/platform/api/buildplanner/request/attachstagedcommit.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package request | ||
|
||
func AttachStagedCommit(owner, project, parentCommit, commit, branch string) *attachStagedCommit { | ||
return &attachStagedCommit{map[string]interface{}{ | ||
"organization": owner, | ||
"project": project, | ||
"parentCommit": parentCommit, | ||
"commit": commit, | ||
"branch": branch, | ||
}} | ||
} | ||
|
||
type attachStagedCommit struct { | ||
vars map[string]interface{} | ||
} | ||
|
||
func (b *attachStagedCommit) Query() string { | ||
return ` | ||
mutation ($organization: String!, $project: String!, $parentCommit: ID!, $commit: ID!, $branch: String!) { | ||
attachStagedCommit(input:{organization:$organization, project:$project, parentCommitId:$parentCommit, stagedCommitId:$commit, branchRef:$branch}) { | ||
... on Commit { | ||
__typename | ||
commitId | ||
} | ||
... on NotFound { | ||
__typename | ||
message | ||
mayNeedAuthentication | ||
} | ||
... on ParseError { | ||
__typename | ||
message | ||
} | ||
... on Forbidden { | ||
__typename | ||
message | ||
} | ||
... on HeadOnBranchMoved { | ||
__typename | ||
message | ||
commitId | ||
branchId | ||
} | ||
... on NoChangeSinceLastCommit { | ||
__typename | ||
message | ||
commitId | ||
} | ||
} | ||
} | ||
` | ||
} | ||
|
||
func (b *attachStagedCommit) Vars() map[string]interface{} { | ||
return b.vars | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters