{"type": "body", "content": "", "style": null, "bbox": [8, 8, 1264, 1226], "children": [{"type": "main", "content": "", "style": null, "bbox": [8, 8, 1264, 1226], "children": [{"type": "header", "content": "", "style": null, "bbox": [8, 8, 1264, 113], "children": [{"type": "nav", "content": "", "style": null, "bbox": [8, 8, 1264, 18], "children": [{"type": "a", "content": "", "style": null, "bbox": [8, 8, 22, 17], "children": []}, {"type": "a", "content": "Tailor's", "style": null, "bbox": [30, 8, 47, 17], "children": []}]}, {"type": "h1", "content": "", "style": null, "bbox": [8, 47, 1264, 74], "children": [{"type": "div", "content": "", "style": null, "bbox": [8, 84, 1264, 37], "children": [{"type": "a", "content": "Philipp Schneider", "style": null, "bbox": [8, 84, 244, 36], "children": []}, {"type": "time", "content": "7/21/2020", "style": null, "bbox": [252, 84, 129, 36], "children": []}]}]}]}, {"type": "article", "content": "", "style": null, "bbox": [8, 142, 1264, 1057], "children": [{"type": "h2", "content": "", "style": null, "bbox": [8, 142, 1264, 27], "children": [{"type": "a", "content": "A repulsive example", "style": null, "bbox": [8, 142, 206, 26], "children": []}]}, {"type": "p", "content": "", "style": null, "bbox": [8, 189, 1264, 18], "children": [{"type": "code", "content": "README", "style": null, "bbox": [571, 192, 46, 15], "children": []}]}, {"type": "blockquote", "content": "", "style": null, "bbox": [48, 223, 1184, 36], "children": [{"type": "p", "content": "Ask around on Slack whether it is okay to deploy.\nMake sure that enough people and someone from (dev)ops are available to help in case of a necessary roll back.\nWatch at the CI deployment step to notice when something goes wrong, and be able to test the deployment once it\u2019s done.", "style": null, "bbox": [48, 223, 1184, 36], "children": []}]}, {"type": "p", "content": "Nope, we\u2019re not talking about a decade old legacy product. This was a two year old codebase using next.js, graphQL and a popular headless CMS.", "style": null, "bbox": [8, 275, 1264, 18], "children": []}, {"type": "p", "content": "", "style": null, "bbox": [8, 309, 1264, 54], "children": [{"type": "em", "content": "that", "style": null, "bbox": [250, 309, 24, 17], "children": []}]}, {"type": "blockquote", "content": "", "style": null, "bbox": [48, 379, 1184, 18], "children": [{"type": "p", "content": "Deploying should be as casual as lacing a shoe, a regular automatic action one can do without thinking, drunken in the middle of night.", "style": null, "bbox": [48, 379, 1184, 18], "children": []}]}, {"type": "h2", "content": "", "style": null, "bbox": [8, 417, 1264, 27], "children": [{"type": "a", "content": "Benefits of frequent deployments", "style": null, "bbox": [8, 417, 337, 26], "children": []}]}, {"type": "p", "content": "Let\u2019s re-state the obvious:", "style": null, "bbox": [8, 464, 1264, 18], "children": []}, {"type": "ul", "content": "", "style": null, "bbox": [8, 498, 1264, 90], "children": [{"type": "li", "content": "The more atomic a deployment, the lower the risk of a long term outage. That\u2019s because reverting tiny code changes is easy, and so is finding the responsible code change.", "style": null, "bbox": [48, 498, 1224, 18], "children": []}, {"type": "li", "content": "Frequent deployments result in atomic deployments.", "style": null, "bbox": [48, 516, 1224, 18], "children": []}, {"type": "li", "content": "Frequent deployments train everyone to get good at it. The annoying repetition will quickly motivate the team to automate deployments. The automation will pay off quickly.", "style": null, "bbox": [48, 534, 1224, 18], "children": []}, {"type": "li", "content": "Frequent deployments allow the business to ship changes quicker. This includes fixing the inevitable bugs that eventually make it to production. But really, the higher iteration speed\u2019s value lies in the mindset shift throughout the organisation: we can ship small improvements anytime. The mindset is highly correlated with agile development, and running a lean startup.", "style": null, "bbox": [48, 552, 1224, 36], "children": []}]}, {"type": "h2", "content": "", "style": null, "bbox": [8, 608, 1264, 27], "children": [{"type": "a", "content": "How to get there?", "style": null, "bbox": [8, 608, 181, 26], "children": []}]}, {"type": "p", "content": "If you develop a web app, your goal needs to be that no team member is ever scared to deploy their changes.", "style": null, "bbox": [8, 655, 1264, 18], "children": []}, {"type": "ul", "content": "", "style": null, "bbox": [8, 689, 1264, 252], "children": [{"type": "li", "content": "", "style": null, "bbox": [48, 689, 1224, 72], "children": [{"type": "span", "content": "\u2705", "style": null, "bbox": [628, 725, 5, 17], "children": []}]}, {"type": "li", "content": "Run those tests on every code change that is pushed to the git server. That\u2019s continuous integration (CI). If git is used correctly (feature branches, atomic commits, frequent pushes), the developer has an automatic tight feedback loop, where he/she is made aware that functionality is broken shortly after causing the issue.", "style": null, "bbox": [48, 761, 1224, 36], "children": []}, {"type": "li", "content": "", "style": null, "bbox": [48, 797, 1224, 72], "children": [{"type": "a", "content": "netlify", "style": null, "bbox": [1211, 833, 40, 17], "children": []}, {"type": "a", "content": "vercel", "style": null, "bbox": [48, 851, 39, 17], "children": []}, {"type": "a", "content": "heroku", "style": null, "bbox": [95, 851, 44, 17], "children": []}, {"type": "a", "content": "AWS aplify", "style": null, "bbox": [146, 851, 74, 17], "children": []}]}, {"type": "li", "content": "Allow the person who makes a code change to deploy this change once tests are passing and the change review gave a green light, independent of other people\u2019s code changes. Letting a change owner deploy distributes knowledge and responsibility. No one knows better than the code change owner when there\u2019s a reason to be careful about a specific deployment. If merging a code change from feature to the main branch results in an automatic deployment (with pre / post-deploy test execution against production please!) to production you can praise yourself for doing continuous deployment (CD).", "style": null, "bbox": [48, 869, 1224, 72], "children": []}]}, {"type": "h2", "content": "", "style": null, "bbox": [8, 961, 1264, 27], "children": [{"type": "a", "content": "In what situation is CI/CD bad advice?", "style": null, "bbox": [8, 961, 398, 26], "children": []}]}, {"type": "p", "content": "The general gist of simplifying deployments, and being confident in deployments are always applicable. Thanks dear devops movement for making everyone aware!", "style": null, "bbox": [8, 1008, 1264, 18], "children": []}, {"type": "p", "content": "", "style": null, "bbox": [8, 1042, 1264, 72], "children": [{"type": "a", "content": "that makes us bad at software engineering", "style": null, "bbox": [781, 1042, 268, 17], "children": []}, {"type": "span", "content": "\ud83d\ude2c", "style": null, "bbox": [1059, 1042, 5, 17], "children": []}, {"type": "em", "content": "might", "style": null, "bbox": [494, 1060, 36, 17], "children": []}]}, {"type": "p", "content": "But besides those examples?", "style": null, "bbox": [8, 1130, 1264, 18], "children": []}, {"type": "p", "content": "For regular consumer facing web based projects I\u2019d rather \u201cask for forgiveness, not permission\u201d. The former you\u2019ll have to do for 1 out of 100 deployments, the latter a 100 out of a 100 times. I know which one seems the better trade-off to me.", "style": null, "bbox": [8, 1164, 1264, 36], "children": []}]}, {"type": "footer", "content": "", "style": null, "bbox": [8, 1216, 1264, 18], "children": [{"type": "a", "content": "RSS", "style": null, "bbox": [8, 1216, 28, 17], "children": []}]}]}]}
<!DOCTYPE html>

