Skip to content

Demonstrate keeping your codebase releasable with GitHub Actions

License

Notifications You must be signed in to change notification settings

bobcatfish/better-bug-trap

Repository files navigation

Building a better bug trap with GitHub Actions

Manning Twitch stream Jan 12, 2022

Learn how to automate one of the two pieces of Continuous Delivery: always keeping your codebase in a releasable state. We’ll use GitHub actions to explore the lifecycle of a change, discover all the places where bugs can squirm their way in, and learn the best times to run your pipelines for the most effective bug-catching!

Overall goal: Always be in a releasable state (one of the 2 pieces of CD)

Go from a repo with no automation to a repo with:

  • PR based automation
  • Post-merge PR based automation
  • Periodic automation

Setup automation to:

  • Run unit tests

Demonstrate why you need:

  • PR based automation - show getting the repo into a broken state
  • Post-merge based - show example of conflicting changes making main broken
  • Periodic automation - can highlight conflicting changes and catch flakes

What's still missing? (could explore if time)

  • Demonstrating flakes being caught
  • Build image & run system test
  • Release automation (e.g. tag based)
  • Linting

Outline

  1. Repo with a service that gets rates, includes dockerfile
  2. Show a PR that breaks the repo (1_bad_pr)
  3. Add github action to run tests (2_add_pr_tests)
  4. Show how this fixes the original PR problem
  5. Show 2 conflicting PRs and how a bug isn’t caught (3_bad_pr_1, 3_bad_pr_2)
  6. Add periodic action to highlight issue (4_periodic)
  7. Undo conflicting PRs
  8. Open PRs again
  9. Show requiring branch to be up to date (docs)
  10. Explain downsides (many PRs = many updates)
  11. Undo requiring branch to be up to date
  12. Show post merge action (5_post_merge)
  13. Describe merge queues / merge trains (GitHub merge queue docs)

Building and running the image

docker build --tag coin-rates .
docker run -p 80:5000 coin-rates

Accessing in browser:

About

Demonstrate keeping your codebase releasable with GitHub Actions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published