Skip to content

Commit

Permalink
Maybe gets GitLab doc'd
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Aug 19, 2020
1 parent 547e4a3 commit ef9167b
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions source/dsl/GitLabDSL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ import { RepoMetaData } from "./BitBucketServerDSL"

// getPlatformReviewDSLRepresentation
export interface GitLabJSONDSL {
/** Info about the repo */
metadata: RepoMetaData
/** Info about the merge request */
mr: GitLabMR
/** All of the individual commits in the merge request */
commits: GitLabMRCommit[]
}

// danger.gitlab
/** The GitLab metadata for your MR */
export interface GitLabDSL extends GitLabJSONDSL {
utils: {
fileContents(path: string, repoSlug?: string, ref?: string): Promise<string>
Expand Down Expand Up @@ -55,40 +59,49 @@ export interface GitLabUserProfile extends GitLabUser {
}

export interface GitLabMRBase {
/** */
/** The MR's id */
id: number

/** */
/** The unique ID for this MR */
iid: number

/** */
/** The project ID for this MR */
project_id: number

/** */
/** The given name of the MR */
title: string

/** */
/** The body text describing the MR */
description: string

/** */
/** The MR's current availability */
state: "closed" | "open" | "locked" | "merged"

/** */
/** When was the MR made */
created_at: string

/** */
/** When was the MR updated */
updated_at: string

/** What branch is this MR being merged into */
target_branch: string
/** What branch is this MR come from */
source_branch: string

/** How many folks have given it an upvote */
upvotes: number
/** How many folks have given it an downvote */
downvotes: number

/** Who made it */
author: GitLabUser
/** Access rights for the user who created the MR */
user: {
/** Does the author have access to merge? */
can_merge: boolean
}
assignee: GitLabUser
/** Who was assigned as the person to review */
assignee?: GitLabUser
source_project_id: number
target_project_id: number
labels: string[]
Expand Down Expand Up @@ -126,6 +139,7 @@ export interface GitLabMRBase {
}
}

/** TODO: These need more comments from someone who uses GitLab, see GitLabDSL.ts in the danger-js repo */
export interface GitLabMR extends GitLabMRBase {
squash: boolean
subscribed: boolean
Expand Down

0 comments on commit ef9167b

Please sign in to comment.