Skip to content

Sitemap fix 2 of 2: Page the podcast and video sitemaps off the summary endpoint - #3759

Open
ChristopherChudzicki wants to merge 1 commit into
mainfrom
cc/sitemaps-use-summary-endpoint
Open

Sitemap fix 2 of 2: Page the podcast and video sitemaps off the summary endpoint#3759
ChristopherChudzicki wants to merge 1 commit into
mainfrom
cc/sitemaps-use-summary-endpoint

Conversation

@ChristopherChudzicki

@ChristopherChudzicki ChristopherChudzicki commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Note

Do not merge until #3758 has been released

What are the relevant tickets?

Description (What does it do?)

Switches the podcast episode and video sitemaps to use the api/v1/learning_resoruces/summary endpoint.

How can this be tested?

Prerequisite: Podcasts and videos backpopulated locally (at least podcastes).

  1. View https://learn.mit.dev/sitemaps/sitemap-index.xml to find some podcast / video sitemaps
  2. verify that they have 1000 rows each (except for the last index number in each group)

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

OpenAPI Changes

No changes detected

View full changelog

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

@ChristopherChudzicki
ChristopherChudzicki marked this pull request as ready for review August 11, 2026 23:42
@ChristopherChudzicki ChristopherChudzicki changed the title Page the podcast and video sitemaps off the summary endpoint Sitemap fix 2 of 2: Page the podcast and video sitemaps off the summary endpoint Aug 11, 2026

@ahtesham-quraish ahtesham-quraish left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Question/Suggestion

frontends/main/src/app/sitemaps/podcast/sitemap.ts line 71: Confirm the podcast episode sitemap intentionally emits one URL per parent podcast (fan-out), whereas the video sitemap emits only the first parent. If both should be canonical-single, why this asymmetry we have?; if intended, a short comment mirroring the video file's rationale would help future readers.

@ChristopherChudzicki
ChristopherChudzicki force-pushed the cc/sitemaps-use-summary-endpoint branch from 3c79bb5 to abd9cdc Compare August 13, 2026 11:27
Copilot AI balanced review requested due to automatic review settings August 13, 2026 11:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Switches podcast and video sitemap page generation to the lightweight learning-resource summary endpoint.

Changes:

  • Uses summary records and canonical parent IDs for sitemap URLs.
  • Updates sitemap tests and summary factories accordingly.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontends/main/src/app/sitemaps/video/sitemap.ts Uses summary data for video sitemap pages.
frontends/main/src/app/sitemaps/video/sitemap.test.ts Tests summary-based video URLs.
frontends/main/src/app/sitemaps/podcast/sitemap.ts Uses summary data for podcast sitemap pages.
frontends/main/src/app/sitemaps/podcast/sitemap.test.ts Tests summary-based podcast URLs.
frontends/api/src/test-utils/factories/learningResources.ts Allows summary resource types to be overridden.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Base automatically changed from cc/summary-endpoint-parent-ids to main August 13, 2026 14:07
Both sitemaps request limit=1000 from /api/v1/learning_resources/, which caps
at 100 while their offset keeps advancing by 1000 -- so each shard returns its
first 100 resources and the other 900 are never emitted. The podcast sitemap
publishes 300 of 2133 URLs, the video sitemap 800 of 7109
(mitodl/mit-learn#3756).

/summary/ allows limit=1000, and now carries resource_type and
canonical_parent_ids, so it can serve these two the way it already serves the
resources and products sitemaps. Switching endpoints is the fix -- PAGE_SIZE
becomes a limit the API honors rather than one it silently clamps.

canonical_parent_ids replaces the parentPodcastIds/videoPlaylistIds helpers,
which read nested fields the summary serializer doesn't carry. It reports the
same ids in the same order, so the emitted URLs are unchanged: one per parent
podcast for an episode, and for a video the first playlist, matching the
canonical tag and the bare-URL redirect on the video page. The helpers stay for
the page components that still read detail responses.

The summary factory is no longer a LearningResourceFactory, whose overrides
omit resource_type. That's right for the fixed-type factories, but a summary
carries every resource type and these tests have to pin it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ChristopherChudzicki
ChristopherChudzicki force-pushed the cc/sitemaps-use-summary-endpoint branch from abd9cdc to 96fb40d Compare August 13, 2026 14:07
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.

3 participants