Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitLabMR structures #1355

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
80 changes: 68 additions & 12 deletions source/dsl/GitLabDSL.ts
Expand Up @@ -9,7 +9,7 @@ export interface GitLabJSONDSL {
metadata: RepoMetaData
/** Info about the merge request */
mr: GitLabMR
/** All of the individual commits in the merge request */
/** All the individual commits in the merge request */
commits: GitLabMRCommit[]
/** Merge Request-level MR approvals Configuration */
approvals: GitLabApproval
Expand All @@ -27,6 +27,8 @@ export interface GitLabDSL extends GitLabJSONDSL {
// ---
// JSON responses from API

type GitLabPipelineStatus = "canceled" | "failed" | "pending" | "running" | "skipped" | "success"

export interface GitLabUser {
id: number
name: string
Expand Down Expand Up @@ -86,6 +88,58 @@ export interface GitLabMRBase {
/** When was the MR updated */
updated_at: string

merge_user: null
squash_commit_sha: string | null
reference: string
references: {
short: string
relative: string
full: string
}
squash: boolean
task_completion_status: {
count: number
completed_count: number
}
has_conflicts: boolean
blocking_discussions_resolved: boolean
approvals_before_merge: null
subscribed: boolean
head_pipeline: {
id: number
iid: number
project_id: number
sha: string
ref: string
status: GitLabPipelineStatus
source: "push"
created_at: string
updated_at: string
web_url: string
before_sha: string
tag: boolean
yaml_errors: null
user: GitLabUser
started_at: string
finished_at: string
committed_at: null
duration: number
queued_duration: number
coverage: null
detailed_status: {
icon: "status_running"
text: "running"
label: "running"
group: "running"
tooltip: "running"
has_details: true
details_path: string
illustration: null
favicon: string
}
}
first_contribution: boolean

/** What branch is this MR being merged into */
target_branch: string
/** What branch is this MR come from */
Expand All @@ -111,6 +165,8 @@ export interface GitLabMRBase {
source_project_id: number
target_project_id: number
labels: string[]
draft: boolean
/** @deprecated, same as draft */
work_in_progress: boolean
milestone: {
id: number
Expand All @@ -124,14 +180,14 @@ export interface GitLabMRBase {
due_date: string
start_date: string
web_url: string
}
} | null
merge_when_pipeline_succeeds: boolean
merge_status: "can_be_merged" // XXX: other statuses?
merge_error: null | null
merge_error: null
sha: string
merge_commit_sha: string | null
user_notes_count: number
discussion_locked: null | null
discussion_locked: null
should_remove_source_branch: boolean
force_remove_source_branch: boolean
allow_collaboration: boolean
Expand All @@ -154,24 +210,24 @@ export interface GitLabMR extends GitLabMRBase {
merged_at: string
closed_by: GitLabUser | null
closed_at: string | null
latest_build_started_at: string
latest_build_finished_at: string
latest_build_started_at: string | null
latest_build_finished_at: string | null
first_deployed_to_production_at: string | null
pipeline: {
id: number
sha: string
ref: string
status: "canceled" | "failed" | "pending" | "running" | "skipped" | "success"
status: GitLabPipelineStatus
web_url: string
}
} | null
diff_refs: {
base_sha: string
head_sha: string
start_sha: string
}
diverged_commits_count: number
rebase_in_progress: boolean
approvals_before_merge: null | null
approvals_before_merge: null
}

export interface GitLabMRChange {
Expand Down Expand Up @@ -205,9 +261,9 @@ export interface GitLabNote {
}

export interface GitLabDiscussion {
id: string; //40 character hex
individual_note: boolean;
notes: GitLabNote[];
id: string //40 character hex
individual_note: boolean
notes: GitLabNote[]
}

export interface GitLabDiscussionTextPosition {
Expand Down