Skip to content

Conversation

@inducer
Copy link
Owner

@inducer inducer commented Feb 10, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 10, 2026 19:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates course/static page chunk rendering so that markup expansion/rendering happens against the currently selected course commit (including preview commits), rather than always using the active course commit.

Changes:

  • Pass pctx.course_commit_sha into get_processed_page_chunks() from course and static page views.
  • Extend get_processed_page_chunks() to accept a commit_sha and use it when calling markup_to_html().
  • Adjust the preview-commit-missing error message and update the basedpyright baseline accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
course/views.py Ensures the selected course commit SHA (active or preview) is used when producing rendered chunk HTML.
course/content.py Threads commit SHA into chunk rendering via markup_to_html() and modifies the preview-commit error message.
.basedpyright/baseline.json Removes now-unneeded pyright baseline entries after the signature/type changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1749 to 1752
(cws.chunk, mark_safe(
markup_to_html(course, get_course_repo(course),
course.active_git_commit_sha.encode(),
commit_sha,
cws.chunk.content)))
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

get_processed_page_chunks opens a new git repo via get_course_repo(course) inside the list comprehension, which means a repo instance is created (and never explicitly closed) once per chunk. This is inefficient and can leak file handles; consider opening the repo once (e.g., with get_course_repo(course) as repo:) and reusing it for all chunks, or accepting an already-open repo (like pctx.repo) as a parameter.

Copilot uses AI. Check for mistakes.
@inducer inducer enabled auto-merge (rebase) February 10, 2026 20:01
@inducer inducer merged commit 693ca58 into main Feb 10, 2026
18 checks passed
@inducer inducer deleted the chunk-preview branch February 10, 2026 20:11
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.

1 participant