Skip to content

Feature PR | Extract Video Block from edx-platform#168

Open
farhan wants to merge 5 commits intomainfrom
farhan/video-block
Open

Feature PR | Extract Video Block from edx-platform#168
farhan wants to merge 5 commits intomainfrom
farhan/video-block

Conversation

@farhan
Copy link
Contributor

@farhan farhan commented Feb 24, 2026

Extract Video Block from edx-platform

Relevant test cases PR on edx-platform:

Following PR's have been merged in this PR:

#141
#142
#167
#143

Other relevant PR's:
#144 [test_video, need code review]
#103 [Karma test cases, need reconfiguring]

from django.conf import settings


def get_resource_url(xblock, path, package_scope=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally every xblock should be as independent and we should define this under the xblock's own class.

Copy link
Contributor Author

@farhan farhan Feb 25, 2026

Choose a reason for hiding this comment

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

It's to follow DRY.
If there are some core/complex utils that will follow the layered architecture we should keep them separate in 1 hierarchy above. Like we already did here
XBlock will stay independent, you can consider it like we are adding some thirdpary pypi package.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with applying DRY for stable and reusable abstractions. However, not all XBlocks currently use the bundled JS approach. I believe 3 out of 8 xblocks are using, so extracting a shared loader at a higher hierarchy might introduce unnecessary coupling
I think this util has most of the functionality related to xmlMixin which we intend to improve in future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will work as well.

@kdmccormick could you please take a look at this method? Do you think we’re moving any XBlock-related utility methods into xblock/utils that are tightly coupled with the openedx-platform runtime? or what could be the best approach?
Note: I don't know the amount of such methods

@@ -0,0 +1,1257 @@
/* CSS for VideoBlock */
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you figure out why this file change is showing as we have already merged lift and shift video code and this css file has merged.
Ref : https://github.com/openedx/xblocks-contrib/pull/142/changes#diff-4e6584fac3887788f6f20e53793f005629eb437d2395a3a5a7c182f7fcb8f9d1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR has been merged into this feature branch PR, so it's normal

@@ -0,0 +1,1257 @@
/* CSS for VideoBlock */
Copy link
Contributor

Choose a reason for hiding this comment

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

This file and all other js files has already reviewed and merge in this PR
Why this is showing again in this feature branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR you shared merging the changes into this feature branch and now we will keep all the changes altogether to main.

  • It will maintain PR's history
  • It will give us green test checks on the PR while merging into main

@farhan farhan force-pushed the farhan/video-block branch from f2009b9 to 6938d26 Compare February 25, 2026 06:17
@farhan farhan requested a review from kdmccormick February 26, 2026 05:30
@farhan farhan force-pushed the farhan/video-block branch from 20f6838 to d49b34f Compare March 2, 2026 06:36
farhan added 4 commits March 2, 2026 11:43
This commit contains original code copied from edx-platform.
Purpose of keeping the first commit with original code is to get help in the review process.
Reviewer can easily view the next commit to view the changes done in xblocks-contrib while
shifting code from the edx-platform
* fix: fix quality check for video block code
* chore: update package.lock.json
@farhan farhan force-pushed the farhan/video-block branch from d49b34f to 7eae34b Compare March 2, 2026 06:48
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