Skip to content

Commit

Permalink
feat: merge request add merge status field (#222)
Browse files Browse the repository at this point in the history
Co-authored-by: qingliu <[email protected]>
  • Loading branch information
l-qing and l-qing authored Jun 23, 2022
1 parent 338f8e9 commit ccb1e8c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ bin

*.xml
.vscode/
test.json
cover.out
2 changes: 1 addition & 1 deletion apis/data/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions apis/meta/v1alpha1/gitpullrequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ var (
GitPullRequestNoteListGVK = GroupVersion.WithKind("GitPullRequestNoteList")
)

// MergeStatus is the status of a merge request
type MergeStatus string

const (
// MergeStatusChecking indicates that the merge request is being checked
MergeStatusChecking MergeStatus = "checking"
// MergeStatusUnknown is the unknown status of the merge request
MergeStatusUnknown MergeStatus = "unknown"
// MergeStatusCanBeMerged indicates that the merge request can be merged
MergeStatusCanBeMerged MergeStatus = "can_be_merged"
// MergeStatusCannotBeMerged indicates that the merge request cannot be merged
MergeStatusCannotBeMerged MergeStatus = "cannot_be_merged"
)

// GitPullRequest object for plugins
type GitPullRequest struct {
metav1.TypeMeta `json:",inline"`
Expand Down Expand Up @@ -63,7 +77,12 @@ type GitPullRequestSpec struct {
MergeLog *GitOperateLogBaseInfo `json:"mergeLog,omitempty"`
Properties *runtime.RawExtension `json:"properties,omitempty"`
// HasConflicts means source and target branch has conflict change
// It is dependent on the merge_status.
HasConflicts bool `json:"hasConflicts,omitempty"`
// MergeStatus indicates if there is a merge conflict
MergeStatus MergeStatus `json:"mergeStatus,omitempty"`
// OriginMergeStatus used to store origin merge status
OriginMergeStatus string `json:"originMergeStatus,omitempty"`
}

// GitPullRequestList list of pr
Expand Down
2 changes: 1 addition & 1 deletion apis/meta/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ccb1e8c

Please sign in to comment.