Build and Review a Feature
Turn an issue into a testable change
Alice starts from the agreed main tip, creates feature/G-1 and changes garden.py and test_garden.py. The new test for shade must fail on the original implementation; then the corrected application must pass all three tests. Use Python 3 and unittest. A passing test that never fails on the broken version may not test the intended behavior.
Make the feature reviewable
Inspect the working and staged diffs, then commit a focused change with its test and push the feature to the fixture origin. Bob fetches and inspects the candidate relative to the merge base. A review should evaluate the acceptance criteria, scope, tests, and dependency changes, not only whether the patch looks tidy. The local fixture uses independent contributor names and a synthetic review record; it does not create an actual pull request.
git fetch origingit diff main...origin/feature/G-1git log --oneline main..origin/feature/G-1Bind evidence to the candidate
Bob tests the exact fetched commit in a detached checkout, then returns to main. The review record must identify the author, independent reviewer, candidate object ID, successful tests and completed dependency review. Reject an approval attached to a different candidate, a failed test or self-approval. A real GitHub workflow may test a merge candidate instead of the head commit; verify the intended revision and effective policy.
Integrate and verify
For this lab only, after the simulated review passes, Bob merges with --no-ff on main, retests the integrated result and pushes normally to the local bare remote. Check both merge parents, remote main and clean status. A real protected branch may require hosted PR integration instead. Predict what happens if main changes after review: review and test the resulting integration again, rather than relying on stale evidence.
git log --graph --oneline --allgit rev-list --parents -n 1 HEADgit status --shortCheck Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Build and Review a Feature — knowledge check
Apply evidence-based professional repository maintainership.
Why run the new test before the implementation?
Review for commit A exists but candidate is B. What next?
What does the merge-base comparison show?
After integrating a passing feature, what next?
What does the local bare remote prove about GitHub rules?