Skip to content

Commit aefc723

Browse files
committed
correspond draft PR and 'RFC PATCH'
1 parent adf6ecb commit aefc723

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

lib/gitgitgadget.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ export class GitGitGadget {
260260
const previousTag = metadata && metadata.latestTag ? `refs/tags/${metadata.latestTag}` : undefined;
261261
// update work repo from base
262262
await this.updateNotesAndPullRef(pr.baseOwner, pr.number, previousTag);
263+
options.rfc = pr.draft;
263264

264265
const series = await PatchSeries.getFromNotes(
265266
this.notes,

lib/github-glue.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export interface IPullRequestInfo {
1919
headCommit: string;
2020
mergeable: boolean;
2121
number: number;
22+
draft: boolean;
2223
}
2324

2425
export interface IPRComment {
@@ -335,6 +336,7 @@ export class GitHubGlue {
335336
number: pr.number,
336337
pullRequestURL: pr.html_url,
337338
title: pr.title,
339+
draft: false,
338340
});
339341
});
340342
return result;
@@ -371,6 +373,7 @@ export class GitHubGlue {
371373
number: pullRequest.number,
372374
pullRequestURL: pullRequest.html_url,
373375
title: pullRequest.title,
376+
draft: pullRequest.draft || false,
374377
};
375378
}
376379

tests/ci-helper.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ testQ("handle comment allow no name specified (with trailing white space)", asyn
393393
number: prNumber,
394394
pullRequestURL: "https://github.com/gitgitgadget/git/pull/59",
395395
title: "Submit a fun fix",
396+
draft: false,
396397
};
397398

398399
ci.setGHGetPRInfo(prInfo);
@@ -480,6 +481,7 @@ testQ("handle comment submit not author", async () => {
480481
number: prNumber,
481482
pullRequestURL: "https://github.com/gitgitgadget/git/pull/59",
482483
title: "Submit a fun fix",
484+
draft: false,
483485
};
484486

485487
ci.setGHGetPRInfo(prInfo);
@@ -522,6 +524,7 @@ testQ("handle comment submit not mergeable", async () => {
522524
number: prNumber,
523525
pullRequestURL: "https://github.com/gitgitgadget/git/pull/59",
524526
title: "Do Not Submit a fun fix",
527+
draft: false,
525528
};
526529

527530
ci.setGHGetPRInfo(prInfo);
@@ -600,6 +603,7 @@ testQ("handle comment submit email success", async () => {
600603
number: prNumber,
601604
pullRequestURL: "https://github.com/gitgitgadget/git/pull/59",
602605
title: "Submit a fun fix",
606+
draft: false,
603607
};
604608

605609
ci.setGHGetPRInfo(prInfo);
@@ -685,6 +689,7 @@ testQ("handle comment preview email success", async () => {
685689
number: prNumber,
686690
pullRequestURL: "https://github.com/gitgitgadget/git/pull/59",
687691
title: "Preview a fun fix",
692+
draft: false,
688693
};
689694

690695
ci.setGHGetPRInfo(prInfo);
@@ -792,6 +797,7 @@ testQ("handle push/comment too many commits fails", async () => {
792797
number: prNumber,
793798
pullRequestURL: "https://github.com/gitgitgadget/git/pull/59",
794799
title: "Preview a fun fix",
800+
draft: false,
795801
};
796802

797803
ci.setGHGetPRInfo(prInfo);
@@ -911,6 +917,7 @@ testQ("handle push/comment merge commits fails", async () => {
911917
number: prNumber,
912918
pullRequestURL: "https://github.com/gitgitgadget/git/pull/59",
913919
title: "Preview a fun fix",
920+
draft: false,
914921
};
915922

916923
ci.setGHGetPRInfo(prInfo);
@@ -1058,6 +1065,7 @@ testQ("disallow no-reply emails", async () => {
10581065
number: prNumber,
10591066
pullRequestURL: "https://github.com/gitgitgadget/git/pull/59",
10601067
title: "Preview a fun fix",
1068+
draft: false,
10611069
};
10621070

10631071
ci.setGHGetPRInfo(prInfo);
@@ -1184,6 +1192,7 @@ testQ("basic lint tests", async () => {
11841192
number: prNumber,
11851193
pullRequestURL: "https://github.com/gitgitgadget/git/pull/59",
11861194
title: "Preview a fun fix",
1195+
draft: false,
11871196
};
11881197

11891198
ci.setGHGetPRInfo(prInfo);
@@ -1235,6 +1244,7 @@ testQ("Handle comment cc", async () => {
12351244
number: prNumber,
12361245
pullRequestURL: "https://github.com/gitgitgadget/git/pull/59",
12371246
title: "Preview a fun fix",
1247+
draft: false,
12381248
};
12391249

12401250
ci.setGHGetPRInfo(prInfo);

tests/github-glue.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ test("add PR cc requests", async () => {
247247
number: 59,
248248
pullRequestURL: "https://github.com/webstech/gitout/pull/59",
249249
title: "Submit a fun fix",
250+
draft: false,
250251
};
251252

252253
const commentInfo = { id: 1, url: "ok" };

0 commit comments

Comments
 (0)