Skip to content

Example: broken lesson submission (teaching demo for students)#26

Open
jchen0506 wants to merge 2 commits into
mainfrom
examples/broken-lessons-demo
Open

Example: broken lesson submission (teaching demo for students)#26
jchen0506 wants to merge 2 commits into
mainfrom
examples/broken-lessons-demo

Conversation

@jchen0506

Copy link
Copy Markdown
Contributor

Purpose

A deliberately broken lesson (lessons/example-broken-lesson.yml) kept as a teaching example so students can see how the portal's CI check reacts to a bad submission. Not meant to be merged.

What's wrong with it (on purpose)

The file plants several common mistakes. The CI reports one error per run (fail-fast), so students fix one line, push, and watch the next surface — an iterative, realistic workflow:

# Mistake Correct form
A description missing add the required field
B authors is a string YAML list (- "Name")
C platforms is a string YAML list (this one would otherwise crash the whole build)
D tags is a string YAML list
E material has no github_url/colab_url add at least one URL
F recommended_platform: "Google Colab, ChemCompute" exactly one name matching platforms

Compare against template.yaml for the correct reference.

Expected result

The PR Lesson Check should fail and post a ❌ comment naming the first error (the missing description).

Single lesson YAML with several intentional errors (missing required field,
list-as-string for authors/platforms/tags, material with no URL, multi-value
recommended_platform) to demonstrate how CI validation responds to a bad
submission. Surfaced one at a time (fail-fast) as students fix and re-push.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

ACT-CMS Lesson Portal — PR check

Checks failed. Please fix the items below and push an update to this branch — the check re-runs automatically.

Errors (must fix)

Error: example-broken-lesson.yml is missing required field: 'description'
Error: example-broken-lesson.yml field 'authors' must be a non-empty list (got str). Use YAML '- ' list items, not a single string.
Error: example-broken-lesson.yml field 'platforms' must be a non-empty list (got str). Use YAML '- ' list items, not a single string.
Error: example-broken-lesson.yml field 'tags' must be a list of strings (got str). Use YAML '- ' list items, not a single string.
Error: example-broken-lesson.yml material 1 must have either github_url or colab_url
Error: Some lesson files have validation errors

See template.yaml for the full field reference. Common pitfalls: fields like platforms, authors, and scientific_objectives must be YAML lists (- item), and recommended_platform must be exactly one name that matches an entry in platforms.

validate_lesson_data now collects every problem in a lesson and prints each as
its own Error: line instead of returning on the first one, so the PR-check
comment lists them together. Later checks are guarded against missing/malformed
fields; recommended_platform and platform-partial checks are skipped when
platforms isn't a valid list to avoid cascading errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dsirianni

Copy link
Copy Markdown
Contributor

OH NO I"VE DONE SOMEHTNG WRONG I"M SO TIRED I CAN"T EVEN SPELL CORRECTLY> @jchen0506 PLEASE FIX THIS FOR TME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants