From fd33996f0f37145ac0a984e0873cd65926e9181f Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@keylocation.sg> Date: Fri, 7 Jul 2017 09:53:22 +0200 Subject: [PATCH] refactor(onboarding): Update onboarding description (#468) Better describe renovate.json and if/when it needs to be added. --- lib/workers/repository/onboarding.js | 17 ++-- .../__snapshots__/onboarding.spec.js.snap | 85 +++++++++---------- test/workers/repository/onboarding.spec.js | 25 +----- 3 files changed, 50 insertions(+), 77 deletions(-) diff --git a/lib/workers/repository/onboarding.js b/lib/workers/repository/onboarding.js index d05cfebbfa..0ddba69e8b 100644 --- a/lib/workers/repository/onboarding.js +++ b/lib/workers/repository/onboarding.js @@ -50,26 +50,25 @@ async function ensurePr(config, branchUpgrades) { const errors = config.errors; let prBody = `Welcome to [Renovate](https://keylocation.sg/our-tech/renovate)! -This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, we will begin keeping your dependencies up-to-date via automated Pull Requests. +This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, Renovate will begin keeping your dependencies up-to-date via automated Pull Requests. --- {{BASEBRANCHDESCRIPTION}}{{PRDESCRIPTION}} -Would you like to change this? Simply edit the \`renovate.json\` in this branch and Renovate will update this Pull Request description the next time it runs. +Sometimes you may see multiple options for the same dependency (e.g. pinning in one branch and upgrading in another). This is expected and allows you the flexibility to choose which to merge first. Once you merge any PR, others will be updated or removed the next time Renovate runs. -The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify this behaviour. +Would you like to change the way Renovate is upgrading your dependencies? Simply edit the \`renovate.json\` in this branch and this Pull Request description will be udpated the next time Renovate runs. ---- +The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify any behaviour. -#### Important! +--- -You do not need to *merge* this Pull Request - renovate will begin even if it's closed *unmerged*. -In fact, you only need to add a \`renovate.json\` file to your repository if you wish to override any default settings. The file is included as part of this PR only in case you wish to change default settings before you start. +#### Don't want a \`renovate.json\` file? -Alternatively, you can add the same configuration settings into a "renovate" section of \`package.json\`, which might be more convenient if you have only one. +You are not required to *merge* this Pull Request - Renovate will begin even if this "Configure Renovate" PR is closed *unmerged* and without a \`renovate.json\` file. However, it's recommended that you add configuration to your repository to ensure behaviour matches what you see described here. -If the default settings are all suitable for you, simply close this Pull Request unmerged and your first renovation will begin the next time the program is run. +Alternatively, you can add the same configuration settings into a "renovate" section of your \`package.json\` file(s) in this branch and delete the \`renovate.json\` from this PR. If you make these configuration changes in this branch then the results will be described in this PR after the next time Renovate runs. `; if (warnings.length) { let prWarnings = `---\n\n### Warnings (${warnings.length})\n\n`; diff --git a/test/workers/repository/__snapshots__/onboarding.spec.js.snap b/test/workers/repository/__snapshots__/onboarding.spec.js.snap index 97f197f7d3..d35d12af03 100644 --- a/test/workers/repository/__snapshots__/onboarding.spec.js.snap +++ b/test/workers/repository/__snapshots__/onboarding.spec.js.snap @@ -7,7 +7,7 @@ Array [ "Configure Renovate", "Welcome to [Renovate](https://keylocation.sg/our-tech/renovate)! -This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, we will begin keeping your dependencies up-to-date via automated Pull Requests. +This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, Renovate will begin keeping your dependencies up-to-date via automated Pull Requests. --- @@ -20,20 +20,19 @@ With your current configuration, renovate will initially create the following Pu | **Upgrade b**<ul><li>Schedule: \\"on monday\\"</li><li>Branch name: \`branch-b\`</li><li>Upgrades [b](https://b) in \`undefined\` from \`1.0.0\` to \`2.0.0\`</li></ul> | -Would you like to change this? Simply edit the \`renovate.json\` in this branch and Renovate will update this Pull Request description the next time it runs. +Sometimes you may see multiple options for the same dependency (e.g. pinning in one branch and upgrading in another). This is expected and allows you the flexibility to choose which to merge first. Once you merge any PR, others will be updated or removed the next time Renovate runs. -The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify this behaviour. +Would you like to change the way Renovate is upgrading your dependencies? Simply edit the \`renovate.json\` in this branch and this Pull Request description will be udpated the next time Renovate runs. ---- +The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify any behaviour. -#### Important! +--- -You do not need to *merge* this Pull Request - renovate will begin even if it's closed *unmerged*. -In fact, you only need to add a \`renovate.json\` file to your repository if you wish to override any default settings. The file is included as part of this PR only in case you wish to change default settings before you start. +#### Don't want a \`renovate.json\` file? -Alternatively, you can add the same configuration settings into a \\"renovate\\" section of \`package.json\`, which might be more convenient if you have only one. +You are not required to *merge* this Pull Request - Renovate will begin even if this \\"Configure Renovate\\" PR is closed *unmerged* and without a \`renovate.json\` file. However, it's recommended that you add configuration to your repository to ensure behaviour matches what you see described here. -If the default settings are all suitable for you, simply close this Pull Request unmerged and your first renovation will begin the next time the program is run. +Alternatively, you can add the same configuration settings into a \\"renovate\\" section of your \`package.json\` file(s) in this branch and delete the \`renovate.json\` from this PR. If you make these configuration changes in this branch then the results will be described in this PR after the next time Renovate runs. ", ], ] @@ -46,7 +45,7 @@ Array [ "Configure Renovate", "Welcome to [Renovate](https://keylocation.sg/our-tech/renovate)! -This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, we will begin keeping your dependencies up-to-date via automated Pull Requests. +This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, Renovate will begin keeping your dependencies up-to-date via automated Pull Requests. --- @@ -54,20 +53,19 @@ You have configured renovate to use branch \`next\` as base branch. It looks like your repository dependencies are already up-to-date and no initial Pull Requests will be necessary. -Would you like to change this? Simply edit the \`renovate.json\` in this branch and Renovate will update this Pull Request description the next time it runs. +Sometimes you may see multiple options for the same dependency (e.g. pinning in one branch and upgrading in another). This is expected and allows you the flexibility to choose which to merge first. Once you merge any PR, others will be updated or removed the next time Renovate runs. -The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify this behaviour. +Would you like to change the way Renovate is upgrading your dependencies? Simply edit the \`renovate.json\` in this branch and this Pull Request description will be udpated the next time Renovate runs. ---- +The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify any behaviour. -#### Important! +--- -You do not need to *merge* this Pull Request - renovate will begin even if it's closed *unmerged*. -In fact, you only need to add a \`renovate.json\` file to your repository if you wish to override any default settings. The file is included as part of this PR only in case you wish to change default settings before you start. +#### Don't want a \`renovate.json\` file? -Alternatively, you can add the same configuration settings into a \\"renovate\\" section of \`package.json\`, which might be more convenient if you have only one. +You are not required to *merge* this Pull Request - Renovate will begin even if this \\"Configure Renovate\\" PR is closed *unmerged* and without a \`renovate.json\` file. However, it's recommended that you add configuration to your repository to ensure behaviour matches what you see described here. -If the default settings are all suitable for you, simply close this Pull Request unmerged and your first renovation will begin the next time the program is run. +Alternatively, you can add the same configuration settings into a \\"renovate\\" section of your \`package.json\` file(s) in this branch and delete the \`renovate.json\` from this PR. If you make these configuration changes in this branch then the results will be described in this PR after the next time Renovate runs. ", ], ] @@ -80,7 +78,7 @@ Array [ "Configure Renovate", "Welcome to [Renovate](https://keylocation.sg/our-tech/renovate)! -This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, we will begin keeping your dependencies up-to-date via automated Pull Requests. +This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, Renovate will begin keeping your dependencies up-to-date via automated Pull Requests. --- @@ -111,20 +109,19 @@ With your current configuration, renovate will initially create the following Pu | **Upgrade b**<ul><li>Branch name: \`branch-b\`</li><li>Upgrades [b](https://b) in \`undefined\` from \`1.0.0\` to \`2.0.0\`</li></ul> | -Would you like to change this? Simply edit the \`renovate.json\` in this branch and Renovate will update this Pull Request description the next time it runs. +Sometimes you may see multiple options for the same dependency (e.g. pinning in one branch and upgrading in another). This is expected and allows you the flexibility to choose which to merge first. Once you merge any PR, others will be updated or removed the next time Renovate runs. -The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify this behaviour. +Would you like to change the way Renovate is upgrading your dependencies? Simply edit the \`renovate.json\` in this branch and this Pull Request description will be udpated the next time Renovate runs. ---- +The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify any behaviour. -#### Important! +--- -You do not need to *merge* this Pull Request - renovate will begin even if it's closed *unmerged*. -In fact, you only need to add a \`renovate.json\` file to your repository if you wish to override any default settings. The file is included as part of this PR only in case you wish to change default settings before you start. +#### Don't want a \`renovate.json\` file? -Alternatively, you can add the same configuration settings into a \\"renovate\\" section of \`package.json\`, which might be more convenient if you have only one. +You are not required to *merge* this Pull Request - Renovate will begin even if this \\"Configure Renovate\\" PR is closed *unmerged* and without a \`renovate.json\` file. However, it's recommended that you add configuration to your repository to ensure behaviour matches what you see described here. -If the default settings are all suitable for you, simply close this Pull Request unmerged and your first renovation will begin the next time the program is run. +Alternatively, you can add the same configuration settings into a \\"renovate\\" section of your \`package.json\` file(s) in this branch and delete the \`renovate.json\` from this PR. If you make these configuration changes in this branch then the results will be described in this PR after the next time Renovate runs. ", ], ] @@ -137,7 +134,7 @@ Array [ "Configure Renovate", "Welcome to [Renovate](https://keylocation.sg/our-tech/renovate)! -This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, we will begin keeping your dependencies up-to-date via automated Pull Requests. +This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, Renovate will begin keeping your dependencies up-to-date via automated Pull Requests. --- @@ -149,20 +146,19 @@ With your current configuration, renovate will initially create the following Pu | **Pin a**<ul><li>Branch name: \`branch-a\`</li><li>Pins [a](https://a) in \`undefined\` from \`^1.0.0\` to \`1.1.0\`</li><li>Upgrades [b](https://b) in \`undefined\` from \`1.0.0\` to \`2.0.0\`</li></ul> | -Would you like to change this? Simply edit the \`renovate.json\` in this branch and Renovate will update this Pull Request description the next time it runs. +Sometimes you may see multiple options for the same dependency (e.g. pinning in one branch and upgrading in another). This is expected and allows you the flexibility to choose which to merge first. Once you merge any PR, others will be updated or removed the next time Renovate runs. -The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify this behaviour. +Would you like to change the way Renovate is upgrading your dependencies? Simply edit the \`renovate.json\` in this branch and this Pull Request description will be udpated the next time Renovate runs. ---- +The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify any behaviour. -#### Important! +--- -You do not need to *merge* this Pull Request - renovate will begin even if it's closed *unmerged*. -In fact, you only need to add a \`renovate.json\` file to your repository if you wish to override any default settings. The file is included as part of this PR only in case you wish to change default settings before you start. +#### Don't want a \`renovate.json\` file? -Alternatively, you can add the same configuration settings into a \\"renovate\\" section of \`package.json\`, which might be more convenient if you have only one. +You are not required to *merge* this Pull Request - Renovate will begin even if this \\"Configure Renovate\\" PR is closed *unmerged* and without a \`renovate.json\` file. However, it's recommended that you add configuration to your repository to ensure behaviour matches what you see described here. -If the default settings are all suitable for you, simply close this Pull Request unmerged and your first renovation will begin the next time the program is run. +Alternatively, you can add the same configuration settings into a \\"renovate\\" section of your \`package.json\` file(s) in this branch and delete the \`renovate.json\` from this PR. If you make these configuration changes in this branch then the results will be described in this PR after the next time Renovate runs. ", ], ] @@ -175,7 +171,7 @@ Array [ "Configure Renovate", "Welcome to [Renovate](https://keylocation.sg/our-tech/renovate)! -This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, we will begin keeping your dependencies up-to-date via automated Pull Requests. +This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, Renovate will begin keeping your dependencies up-to-date via automated Pull Requests. --- @@ -187,20 +183,19 @@ With your current configuration, renovate will initially create the following Pu | **Lock File Maintenance**<ul><li>Schedule: \\"before 5am on monday\\"</li><li>Branch name: \`renovate/lock-files\`</li><li>Regenerates \`yarn.lock\` file to use latest dependency versions</li></ul> | -Would you like to change this? Simply edit the \`renovate.json\` in this branch and Renovate will update this Pull Request description the next time it runs. +Sometimes you may see multiple options for the same dependency (e.g. pinning in one branch and upgrading in another). This is expected and allows you the flexibility to choose which to merge first. Once you merge any PR, others will be updated or removed the next time Renovate runs. -The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify this behaviour. +Would you like to change the way Renovate is upgrading your dependencies? Simply edit the \`renovate.json\` in this branch and this Pull Request description will be udpated the next time Renovate runs. ---- +The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify any behaviour. -#### Important! +--- -You do not need to *merge* this Pull Request - renovate will begin even if it's closed *unmerged*. -In fact, you only need to add a \`renovate.json\` file to your repository if you wish to override any default settings. The file is included as part of this PR only in case you wish to change default settings before you start. +#### Don't want a \`renovate.json\` file? -Alternatively, you can add the same configuration settings into a \\"renovate\\" section of \`package.json\`, which might be more convenient if you have only one. +You are not required to *merge* this Pull Request - Renovate will begin even if this \\"Configure Renovate\\" PR is closed *unmerged* and without a \`renovate.json\` file. However, it's recommended that you add configuration to your repository to ensure behaviour matches what you see described here. -If the default settings are all suitable for you, simply close this Pull Request unmerged and your first renovation will begin the next time the program is run. +Alternatively, you can add the same configuration settings into a \\"renovate\\" section of your \`package.json\` file(s) in this branch and delete the \`renovate.json\` from this PR. If you make these configuration changes in this branch then the results will be described in this PR after the next time Renovate runs. ", ], ] diff --git a/test/workers/repository/onboarding.spec.js b/test/workers/repository/onboarding.spec.js index c382e587c0..07ea36224e 100644 --- a/test/workers/repository/onboarding.spec.js +++ b/test/workers/repository/onboarding.spec.js @@ -33,29 +33,8 @@ describe('lib/workers/repository/onboarding', () => { expect(config.api.updatePr.mock.calls.length).toBe(1); }); it('does not update pr', async () => { - const existingPrBody = `Welcome to [Renovate](https://keylocation.sg/our-tech/renovate)! - -This is an onboarding PR to help you understand and configure Renovate before any changes are made to any \`package.json\` files. Once you close this Pull Request, we will begin keeping your dependencies up-to-date via automated Pull Requests. - ---- - -It looks like your repository dependencies are already up-to-date and no initial Pull Requests will be necessary. - -Would you like to change this? Simply edit the \`renovate.json\` in this branch and Renovate will update this Pull Request description the next time it runs. - -The [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify this behaviour. - ---- - -#### Important! - -You do not need to *merge* this Pull Request - renovate will begin even if it's closed *unmerged*. -In fact, you only need to add a \`renovate.json\` file to your repository if you wish to override any default settings. The file is included as part of this PR only in case you wish to change default settings before you start. - -Alternatively, you can add the same configuration settings into a "renovate" section of \`package.json\`, which might be more convenient if you have only one. - -If the default settings are all suitable for you, simply close this Pull Request unmerged and your first renovation will begin the next time the program is run. -`; + const existingPrBody = + 'Welcome to [Renovate](https://keylocation.sg/our-tech/renovate)!\n\nThis is an onboarding PR to help you understand and configure Renovate before any changes are made to any `package.json` files. Once you close this Pull Request, Renovate will begin keeping your dependencies up-to-date via automated Pull Requests.\n\n---\n\nIt looks like your repository dependencies are already up-to-date and no initial Pull Requests will be necessary.\n\nSometimes you may see multiple options for the same dependency (e.g. pinning in one branch and upgrading in another). This is expected and allows you the flexibility to choose which to merge first. Once you merge any PR, others will be updated or removed the next time Renovate runs.\n\nWould you like to change the way Renovate is upgrading your dependencies? Simply edit the `renovate.json` in this branch and this Pull Request description will be udpated the next time Renovate runs.\n\nThe [Configuration](https://github.com/singapore/renovate/blob/master/docs/configuration.md) and [Configuration FAQ](https://github.com/singapore/renovate/blob/master/docs/faq.md) documents should be helpful if you wish to modify any behaviour.\n\n---\n\n#### Don\'t want a `renovate.json` file?\n\nYou are not required to *merge* this Pull Request - Renovate will begin even if this "Configure Renovate" PR is closed *unmerged* and without a `renovate.json` file. However, it\'s recommended that you add configuration to your repository to ensure behaviour matches what you see described here.\n\nAlternatively, you can add the same configuration settings into a "renovate" section of your `package.json` file(s) in this branch and delete the `renovate.json` from this PR. If you make these configuration changes in this branch then the results will be described in this PR after the next time Renovate runs.\n'; config.api.getBranchPr.mockReturnValueOnce({ title: 'Configure Renovate', body: existingPrBody, -- GitLab