From 934c43e7b1e0a3b59b3b64d66c69a63dce7a8ebe Mon Sep 17 00:00:00 2001 From: thejesh23 <35212698+thejesh23@users.noreply.github.com> Date: Thu, 26 Nov 2026 14:25:29 -0800 Subject: [PATCH 1/5] Lesson 15 video and CONTRIBUTING: a maintainer merges, not the bot The graduate bot only checks and comments. The video said it merges, and CONTRIBUTING said bots merge learner PRs. A test now guards the wording. Co-Authored-By: Claude Fable 5.2 --- CONTRIBUTING.md | 3 ++- lessons/15-capstone/script.md | 4 ++-- tests/test_workflows.py | 11 +++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4f0a314..41452f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,8 @@ Thanks for helping! There are two kinds of contribution here. - **Lesson 05:** add `practice/greetings/YOUR_NAME.py` and its test. See [the lesson](lessons/05-second-pr-from-terminal/). -Bots check and merge these PRs. Change only your own files. +Bots check these PRs, and a maintainer reviews and merges them. Change only +your own files. ## 2. Improving the course diff --git a/lessons/15-capstone/script.md b/lessons/15-capstone/script.md index 0ef6e12..002261d 100644 --- a/lessons/15-capstone/script.md +++ b/lessons/15-capstone/script.md @@ -136,8 +136,8 @@ bullets: > That it was merged by someone else. > And that it is in a real project you don't own. If everything checks out, -> it comments, merges, and you appear on the graduates wall. If not, its -> comment says exactly what's wrong. +> the bot says so. A maintainer merges it, and you appear on the graduates +> wall. If not, its comment says exactly what's wrong. ## Scene 8: Welcome visual: slide diff --git a/tests/test_workflows.py b/tests/test_workflows.py index ff6c44a..d738de0 100644 --- a/tests/test_workflows.py +++ b/tests/test_workflows.py @@ -16,6 +16,17 @@ def test_bots_only_check_and_comment(): assert "gh pr comment" in text +def test_no_lesson_says_a_bot_merges(): + """The lessons and videos must say what the bots do: check and comment.""" + root = WORKFLOWS.parent.parent + pages = [*root.glob("*.md"), *root.glob("lessons/*/*.md"), *root.glob("publishing/**/*.md")] + pages += [*root.glob("first-commits/README.md"), *root.glob("practice/README.md")] + claim = re.compile(r"bots? (?:check(?:s)? and )?merges?\b|it comments,? (?:and )?merges", re.IGNORECASE) + for page in pages: + text = " ".join(page.read_text(encoding="utf-8").replace(">", " ").split()) + assert not claim.search(text), f"{page.relative_to(root)} says a bot merges; a maintainer does" + + def test_every_action_is_pinned_to_a_commit(): for path in WORKFLOWS.glob("*.yml"): for ref in re.findall(r"uses: \S+@(\S+)", path.read_text(encoding="utf-8")): From 81e62953d64aef093f299cf67a3668c77fd2d4ca Mon Sep 17 00:00:00 2001 From: thejesh23 <35212698+thejesh23@users.noreply.github.com> Date: Thu, 26 Nov 2026 14:25:29 -0800 Subject: [PATCH 2/5] Lesson 05: say why a first check can wait for approval GitHub holds a newcomer's pull_request checks until a maintainer approves them, so a learner whose Lesson 02 PR isn't merged yet sees no checks. The README, exercise and video now say so. The pytest output shows today's 8 tests. Co-Authored-By: Claude Fable 5.2 --- lessons/05-second-pr-from-terminal/README.md | 22 +++++++++++++------ .../05-second-pr-from-terminal/exercise.md | 1 + lessons/05-second-pr-from-terminal/script.md | 17 +++++++++----- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/lessons/05-second-pr-from-terminal/README.md b/lessons/05-second-pr-from-terminal/README.md index 6eba17b..2b443a3 100644 --- a/lessons/05-second-pr-from-terminal/README.md +++ b/lessons/05-second-pr-from-terminal/README.md @@ -1,6 +1,6 @@ # Lesson 05: Your second PR, from the terminal -**Time:** 6 minute video · 30 minute exercise +**Time:** 7 minute video · 30 minute exercise **You'll need:** a green `tools/doctor.py` (Lesson 03) This time you'll contribute like you would to a real Python project: on a @@ -117,16 +117,17 @@ python -m pytest practice ``` ```text -practice/tests/test_ada_lovelace.py . [ 14%] -practice/tests/test_all_greetings.py ... [ 57%] -practice/tests/test_textkit.py . [ 71%] -practice/tests/test_thejesh23.py .. [100%] +practice/tests/test_ada_lovelace.py . [ 12%] +practice/tests/test_all_greetings.py ... [ 50%] +practice/tests/test_textkit.py . [ 62%] +practice/tests/test_thejesh23.py ... [100%] -============================== 7 passed in 0.01s =============================== +============================== 8 passed in 0.01s =============================== ``` Each `.` is a passing test. `test_all_greetings.py` is the course's own test: -it checks every learner's `greet` follows the rules, including yours. +it checks every learner's `greet` follows the rules, including yours. Your +list is longer and your number is higher: every learner adds a test file. ## Step 6: Format and lint @@ -190,6 +191,13 @@ One check runs on your PR: **Exercise 2 tests** (listed as `test`). It runs `ruff format --check`, `ruff check` and `pytest` on your code, exactly like Steps 5 and 6. +> **No checks yet?** GitHub doesn't run a newcomer's checks until a +> maintainer approves them. If your Lesson 02 pull request hasn't been +> merged yet, this check waits too: `gh pr checks` reports no checks, and +> the pull request page says a workflow is awaiting approval. You did +> nothing wrong. The check starts when a maintainer approves it, usually +> within a day. Run `gh pr checks --watch` again then. + When it finishes, a separate review bot checks your file names and that your code only contains what it should. It doesn't appear in the checks list: about a minute later it **comments** on your PR. If everything passed, a diff --git a/lessons/05-second-pr-from-terminal/exercise.md b/lessons/05-second-pr-from-terminal/exercise.md index fbed97e..2915c5a 100644 --- a/lessons/05-second-pr-from-terminal/exercise.md +++ b/lessons/05-second-pr-from-terminal/exercise.md @@ -9,6 +9,7 @@ - [ ] Commit only your two files, then `git push -u origin exercise-2` - [ ] `gh pr create --fill` (after `gh repo set-default thejesh23/first-python-contribution`) - [ ] `gh pr checks --watch` until the check is green, then wait for the bot's comment and the merge + (no checks yet? Your first run waits for a maintainer's approval until your Lesson 02 PR is merged) - [ ] Tidy up: `git switch main`, `git pull upstream main`, `git branch -d exercise-2` **Stretch 1:** add a second test, for example that `greet("")` still returns diff --git a/lessons/05-second-pr-from-terminal/script.md b/lessons/05-second-pr-from-terminal/script.md index 331fe08..c7f25c9 100644 --- a/lessons/05-second-pr-from-terminal/script.md +++ b/lessons/05-second-pr-from-terminal/script.md @@ -214,12 +214,12 @@ notes: code: ``` (.venv) $ python -m pytest practice -practice/tests/test_ada_lovelace.py . [ 14%] -practice/tests/test_all_greetings.py ... [ 57%] -practice/tests/test_textkit.py . [ 71%] -practice/tests/test_thejesh23.py .. [100%] +practice/tests/test_ada_lovelace.py . [ 12%] +practice/tests/test_all_greetings.py ... [ 50%] +practice/tests/test_textkit.py . [ 62%] +practice/tests/test_thejesh23.py ... [100%] -============================== 7 passed in 0.01s =============================== +============================== 8 passed in 0.01s =============================== ``` > Run the same command again. @@ -328,10 +328,11 @@ code: ## Scene 15: Watch CI visual: terminal -focus: 1 | 2 | 3 +focus: 1 | 2 | 2 | 3 notes: - Watch the check run, live - The check runs `ruff format --check`, `ruff check` and `pytest` +- No checks yet? A maintainer approves a newcomer's first run. Just wait. - Then the review bot comments, and a maintainer merges code: ``` @@ -346,6 +347,10 @@ code: > One check runs. It is called test. It runs ruff format, ruff check and > {pytest|pie test} on your code. The same three commands you just ran. +> If it says no checks, don't worry. Until your first pull request is +> merged, GitHub waits for a maintainer to approve the run. Try again +> later. + > After it passes, a review bot looks at your file names and your code. About > a minute later, it leaves a comment. If everything passed, a maintainer > reviews and merges your pull request. Read the comment with {gh pr view --comments|g h, p r, view, From 1ee8416b1fce87045bc819dd3475c104b09bbc04 Mon Sep 17 00:00:00 2001 From: thejesh23 <35212698+thejesh23@users.noreply.github.com> Date: Thu, 26 Nov 2026 14:25:29 -0800 Subject: [PATCH 3/5] Lesson 10: show the real output of the four commands Co-Authored-By: Claude Fable 5.2 --- lessons/10-making-the-change/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lessons/10-making-the-change/README.md b/lessons/10-making-the-change/README.md index e18c178..d5b1b41 100644 --- a/lessons/10-making-the-change/README.md +++ b/lessons/10-making-the-change/README.md @@ -116,11 +116,15 @@ ruff check practice ``` ```text -9 passed in 0.01s +5 passed in 0.01s +10 passed in 0.01s +9 files left unchanged +All checks passed! ``` Narrow first (fast), then the whole suite and the linters, exactly as CI -will. +will. Your second number is higher: every learner's merged Exercise 2 adds +tests. ## Step 5: A changelog entry From ce0b0c0802d0fb4e6a1243f0540446723691bbae Mon Sep 17 00:00:00 2001 From: thejesh23 <35212698+thejesh23@users.noreply.github.com> Date: Thu, 26 Nov 2026 14:25:29 -0800 Subject: [PATCH 4/5] Lesson 11: --body-file takes the description without the title line Co-Authored-By: Claude Fable 5.2 --- lessons/11-opening-the-pull-request/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lessons/11-opening-the-pull-request/README.md b/lessons/11-opening-the-pull-request/README.md index 5ebd850..1522eaf 100644 --- a/lessons/11-opening-the-pull-request/README.md +++ b/lessons/11-opening-the-pull-request/README.md @@ -83,11 +83,12 @@ ready, click **Ready for review**, or run `gh pr ready`. ## Opening it Write the description in a file, so you can read it over before anyone -else does: +else does. The title goes on the command line, so the file holds only the +description, without a title line: ```bash norun -gh pr create --title "Fix slugify for repeated spaces and punctuation" --body-file pr-description.md -gh pr create --draft --title "..." --body-file pr-description.md # not ready yet +gh pr create --title "Fix slugify for repeated spaces and punctuation" --body-file description.md +gh pr create --draft --title "..." --body-file description.md # not ready yet ``` Or in the browser: open your fork and click **Compare & pull request**, as From d95c213097b1b4a7b9353e6a87919263552c2299 Mon Sep 17 00:00:00 2001 From: thejesh23 <35212698+thejesh23@users.noreply.github.com> Date: Thu, 26 Nov 2026 14:25:29 -0800 Subject: [PATCH 5/5] Udemy: name the repository in the description, link it in lecture descriptions Udemy allows no external links on the landing page, so the description names the repository as text. Each lecture's description carries the direct link. Co-Authored-By: Claude Fable 5.2 --- publishing/udemy-landing.md | 2 +- tools/udemy_package.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/publishing/udemy-landing.md b/publishing/udemy-landing.md index b13be80..8a762dd 100644 --- a/publishing/udemy-landing.md +++ b/publishing/udemy-landing.md @@ -25,7 +25,7 @@ Then you go out into the real world. You learn the house rules every project has The course ends with a capstone: a merged pull request in a real project you choose. A bot verifies it on GitHub and adds you to the graduates wall. -Every lesson has a short video, a written lesson, a hands-on exercise and a quiz. All the materials, exercises and bots live in a free, open source GitHub repository, linked from every lecture. +Every lesson has a short video, a written lesson, a hands-on exercise and a quiz. All the materials, exercises and bots live in a free, open source GitHub repository: thejesh23/first-python-contribution. Every lecture links straight to its lesson there. How this course is made: the lessons and video scripts were drafted with AI and reviewed by the instructor, and the narration uses a text-to-speech voice. Every command shown in the course is tested. diff --git a/tools/udemy_package.py b/tools/udemy_package.py index e29f3ba..05102f9 100644 --- a/tools/udemy_package.py +++ b/tools/udemy_package.py @@ -234,7 +234,11 @@ def bullets(items): "## 3. Curriculum", "", "Create one section per heading below, then one lecture per row. Upload the video, add its", - "captions (English) and add the written lesson as an external resource link.", + "captions (English) and add the written lesson as an external resource link. Put the same", + 'link in the lecture\'s description too: "Written lesson, exercise and quiz: LINK".', + "", + "Udemy allows no links on the landing page itself (only in the instructor bio), so the", + "description names the repository without a link.", "", ] for n, section in enumerate(sections, start=1):