Skip to content

Ab/refactor youtube job - #3739

Open
abeglova wants to merge 5 commits into
mainfrom
ab/refactor-youtube-job
Open

Ab/refactor youtube job#3739
abeglova wants to merge 5 commits into
mainfrom
ab/refactor-youtube-job

Conversation

@abeglova

@abeglova abeglova commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

Description (What does it do?)

Screenshots (if appropriate):

  • Desktop screenshots
  • Mobile width screenshots

How can this be tested?

Additional Context

Copilot AI balanced review requested due to automatic review settings August 7, 2026 15:58
@github-actions

github-actions Bot commented Aug 7, 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).

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

Refactors YouTube ETL into asynchronous channel and playlist tasks to reduce per-worker workload and improve recovery.

Changes:

  • Splits YouTube extraction and loading by channel and playlist.
  • Adds removal/orphan unpublishing helpers.
  • Updates task tests and management-command messaging.

Reviewed changes

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

Show a summary per file
File Description
learning_resources/tasks.py Adds asynchronous YouTube task fan-out.
learning_resources/tasks_test.py Tests new task orchestration.
learning_resources/management/commands/backpopulate_youtube_data.py Reports queued channels.
learning_resources/etl/youtube.py Splits channel and playlist extraction/transformation.
learning_resources/etl/youtube_test.py Updates extraction tests.
learning_resources/etl/pipelines.py Removes the synchronous YouTube pipeline.
learning_resources/etl/loaders.py Adds granular loading and unpublishing helpers.
learning_resources/etl/loaders_test.py Tests new unpublishing behavior.

Comment on lines +89 to +90
# get_youtube_data is absent on purpose: it only queues the fan-out, whose
# writes land long after it returns, so it has nothing to invalidate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this is ok - before the refactor clear_views_cache ran before the search updates finished anyway. And the cache is renewed by itself eventually

Comment thread learning_resources/etl/loaders_test.py
Comment on lines +535 to +539
video_channel = loaders.upsert_video_channel(
youtube.transform_channel(channel_data)
)
loaders.unpublish_removed_playlists(
video_channel, [playlist_data["id"] for playlist_data, _ in playlists]

@abeglova abeglova Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's true but fixing it would complicate the code more than it's worth. I think this situation is pretty unlikely to happen and even if it did it would be fixed in the next run

@abeglova
abeglova marked this pull request as draft August 7, 2026 16:30
@abeglova
abeglova marked this pull request as ready for review August 7, 2026 16:31
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