<!DOCTYPE html>

<html><head><title>Tailor's Blog</title></head><body><main><header class="header"><nav><a> &lt;/&gt;</a><a class="blog-name">Tailor's</a></nav><h1 class="title">Deployment despair<div class="biline"><a class="author">Philipp Schneider</a><time class="date">7/21/2020</time></div></h1></header><article class="content"><h2 id="a-repulsive-example"><a>A repulsive example</a></h2><p>Recently I pulled out a few strains of my hair out of despair when I opened a web app’s <code>README</code> and read the deployment section:</p><blockquote><p>Ask around on Slack whether it is okay to deploy.
Make sure that enough people and someone from (dev)ops are available to help in case of a necessary roll back.
Watch at the CI deployment step to notice when something goes wrong, and be able to test the deployment once it’s done.</p></blockquote><p>Nope, we’re not talking about a decade old legacy product. This was a two year old codebase using next.js, graphQL and a popular headless CMS.</p><p>The deployment process itself wasn’t <em>that</em> hard, but there was a climate of fear and a resistance to deployments. It’s not that the people running the project weren’t technically capable of implementing automated testing (there was an abandoned cypress flow, and a couple useless jest unit tests). The root cause was that team was mismanaged. The devs however were responsible for their own misery too: they were not self-protective enough to spend a couple of hours to evolve the deployment process.</p><blockquote><p>Deploying should be as casual as lacing a shoe, a regular automatic action one can do without thinking, drunken in the middle of night.</p></blockquote><h2 id="benefits-of-frequent-deployments"><a>Benefits of frequent deployments</a></h2><p>Let’s re-state the obvious:</p><ul><li>The more atomic a deployment, the lower the risk of a long term outage. That’s because reverting tiny code changes is easy, and so is finding the responsible code change.</li><li>Frequent deployments result in atomic deployments.</li><li>Frequent deployments train everyone to get good at it. The annoying repetition will quickly motivate the team to automate deployments. The automation will pay off quickly.</li><li>Frequent deployments allow the business to ship changes quicker. This includes fixing the inevitable bugs that eventually make it to production. But really, the higher iteration speed’s value lies in the mindset shift throughout the organisation: we can ship small improvements anytime. The mindset is highly correlated with agile development, and running a lean startup.</li></ul><h2 id="how-to-get-there"><a>How to get there?</a></h2><p>If you develop a web app, your goal needs to be that no team member is ever scared to deploy their changes.</p><ul><li>Cover the most popular real-world usage with tests. This means E2E tests. Unit and integration tests don’t hurt, but in my experience their main benefit is to help documenting the business logic’s detailed acceptance criteria for future team members and prevent small regressions during development. Actual confidence in the deployment stems from knowing that the core user flow has been covered in an environment alike to the user’s product navigation. If this is a <span>✅</span>, the developer knows that he/she won’t be called on duty on the weekend. Non-essential bugs can wait.</li><li>Run those tests on every code change that is pushed to the git server. That’s continuous integration (CI). If git is used correctly (feature branches, atomic commits, frequent pushes), the developer has an automatic tight feedback loop, where he/she is made aware that functionality is broken shortly after causing the issue.</li><li>Enforce change review. Code review of a pull request is typical, but having a product manager or QA look at a code change to verify that the code change’s functionality change is working as expected and there’s no immediately visible side-effect goes a long way towards piece of mind. Code review naturally would contribute to team member’s learning from each other and potentially spotting deeper hidden issues (like code smells). Reduce the friction of review as far as possible. Having a separate, accessible deployment for the code change is perfect (<a>netlify</a>, <a>vercel</a>, <a>heroku</a>, <a>AWS aplify</a>, and other providers offer a “branch deployment” feature, usually it’s a 1-click install when using GitHub).</li><li>Allow the person who makes a code change to deploy this change once tests are passing and the change review gave a green light, independent of other people’s code changes. Letting a change owner deploy distributes knowledge and responsibility. No one knows better than the code change owner when there’s a reason to be careful about a specific deployment. If merging a code change from feature to the main branch results in an automatic deployment (with pre / post-deploy test execution against production please!) to production you can praise yourself for doing continuous deployment (CD).</li></ul><h2 id="in-what-situation-is-cicd-bad-advice"><a>In what situation is CI/CD bad advice?</a></h2><p>The general gist of simplifying deployments, and being confident in deployments are always applicable. Thanks dear devops movement for making everyone aware!</p><p>If your product has a high risk profile, then you might not have any business deploying fast - which is part of the culture <a>that makes us bad at software engineering</a>! <span>😬</span>
Let’s say your product is a nuclear plant. Or election computers. Really any critical infrastructure. You <em>might</em> want to have more safe-guards in place for software deployments. You might not want to allow individual contributors to deploy changes themselves. You might have technical reasons preventing frequent deployments, e.g. software development might not happen on-site with the deployment and the site might be disconnected from public networks for security reasons.</p><p>But besides those examples?</p><p>For regular consumer facing web based projects I’d rather “ask for forgiveness, not permission”. The former you’ll have to do for 1 out of 100 deployments, the latter a 100 out of a 100 times. I know which one seems the better trade-off to me.</p></article><footer><a>RSS</a><astro-island><div class="theme-switch svelte-1scvn92">switch theme <label class="switch svelte-1scvn92"><input class="svelte-1scvn92" id="theme-switch-input"/> <span class="slider svelte-1scvn92"></span></label> </div></astro-island></footer></main><style>.theme-switch.svelte-1scvn92.svelte-1scvn92 {
    float: right;
    user-select: none;
    display: flex;
    align-items: center
    }
.switch.svelte-1scvn92.svelte-1scvn92 {
    margin-inline-start: 0.5rem;
    position: relative;
    display: inline-block;
    width: 3.5rem;
    height: 2rem;
    user-select: none
    }
.switch.svelte-1scvn92 input.svelte-1scvn92 {
    opacity: 0;
    width: 0;
    height: 0
    }
.slider.svelte-1scvn92.svelte-1scvn92 {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--color-bg-tertiary);
    transition: 0.15s;
    border-radius: 1.5rem
    }
astro-island, astro-slot, astro-static-slot {
    display: contents
    }</style></body></html>