diff --git a/.gitignore b/.gitignore index 30492bcbc5..d610611db9 100644 --- a/.gitignore +++ b/.gitignore @@ -19,10 +19,9 @@ coverage/ blc_output.log blc_output_internal.log broken_links.md -lib/redirects/.redirects-cache.json # This one is purely for historical reasons because so many people might -# still have thes files on their disk. -lib/redirects/.redirects-cache_*.json +# still have these files on their disk. +lib/redirects/.redirects-cache*.json # During the preview deploy untrusted user code may be cloned into this directory # We ignore it from git to keep things deterministic diff --git a/assets/images/help/codespaces/disable-prebuild-optimization.png b/assets/images/help/codespaces/disable-prebuild-optimization.png new file mode 100644 index 0000000000..515b86ee6b Binary files /dev/null and b/assets/images/help/codespaces/disable-prebuild-optimization.png differ diff --git a/assets/images/help/codespaces/edit-prebuild-configuration.png b/assets/images/help/codespaces/edit-prebuild-configuration.png new file mode 100644 index 0000000000..03de0d1f31 Binary files /dev/null and b/assets/images/help/codespaces/edit-prebuild-configuration.png differ diff --git a/assets/images/help/codespaces/show-advanced-options.png b/assets/images/help/codespaces/show-advanced-options.png new file mode 100644 index 0000000000..7849d383ff Binary files /dev/null and b/assets/images/help/codespaces/show-advanced-options.png differ diff --git a/content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md b/content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md index 4ab4dec53c..9c44b43045 100644 --- a/content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md +++ b/content/codespaces/prebuilding-your-codespaces/configuring-prebuilds.md @@ -27,9 +27,7 @@ Before you can configure prebuilds for your project the following must be true: ## Configuring a prebuild -{% data reusables.repositories.navigate-to-repo %} -{% data reusables.repositories.sidebar-settings %} -1. In the "Code & automation" section of the sidebar, click **{% octicon "codespaces" aria-label="The Codespaces icon" %} {% data variables.product.prodname_codespaces %}**. +{% data reusables.codespaces.accessing-prebuild-configuration %} 1. In the "Prebuild configuration" section of the page, click **Set up prebuild**. ![The 'Set up prebuilds' button](/assets/images/help/codespaces/prebuilds-set-up.png) @@ -80,6 +78,12 @@ Before you can configure prebuilds for your project the following must be true: ![The prebuild failure notification setting](/assets/images/help/codespaces/prebuilds-failure-notification-setting.png) +1. Optionally, at the bottom of the page, click **Show advanced options**. + + ![Screenshot of the prebuild configuration page, with "Show advanced options" highlighted](/assets/images/help/codespaces/show-advanced-options.png) + + In the "Advanced options" section, if you select **Disable prebuild optimization**, codespaces will be created without a prebuild if the latest prebuild workflow has failed or is currently running. For more information, see "[Troubleshooting prebuilds](/codespaces/troubleshooting/troubleshooting-prebuilds#preventing-out-of-date-prebuilds-being-used)." + 1. Click **Create**. {% data reusables.codespaces.prebuilds-permission-authorization %} diff --git a/content/codespaces/troubleshooting/troubleshooting-prebuilds.md b/content/codespaces/troubleshooting/troubleshooting-prebuilds.md index 7c4b0ca4e8..45f62d023a 100644 --- a/content/codespaces/troubleshooting/troubleshooting-prebuilds.md +++ b/content/codespaces/troubleshooting/troubleshooting-prebuilds.md @@ -65,6 +65,24 @@ If the `devcontainer.json` configuration file for a prebuild configuration is up If the workflow runs for a prebuild configuration are failing, you can temporarily disable the prebuild configuration while you investigate. For more information, see "[Managing prebuilds](/codespaces/prebuilding-your-codespaces/managing-prebuilds#disabling-a-prebuild-configuration)." +### Preventing out-of-date prebuilds being used + +By default, if the latest prebuild workflow has failed, then a previous prebuild for the same combination of repository, branch, and `devcontainer.json` configuration file will be used to create new codespaces. This behavior is called prebuild optimization. + +We recommend keeping prebuild optimization enabled, because it helps ensure that codespaces can still be created quickly if an up-to-date prebuild is not available. However, as a repository administrator, you can disable prebuild optimization if you run into problems with prebuilt codespaces being behind the current state of the branch. If you disable prebuild optimization, codespaces for the relevant combination of repository, branch, and `devcontainer.json` file will be created without a prebuild if the latest prebuild workflow has failed or is currently running. + +{% data reusables.codespaces.accessing-prebuild-configuration %} +1. To the right of the affected prebuild configuration, select the ellipsis (**...**), then click **Edit**. + + ![Screenshot of a list of prebuilds, with "Edit" highlighted](/assets/images/help/codespaces/edit-prebuild-configuration.png) +1. Scroll to the bottom of the "Edit configuration" page and click **Show advanced options**. + + ![Screenshot of the prebuild configuration page, with "Show advanced options" highlighted](/assets/images/help/codespaces/show-advanced-options.png) +1. If you're sure you want to disable the default setting, select **Disable prebuild optimization**. + + ![Screenshot of the advanced option section and the "disable prebuild optmization" setting](/assets/images/help/codespaces/disable-prebuild-optimization.png) +1. To save your change, click **Update**. + ## Further reading - "[Configuring prebuilds](/codespaces/prebuilding-your-codespaces/configuring-prebuilds)" diff --git a/data/reusables/codespaces/accessing-prebuild-configuration.md b/data/reusables/codespaces/accessing-prebuild-configuration.md new file mode 100644 index 0000000000..35183e342a --- /dev/null +++ b/data/reusables/codespaces/accessing-prebuild-configuration.md @@ -0,0 +1,3 @@ +{% data reusables.repositories.navigate-to-repo %} +{% data reusables.repositories.sidebar-settings %} +1. In the "Code & automation" section of the sidebar, click **{% octicon "codespaces" aria-label="The Codespaces icon" %} {% data variables.product.prodname_codespaces %}**. \ No newline at end of file diff --git a/lib/redirects/static/redirect-exceptions.txt b/lib/redirects/static/redirect-exceptions.txt index 7e89add898..46149b72ef 100644 --- a/lib/redirects/static/redirect-exceptions.txt +++ b/lib/redirects/static/redirect-exceptions.txt @@ -1,8 +1,3 @@ -# Redirects are cached in 'lib/redirects/.redirects-cache.json'. If changes made here are not being reflected -# on your local server, delete the cache file by running the following command, then restart your server. -# -# rm lib/redirects/.redirects-cache.json - # These urls are exceptions to the versionless redirect fallbacks (described in lib/all-versions.js). # See the comment in lib/redirects/precompile.js for an explanation of these exceptions. # Originally shipped in pull #20947 on 10/15/21 diff --git a/script/move-content.js b/script/move-content.js index 46084a54f0..0ccc01ddf9 100755 --- a/script/move-content.js +++ b/script/move-content.js @@ -155,18 +155,6 @@ async function main(opts, nameTuple) { ) } } - - const redirectsCachingFile = 'lib/redirects/.redirects-cache.json' - if (fs.existsSync(redirectsCachingFile)) { - fs.unlinkSync(redirectsCachingFile) - if (verbose) { - console.log( - chalk.yellow( - `Deleted the redirects caching file ${redirectsCachingFile} to stale cache in local server testing.` - ) - ) - } - } } function validateFileInputs(oldPath, newPath, isFolder) { diff --git a/tests/fixtures/versionless-redirects.txt b/tests/fixtures/versionless-redirects.txt index 2631a91c4e..e964debc9f 100644 --- a/tests/fixtures/versionless-redirects.txt +++ b/tests/fixtures/versionless-redirects.txt @@ -1,8 +1,3 @@ -# Redirects are cached in 'lib/redirects/.redirects-cache.json'. If changes made here are not being reflected -# on your local server, delete the cache file by running the following command, then restart your server. -# -# rm lib/redirects/.redirects-cache.json - # These urls went from being free-pro-team, but are now versioned for more than one enterprise version and enterprise-cloud # Shipped in pull #20947 on 10/15/21 @@ -145,7 +140,7 @@ - /github/setting-up-and-managing-your-enterprise/configuring-identity-and-access-management-for-your-enterprise-account - /admin/authentication/managing-identity-and-access-for-your-enterprise -# These URLs went from being in free-pro-team to ONLY to being in enterprise-cloud only. +# These URLs went from being in free-pro-team to ONLY to being in enterprise-cloud only. # Shipped in pull #20947 on 10/15/21 /enterprise-cloud@latest/admin/identity-and-access-management/using-saml-for-enterprise-iam/managing-team-synchronization-for-organizations-in-your-enterprise @@ -278,7 +273,7 @@ # - lib/github/private_instance_bootstrapper/internal_support_contact.rb # - lib/github/private_instance_bootstrapper/saml_idp_configuration.rb # - lib/github/private_instance_bootstrapper/policies_configuration.rb -# This redirect ensures that the links don't resolve to the non-GHAE version +# This redirect ensures that the links don't resolve to the non-GHAE version # of the docs as this article only exists in the GHAE docs. /github-ae@latest/admin/configuration/configuring-your-enterprise/initializing-github-ae