Skip to content

feat(guide): validate lesson collections [Codex] - #1346

Merged
jderochervlk merged 2 commits into
masterfrom
test/guide-lesson-validation
Sep 14, 2026
Merged

feat(guide): validate lesson collections [Codex]#1346
jderochervlk merged 2 commits into
masterfrom
test/guide-lesson-validation

Conversation

@jderochervlk

Copy link
Copy Markdown
Collaborator

Guide lessons were loaded without collection-wide uniqueness checks, so duplicate identifiers or positions could create ambiguous navigation and persisted progress keys.

This extracts frontmatter parsing into GuideLessonFrontmatter, preserves build-time failure at the loader boundary, and rejects duplicate lesson IDs, exercise IDs, and positions with both source paths in the diagnostic. Focused coverage exercises complete and invalid frontmatter plus valid and invalid lesson collections.

Validate guide lesson IDs, exercise IDs, and positions during content loading. Extract parsing into a testable frontmatter boundary with focused coverage for valid and invalid lesson collections.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-13T21:24:21.771581Z 4a849b4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 13, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
guide 4a849b4 Commit Preview URL

Branch Preview URL
Sep 13 2026, 09:20 PM

Comment thread apps/guide/app/GuideLessonContent.res Outdated
exercise: exerciseFromFrontmatter(~dict=exerciseDict, ~sourcePath),
switch GuideLessonFrontmatter.parse(~raw, ~sourcePath) {
| Ok(lesson) => lesson
| Error(message) => throw(GuideLessonFrontmatter.InvalidFrontmatter(message))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If GuideLessonFrontmatter.parse already wraps stuff in a try/catch and returns a nice result, why do we need to throw here again?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed!

Keep frontmatter parsing failures as result values until the route loader exception boundary.
@github-actions

Copy link
Copy Markdown
Contributor

Guide Cloudflare deployment

⛅️ wrangler 4.114.0
────────────────────
🌀 Building list of assets...
✨ Read 16 files from the assets directory /home/runner/work/rescript-lang.org/rescript-lang.org/apps/guide/out
🌀 Starting asset upload...
No updated asset files to upload. Proceeding with deployment...
Total Upload: 0.31 KiB / gzip: 0.22 KiB
Worker Startup Time: 0 ms
Uploaded guide (2.51 sec)
Worker Version ID: fe03de29-1149-463d-9f87-d7b6ef7630aa
Version Preview URL: https://fe03de29-guide.rescript.workers.dev
Version Preview Alias URL: https://test-guide-lesson-validation-guide.rescript.workers.dev

To deploy this version to production traffic use the command wrangler versions deploy

Changes to non-versioned settings (config properties 'logpush' or 'tail_consumers') take effect after your next deployment using the command wrangler versions deploy

Changes to triggers (routes, custom domains, cron schedules, etc) must be applied with the command wrangler triggers deploy

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare deployment

Deployement ID: be98c1c4-1f2d-43ef-9594-81d201bfb382
Deployment Environment: preview

⛅️ wrangler 4.114.0
────────────────────
✨ Compiled Worker successfully
Uploading... (8768/8770)
Uploading... (8769/8770)
Uploading... (8770/8770)
✨ Success! Uploaded 2 files (8768 already uploaded) (1.13 sec)

✨ Uploading _redirects
✨ Uploading Functions bundle
🌎 Deploying...
✨ Deployment complete! Take a peek over at https://be98c1c4.rescript-lang.pages.dev
✨ Deployment alias URL: https://test-guide-lesson-validation.rescript-lang.pages.dev

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a849b45a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/guide/app/GuideHomeRoute.res
@jderochervlk
jderochervlk merged commit 3baffe5 into master Sep 14, 2026
9 checks passed
@jderochervlk
jderochervlk deleted the test/guide-lesson-validation branch September 14, 2026 11:34
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