Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CICD Include PR number from build in the terraform workspace name to avoid deployment collisions during PR branch CI/CD processes #311

Open
4 tasks done
KeithJRome opened this issue Sep 23, 2019 · 2 comments

Comments

@KeithJRome
Copy link
Contributor

KeithJRome commented Sep 23, 2019

Description

As a developer, I'd like to have the CI/CD process perform any test deployments for my PR in a way that ensures no conflict with other PRs (or with master), in order to avoid any workspace or naming conflicts.

It was determined that a good way to achieve this would be to modify our YAML pipeline to incorporate the PR number (if triggered via PR) into the workspace name. The workspace name is currently assembled by combining the workspacePrefix in the top-level YAML with the build environment (ie "devint"/etc).

(additional scope 10/3/2019):
To reduce risk to other ongoing work, we decided to fold additional functionality into this story. This includes:

  • Ability to disable/enable PR isolation of deployments from top-level YAML per environment/template
  • Ability to disable/enable name randomization from top-level YAML per environment/template

Acceptance Criteria

Reference: [Done-Done Checklist] (https://github.com/Microsoft/code-with-engineering-playbook/blob/master/Engineering/BestPractices/DoneDone.md)

  • CI/CD deployments from master branch should continue to operate the same as they do prior to this change (no change to workspace and resource naming)
  • CI/CD deployments from Pull Request branches should insert the PR number into the workspace name (which then should cascade into the resource names)
  • Use of PR number in workspace name should be configurable through pipeline YAML
  • Use of random characters in resource names should be configurable through pipeline YAML

Resources

Tasks

Stories are intended to be completed in a single sprint; if task breakdown creates addition work then team should discuss promoting the Story to an Epic.
Reference: [Minimal Valuable Slices] (https://github.com/Microsoft/code-with-engineering-playbook/blob/master/Engineering/BestPractices/MinimalSlices.md)

Reference: [How to Write Better Tasks] (http://agilebutpragmatic.blogspot.com/2012/04/splitting-story-into-tasks-how-to-write.html)

Assignee should break down work into tasks here

@KeithJRome KeithJRome added this to Sprint Backlog in Current Iteration via automation Sep 23, 2019
@ThePhen
Copy link
Contributor

ThePhen commented Sep 23, 2019

It might be important that someone/something clean-up AZ resources, once a PR is merged/closed (or else the resources will keep billing).

@erikschlegel
Copy link
Contributor

I love the idea of including the PR id within the workspace prefix.

@KeithJRome KeithJRome moved this from Sprint Backlog to Active in Current Iteration Sep 26, 2019
@KeithJRome KeithJRome added the effort - medium 2 day effort label Sep 30, 2019
@TechnicallyWilliams TechnicallyWilliams moved this from Active to V1 in Current Iteration Oct 4, 2019
@TechnicallyWilliams TechnicallyWilliams moved this from V1 to Active in Current Iteration Oct 4, 2019
@KeithJRome KeithJRome added effort - large 3 day effort and removed effort - medium 2 day effort labels Oct 4, 2019
@KeithJRome KeithJRome moved this from Active to PR Submitted in Current Iteration Oct 8, 2019
@ianphil ianphil moved this from PR Submitted to Done in Current Iteration Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

3 participants