Repository navigation
Add GitHub, CI and Deploy chapters - #5
Merged
Merged
Conversation
All three play on the laptop in a ~/shop repo, using a small simulated git (branch, add, commit, diff, log, push, revert), a GitHub CLI (pr create/view/checks, run view), bin/rails test and a deploy tool (status, releases, logs, rollback). CI runs the tests on the pushed commit in a clean environment two ticks after a push. - GitHub: branch, add a banner, commit, push, open a PR, CI passes. - CI: tests pass locally thanks to a .env file but fail in CI. - Deploy: a config change breaks checkout while /health stays green; roll back, verify, then revert the commit on main. Each chapter ends with a short note on the real practice or incident it is based on, with a link.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three new chapters that play on your laptop in a
~/shoprepo. With these, all five chapters are playable.gh pr create, and wait for CI to pass.envsetsFREE_SHIPPING_FROMbut CI doesn't have it. Give it a default in code (or set it in the workflow), push, and get green/checkoutwith 500s while/healthstays 200. Read the releases and logs, rundeploy rollback r42, confirm checkout works, thengit revertthe bad commit and pushEach chapter ends with a short "This happened for real" note and a source link.
Engine
lib/sim/repo.rb: a small git built on snapshot commits. It has branches, a staging area,.gitignore, a line diff, push to a remote, revert, and pull requests with CI runs.lib/sim/delivery_commands.rb, mixed into the shell:git: status, branch, switch/checkout, add, commit (-m,-am), log, diff, push, revert and restore.gh: pr create/list/view/checks and run view--log-failed.bin/rails test.deploy: status, releases, logs and rollback.lib/sim/delivery_ci.rb: a run finishes two ticks after a push. It runs the tests on the pushed commit using only the workflow's env vars, the way a clean runner would.lshides dotfiles unless you pass-a.curl -X POSTworks.sedturns\nin the replacement into a newline.errorsmetric drives the Deploy chapter's gauge.Frontend
Checks
bin/rails test: 41 runs, 0 failures. These include full play-throughs of all three new chapters and guard-rail tests: no PR from main, nothing to commit, a missing commit message, and opening a PR before pushing.bin/rubocop: clean.bin/brakeman: 0 warnings.npm run lint: clean.npm run build: passes.