From a64180a673f1d436f3515148e89cc3d5b9b0590c Mon Sep 17 00:00:00 2001 From: Christopher Rybicki Date: Thu, 21 Apr 2022 09:46:46 -0700 Subject: [PATCH] fix: cannot disable automerge and while keeping mergify enabled (#1783) Supersedes #1766 Fixes #1765 --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --- docs/api/API.md | 44 ++- src/github/github-project.ts | 9 +- src/javascript/node-project.ts | 8 +- test/__snapshots__/inventory.test.ts.snap | 289 ++++++++++++++++++ .../github/__snapshots__/mergify.test.ts.snap | 15 +- test/github/mergify.test.ts | 35 ++- 6 files changed, 394 insertions(+), 6 deletions(-) diff --git a/docs/api/API.md b/docs/api/API.md index 66303b92c07..173ede42925 100644 --- a/docs/api/API.md +++ b/docs/api/API.md @@ -3031,6 +3031,7 @@ new awscdk.AwsCdkConstructLibrary(options: AwsCdkConstructLibraryOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -3435,6 +3436,7 @@ new awscdk.AwsCdkJavaApp(options: AwsCdkJavaAppOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -3542,6 +3544,7 @@ new awscdk.AwsCdkPythonApp(options: AwsCdkPythonAppOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -3639,6 +3642,7 @@ new awscdk.AwsCdkTypeScriptApp(options: AwsCdkTypeScriptAppOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -3911,6 +3915,7 @@ new awscdk.ConstructLibraryAws(options: AwsCdkConstructLibraryOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -4481,6 +4486,7 @@ new cdk.ConstructLibrary(options: ConstructLibraryOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -4732,6 +4738,7 @@ new cdk.JsiiProject(options: JsiiProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -4929,6 +4936,7 @@ new cdk8s.Cdk8sTypeScriptApp(options: Cdk8sTypeScriptAppOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -5104,6 +5112,7 @@ new cdk8s.ConstructLibraryCdk8s(options: ConstructLibraryCdk8sOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -5338,6 +5347,7 @@ new cdktf.ConstructLibraryCdktf(options: ConstructLibraryCdktfOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -5775,6 +5785,7 @@ new github.GitHubProject(options: GitHubProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -6466,6 +6477,7 @@ new java.JavaProject(options: JavaProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -7458,6 +7470,7 @@ new javascript.NodeProject(options: NodeProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -7578,7 +7591,7 @@ Name | Type | Description **package**🔹 | [javascript.NodePackage](#projen-javascript-nodepackage) | API for managing the node package. **packageManager**⚠️ | [javascript.NodePackageManager](#projen-javascript-nodepackagemanager) | The package manager to use. **runScriptCommand**🔹 | string | The command to use to run scripts (e.g. `yarn run` or `npm run` depends on the package manager). -**autoMerge**?🔹 | [github.AutoMerge](#projen-github-automerge) | Automatic PR merges.
__*Optional*__ +**autoMerge**?🔹 | [github.AutoMerge](#projen-github-automerge) | Component that sets up mergify for merging approved pull requests.
__*Optional*__ **buildWorkflow**?🔹 | [build.BuildWorkflow](#projen-build-buildworkflow) | The PR build GitHub workflow.
__*Optional*__ **buildWorkflowJobId**?🔹 | string | The job ID of the build workflow.
__*Optional*__ **jest**?🔹 | [javascript.Jest](#projen-javascript-jest) | The Jest configuration (if enabled).
__*Optional*__ @@ -8481,6 +8494,7 @@ new python.PythonProject(options: PythonProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -9256,6 +9270,7 @@ new typescript.TypeScriptAppProject(options: TypeScriptProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -9405,6 +9420,7 @@ new typescript.TypeScriptLibraryProject(options: TypeScriptProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -9554,6 +9570,7 @@ new typescript.TypeScriptProject(options: TypeScriptProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -9948,6 +9965,7 @@ new web.NextJsProject(options: NextJsProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -10095,6 +10113,7 @@ new web.NextJsTypeScriptProject(options: NextJsTypeScriptProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -10314,6 +10333,7 @@ new web.ReactProject(options: ReactProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -10503,6 +10523,7 @@ new web.ReactTypeScriptProject(options: ReactTypeScriptProjectOptions) * **projenrcJson** (boolean) Generate (once) .projenrc.json (in JSON). Set to `false` in order to disable .projenrc.json generation. __*Default*__: false * **projenrcJsonOptions** ([ProjenrcOptions](#projen-projenrcoptions)) Options for .projenrc.json. __*Default*__: default options * **autoApproveOptions** ([github.AutoApproveOptions](#projen-github-autoapproveoptions)) Enable and configure the 'auto approve' workflow. __*Default*__: auto approve is disabled + * **autoMerge** (boolean) Enable automatic merging on GitHub. __*Default*__: true * **autoMergeOptions** ([github.AutoMergeOptions](#projen-github-automergeoptions)) Configure options for automatic merging on GitHub. __*Default*__: see defaults in `AutoMergeOptions` * **clobber** (boolean) Add a `clobber` task which resets the repo to origin. __*Default*__: true * **devContainer** (boolean) Add a VSCode development environment (used for GitHub Codespaces). __*Default*__: false @@ -11631,6 +11652,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -11830,6 +11852,7 @@ Name | Type | Description **name**🔹 | string | This is the name of your project. **version**🔹 | string | This is the last piece of the naming puzzle. **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **buildCommand**?🔹 | string | A command to execute before synthesis.
__*Default*__: no build command **cdkAssert**?⚠️ | boolean | Warning: NodeJS only.
__*Default*__: will be included by default for AWS CDK >= 1.0.0 < 2.0.0 @@ -11917,6 +11940,7 @@ Name | Type | Description **version**🔹 | string | Version of the package. **appEntrypoint**?🔹 | string | The CDK app's entrypoint (relative to the source directory, which is "src" by default).
__*Default*__: "app.py" **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **buildCommand**?🔹 | string | A command to execute before synthesis.
__*Default*__: no build command **cdkAssert**?⚠️ | boolean | Warning: NodeJS only.
__*Default*__: will be included by default for AWS CDK >= 1.0.0 < 2.0.0 @@ -11996,6 +12020,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -12196,6 +12221,7 @@ Name | Type | Description **autoApproveOptions**?⚠️ | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?⚠️ | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?⚠️ | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?⚠️ | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?⚠️ | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?⚠️ | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?⚠️ | string | The email address to which issues should be reported.
__*Optional*__ @@ -12592,6 +12618,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -12850,6 +12877,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -13036,6 +13064,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -13188,6 +13217,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -13377,6 +13407,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -13623,6 +13654,7 @@ Name | Type | Description -----|------|------------- **name**🔹 | string | This is the name of your project. **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **clobber**?🔹 | boolean | Add a `clobber` task which resets the repo to origin.
__*Default*__: true **devContainer**?🔹 | boolean | Add a VSCode development environment (used for GitHub Codespaces).
__*Default*__: false @@ -14446,6 +14478,7 @@ Name | Type | Description **name**🔹 | string | This is the name of your project. **version**🔹 | string | This is the last piece of the naming puzzle. **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **clobber**?🔹 | boolean | Add a `clobber` task which resets the repo to origin.
__*Default*__: true **compileOptions**?🔹 | [java.MavenCompileOptions](#projen-java-mavencompileoptions) | Compile options.
__*Default*__: defaults @@ -14496,6 +14529,7 @@ Name | Type | Description **name**🔹 | string | This is the name of your project. **version**🔹 | string | This is the last piece of the naming puzzle. **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **clobber**?🔹 | boolean | Add a `clobber` task which resets the repo to origin.
__*Default*__: true **compileOptions**?🔹 | [java.MavenCompileOptions](#projen-java-mavencompileoptions) | Compile options.
__*Default*__: defaults @@ -14967,6 +15001,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -15551,6 +15586,7 @@ Name | Type | Description **name**🔹 | string | This is the name of your project. **version**🔹 | string | Version of the package. **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **classifiers**?🔹 | Array | A list of PyPI trove classifiers that describe the project.
__*Optional*__ **clobber**?🔹 | boolean | Add a `clobber` task which resets the repo to origin.
__*Default*__: true @@ -16042,6 +16078,7 @@ Name | Type | Description **autoApproveOptions**?⚠️ | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?⚠️ | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?⚠️ | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?⚠️ | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?⚠️ | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?⚠️ | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?⚠️ | string | The email address to which issues should be reported.
__*Optional*__ @@ -16181,6 +16218,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -16425,6 +16463,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -16552,6 +16591,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -16721,6 +16761,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ @@ -16877,6 +16918,7 @@ Name | Type | Description **autoApproveOptions**?🔹 | [github.AutoApproveOptions](#projen-github-autoapproveoptions) | Enable and configure the 'auto approve' workflow.
__*Default*__: auto approve is disabled **autoApproveUpgrades**?🔹 | boolean | Automatically approve deps upgrade PRs, allowing them to be merged by mergify (if configued).
__*Default*__: true **autoDetectBin**?🔹 | boolean | Automatically add all executables under the `bin` directory to your `package.json` file under the `bin` section.
__*Default*__: true +**autoMerge**?🔹 | boolean | Enable automatic merging on GitHub.
__*Default*__: true **autoMergeOptions**?🔹 | [github.AutoMergeOptions](#projen-github-automergeoptions) | Configure options for automatic merging on GitHub.
__*Default*__: see defaults in `AutoMergeOptions` **bin**?🔹 | Map | Binary programs vended with your module.
__*Optional*__ **bugsEmail**?🔹 | string | The email address to which issues should be reported.
__*Optional*__ diff --git a/src/github/github-project.ts b/src/github/github-project.ts index 041771c4753..db8d9c0c82c 100644 --- a/src/github/github-project.ts +++ b/src/github/github-project.ts @@ -96,9 +96,16 @@ export interface GitHubProjectOptions extends ProjectOptions { */ readonly autoApproveOptions?: AutoApproveOptions; + /** + * Enable automatic merging on GitHub. Has no effect if `github.mergify` + * is set to false. + * @default true + */ + readonly autoMerge?: boolean; + /** * Configure options for automatic merging on GitHub. Has no effect if - * `github.mergify` is set to false. + * `github.mergify` or `autoMerge` is set to false. * * @default - see defaults in `AutoMergeOptions` */ diff --git a/src/javascript/node-project.ts b/src/javascript/node-project.ts index db75994e2c7..2b1a3c170f4 100644 --- a/src/javascript/node-project.ts +++ b/src/javascript/node-project.ts @@ -338,7 +338,7 @@ export class NodeProject extends GitHubProject { } /** - * Automatic PR merges. + * Component that sets up mergify for merging approved pull requests. */ public readonly autoMerge?: AutoMerge; @@ -603,7 +603,11 @@ export class NodeProject extends GitHubProject { } } - if (this.github?.mergify && this.buildWorkflow?.buildJobIds) { + if ( + (options.autoMerge ?? true) && + this.github?.mergify && + this.buildWorkflow?.buildJobIds + ) { this.autoMerge = new AutoMerge(this.github, options.autoMergeOptions); this.autoMerge.addConditionsLater({ render: () => diff --git a/test/__snapshots__/inventory.test.ts.snap b/test/__snapshots__/inventory.test.ts.snap index 3e72a288441..651fb36bbd3 100644 --- a/test/__snapshots__/inventory.test.ts.snap +++ b/test/__snapshots__/inventory.test.ts.snap @@ -43,6 +43,23 @@ Array [ "simpleType": "AutoApproveOptions", "switch": "auto-approve-options", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -1102,6 +1119,23 @@ Array [ "simpleType": "AutoApproveOptions", "switch": "auto-approve-options", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -2336,6 +2370,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -5019,6 +5070,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -7786,6 +7854,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -10290,6 +10375,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -12956,6 +13058,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -15406,6 +15525,23 @@ Array [ "simpleType": "AutoApproveOptions", "switch": "auto-approve-options", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -16281,6 +16417,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -18812,6 +18965,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -20899,6 +21069,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -23214,6 +23401,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -25266,6 +25470,23 @@ Array [ "simpleType": "AutoApproveOptions", "switch": "auto-approve-options", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -26183,6 +26404,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -28258,6 +28496,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -30578,6 +30833,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", @@ -32876,6 +33148,23 @@ Array [ "simpleType": "boolean", "switch": "auto-detect-bin", }, + Object { + "default": "true", + "docs": "Enable automatic merging on GitHub.", + "featured": false, + "fullType": Object { + "primitive": "boolean", + }, + "jsonLike": true, + "name": "autoMerge", + "optional": true, + "parent": "GitHubProjectOptions", + "path": Array [ + "autoMerge", + ], + "simpleType": "boolean", + "switch": "auto-merge", + }, Object { "default": "- see defaults in \`AutoMergeOptions\`", "docs": "Configure options for automatic merging on GitHub.", diff --git a/test/github/__snapshots__/mergify.test.ts.snap b/test/github/__snapshots__/mergify.test.ts.snap index 2cb4dc46f92..462517715e4 100644 --- a/test/github/__snapshots__/mergify.test.ts.snap +++ b/test/github/__snapshots__/mergify.test.ts.snap @@ -27,7 +27,7 @@ pull_request_rules: " `; -exports[`mergify with options 1`] = ` +exports[`mergify with automerge options 1`] = ` "# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". queue_rules: @@ -53,3 +53,16 @@ pull_request_rules: - status-success=build " `; + +exports[`mergify without automerge, with custom rules 1`] = ` +"# ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\". + +queue_rules: [] +pull_request_rules: + - actions: + - action + conditions: + - condition + name: rule-name +" +`; diff --git a/test/github/mergify.test.ts b/test/github/mergify.test.ts index aa9b9cf25f1..5d583a17350 100644 --- a/test/github/mergify.test.ts +++ b/test/github/mergify.test.ts @@ -13,9 +13,10 @@ describe("mergify", () => { expect(snapshot[".mergify.yml"]).toMatchSnapshot(); }); - test("with options", () => { + test("with automerge options", () => { // GIVEN const project = createProject({ + autoMerge: true, autoMergeOptions: { approvedReviews: 3, blockingLabels: ["do-not-merge", "missing-tests"], @@ -31,6 +32,38 @@ describe("mergify", () => { expect(snapshot[".mergify.yml"]).toContain('- "#approved-reviews-by>=3"'); expect(snapshot[".mergify.yml"]).toMatchSnapshot(); }); + + test("without automerge", () => { + // GIVEN + const project = createProject({ + autoMerge: false, + }); + + // THEN + const snapshot = synthSnapshot(project); + expect(snapshot[".mergify.yml"]).toBeUndefined(); + }); + + test("without automerge, with custom rules", () => { + // GIVEN + const project = createProject({ + autoMerge: false, + mergifyOptions: { + rules: [ + { + actions: ["action"], + conditions: ["condition"], + name: "rule-name", + }, + ], + }, + }); + + // THEN + const snapshot = synthSnapshot(project); + expect(snapshot[".mergify.yml"]).toBeDefined(); + expect(snapshot[".mergify.yml"]).toMatchSnapshot(); + }); }); type ProjectOptions = Omit<