diff --git a/package.json b/package.json index ba4d8a443..e18307753 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "danger", - "version": "10.3.0", + "version": "10.3.1", "description": "Unit tests for Team Culture", "main": "distribution/danger.js", "typings": "distribution/danger.d.ts", diff --git a/source/danger-incoming-process-schema.json b/source/danger-incoming-process-schema.json index df6eedbc6..92379bb15 100644 --- a/source/danger-incoming-process-schema.json +++ b/source/danger-incoming-process-schema.json @@ -1576,18 +1576,22 @@ "type": "object" }, "GitLabDSL": { + "description": "The GitLab metadata for your MR", "properties": { "commits": { + "description": "All of the individual commits in the merge request", "items": { "$ref": "#/definitions/GitLabMRCommit" }, "type": "array" }, "metadata": { - "$ref": "#/definitions/RepoMetaData" + "$ref": "#/definitions/RepoMetaData", + "description": "Info about the repo" }, "mr": { - "$ref": "#/definitions/GitLabMR" + "$ref": "#/definitions/GitLabMR", + "description": "Info about the merge request" }, "utils": { "type": "object" @@ -1596,6 +1600,7 @@ "type": "object" }, "GitLabMR": { + "description": "TODO: These need more comments from someone who uses GitLab, see GitLabDSL.ts in the danger-js repo", "properties": { "allow_collaboration": { "type": "boolean" @@ -1607,10 +1612,12 @@ "type": "null" }, "assignee": { - "$ref": "#/definitions/GitLabUser" + "$ref": "#/definitions/GitLabUser", + "description": "Who was assigned as the person to review" }, "author": { - "$ref": "#/definitions/GitLabUser" + "$ref": "#/definitions/GitLabUser", + "description": "Who made it" }, "changes_count": { "type": "string" @@ -1632,9 +1639,11 @@ ] }, "created_at": { + "description": "When was the MR made", "type": "string" }, "description": { + "description": "The body text describing the MR", "type": "string" }, "diff_refs": { @@ -1658,6 +1667,7 @@ "type": "number" }, "downvotes": { + "description": "How many folks have given it an downvote", "type": "number" }, "first_deployed_to_production_at": { @@ -1670,9 +1680,11 @@ "type": "boolean" }, "id": { + "description": "The MR's id", "type": "number" }, "iid": { + "description": "The unique ID for this MR", "type": "number" }, "labels": { @@ -1782,6 +1794,7 @@ "type": "object" }, "project_id": { + "description": "The project ID for this MR", "type": "number" }, "rebase_in_progress": { @@ -1794,6 +1807,7 @@ "type": "boolean" }, "source_branch": { + "description": "What branch is this MR come from", "type": "string" }, "source_project_id": { @@ -1803,6 +1817,7 @@ "type": "boolean" }, "state": { + "description": "The MR's current availability", "enum": [ "closed", "locked", @@ -1815,6 +1830,7 @@ "type": "boolean" }, "target_branch": { + "description": "What branch is this MR being merged into", "type": "string" }, "target_project_id": { @@ -1844,17 +1860,22 @@ "type": "object" }, "title": { + "description": "The given name of the MR", "type": "string" }, "updated_at": { + "description": "When was the MR updated", "type": "string" }, "upvotes": { + "description": "How many folks have given it an upvote", "type": "number" }, "user": { + "description": "Access rights for the user who created the MR", "properties": { "can_merge": { + "description": "Does the author have access to merge?", "type": "boolean" } }, diff --git a/source/danger.d.ts b/source/danger.d.ts index 2b645fec9..8ded84c7e 100644 --- a/source/danger.d.ts +++ b/source/danger.d.ts @@ -1427,12 +1427,16 @@ interface GitHubReviewers { // getPlatformReviewDSLRepresentation 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 */ interface GitLabDSL extends GitLabJSONDSL { utils: { fileContents(path: string, repoSlug?: string, ref?: string): Promise @@ -1477,40 +1481,49 @@ interface GitLabUserProfile extends GitLabUser { } 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[] @@ -1548,6 +1561,7 @@ interface GitLabMRBase { } } +/** TODO: These need more comments from someone who uses GitLab, see GitLabDSL.ts in the danger-js repo */ interface GitLabMR extends GitLabMRBase { squash: boolean subscribed: boolean