From 83e554ea648932270306db39e74ab00ee64da068 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 24 Oct 2022 09:33:24 -0700 Subject: [PATCH 1/3] feat: enable nested commit delimiters --- ...can-googleapis-gen-and-create-pull-requests.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts b/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts index 4ddbaa150cf..cedfce4d649 100644 --- a/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts +++ b/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts @@ -17,12 +17,14 @@ import yargs = require('yargs'); import {scanGoogleapisGenAndCreatePullRequests} from '../../scan-googleapis-gen-and-create-pull-requests'; import {FirestoreConfigsStore, FirestoreCopyStateStore} from '../../database'; import {OctokitParams, octokitFactoryFrom} from '../../octokit-util'; +import {WithNestedCommitDelimiters} from '../../create-pr'; interface Args extends OctokitParams { 'source-repo': string; 'firestore-project': string; 'clone-depth': number; 'combine-pulls-threshold': number; + 'use-nested-commit-delimiters'?: boolean; } export const scanGoogleapisGenAndCreatePullRequestsCommand: yargs.CommandModule< @@ -76,6 +78,13 @@ export const scanGoogleapisGenAndCreatePullRequestsCommand: yargs.CommandModule< 'with changes to all the APIs.', type: 'number', default: 3, + }) + .option('use-nested-commit-delimiters', { + describe: + 'Whether to use BEGIN_NESTED_COMMIT delimiters when separating multiple commit messages', + type: 'boolean', + default: true, + demand: false, }); }, async handler(argv) { @@ -92,7 +101,11 @@ export const scanGoogleapisGenAndCreatePullRequestsCommand: yargs.CommandModule< configsStore, argv['clone-depth'], copyStateStore, - argv['combine-pulls-threshold'] + argv['combine-pulls-threshold'], + undefined, + argv['use-nested-commit-delimiters'] + ? WithNestedCommitDelimiters.Yes + : WithNestedCommitDelimiters.No ); }, }; From 53c477c8302ab984d0184a9a3bbfbfaff306299c Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 24 Oct 2022 09:38:15 -0700 Subject: [PATCH 2/3] docs: add comment for undefined argument --- .../src/bin/commands/copy-code-and-create-pull-request.ts | 2 +- .../commands/scan-googleapis-gen-and-create-pull-requests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts b/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts index 7f1a292bfc7..fd69823978c 100644 --- a/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts +++ b/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts @@ -99,7 +99,7 @@ export const copyCodeAndCreatePullRequestCommand: yargs.CommandModule< await cc.copyCodeAndAppendOrCreatePullRequest( params, [argv['dest-owlbot-yaml']], - undefined, + undefined, /* logger */ argv['use-nested-commit-delimiters'] ? WithNestedCommitDelimiters.Yes : WithNestedCommitDelimiters.No diff --git a/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts b/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts index cedfce4d649..dba8e34d476 100644 --- a/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts +++ b/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts @@ -102,7 +102,7 @@ export const scanGoogleapisGenAndCreatePullRequestsCommand: yargs.CommandModule< argv['clone-depth'], copyStateStore, argv['combine-pulls-threshold'], - undefined, + undefined, /* logger */ argv['use-nested-commit-delimiters'] ? WithNestedCommitDelimiters.Yes : WithNestedCommitDelimiters.No From bb5c707beb9b1652508faed9cd9f1c2c81796a9a Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 24 Oct 2022 09:40:46 -0700 Subject: [PATCH 3/3] fix lint --- .../src/bin/commands/copy-code-and-create-pull-request.ts | 2 +- .../commands/scan-googleapis-gen-and-create-pull-requests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts b/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts index fd69823978c..d41812c3980 100644 --- a/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts +++ b/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts @@ -99,7 +99,7 @@ export const copyCodeAndCreatePullRequestCommand: yargs.CommandModule< await cc.copyCodeAndAppendOrCreatePullRequest( params, [argv['dest-owlbot-yaml']], - undefined, /* logger */ + undefined /* logger */, argv['use-nested-commit-delimiters'] ? WithNestedCommitDelimiters.Yes : WithNestedCommitDelimiters.No diff --git a/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts b/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts index dba8e34d476..6a83409109c 100644 --- a/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts +++ b/packages/owl-bot/src/bin/commands/scan-googleapis-gen-and-create-pull-requests.ts @@ -102,7 +102,7 @@ export const scanGoogleapisGenAndCreatePullRequestsCommand: yargs.CommandModule< argv['clone-depth'], copyStateStore, argv['combine-pulls-threshold'], - undefined, /* logger */ + undefined /* logger */, argv['use-nested-commit-delimiters'] ? WithNestedCommitDelimiters.Yes : WithNestedCommitDelimiters.No