Open SchulteMarkus opened 2 years ago
Hi @SchulteMarkus , we purposefully don't delete the preview environments in both GitHub and ADO, as the very purpose of the preview environments was to have a stable URLs and the users could link them to auth and API backends and let the users decide to delete these environments if they are no longer used and are not linked anywhere.
Hi @SchulteMarkus , we purposefully don't delete the preview environments in both GitHub and ADO, as the very purpose of the preview environments was to have a stable URLs and the users could link them to auth and API backends and let the users decide to delete these environments if they are no longer used and are not linked anywhere.
@rupareddy5-21 With respect, this is not true. The example from above
with:
action: "close"
shows how to cleanup at GitHub automatically.
Hi @SchulteMarkus, that works for the PR environments when the PR is closed or the corresponding branch is deleted, but not for branch and named preview environments. Please check here - https://learn.microsoft.com/en-us/azure/static-web-apps/preview-environments#deployment-types. Thanks!
@rupareddy5-21 I think this GitHub issue is really asking for PR environments to be supported in Azure DevOps.
I think the naming of "branch environments", "preview environments", and "PR environments" is causing confusion. PR environments can reasonably be considered previews (of what you'll get when the PR merges) and you might also think of them as per-branch environments (because the PR is a separate branch). So all of these names sound like they're referring to the same thing.
I, too, was confused about this until @rupareddy5-21's previous comment, and I re-read the documentation carefully.
I know this isn't something that can be decided in a GitHub issue, but if I were designing the product naming to alleviate this confusion, I would do the following:
Rename "Preview environments" to "additional environments" (or "slots", since that's what App Service calls its nearly-identical feature).
Remove the term "branch environments" and simply consider it a special case of named environments. They seem like the same thing to me, the only difference is that one is named explicitly in the pipeline task, the other is implicitly named after the branch being built.
If there were only "named environments" and "PR environments", it would be easier to keep straight what each is for.
That's insightful feedback @jennings! Thanks, we shall rework on naming these in a less-ambiguous way! cc// @craigshoemaker
Hi @rupareddy5-21 @Reshmi-Sriram do we have any ADO options to close the PR environments?
In Azure DevOps Pipeline I am using branch preview environments as described on https://learn.microsoft.com/en-us/azure/static-web-apps/branch-environments?tabs=azure-devops
This works fine as intended.
Feature request Once the branch the preview environment was created for is being deleted, delete the related branch preview environments automatically. For example, by adding an option "auto_cleanup_branch_preview_environments".
Background
Seems as if at least for pull requests at GitHub a cleanup is already supported for time being
Source: https://learn.microsoft.com/de-de/azure/static-web-apps/build-configuration?tabs=github-actions#build-and-deploy
close_pull_request_job: if: github.event_name == 'pull_request' && github.event.action == 'closed' steps: