Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[redwood backport] allow symlinks to be used in place of static asset artifacts #34970

Conversation

kdmccormick
Copy link
Member

Description

Backports #34894 to Redwood.

Testing

I will verify the LMS/Studio frontend functionality with this branch using the linked sandbox (UN: openedx, PW: openedx)

Merge considerations / rationale

This is low/no risk and fully backwards-compatible.

With this PR: This PR makes possible an experimental significant optimization to Tutor Dev setup time. That optimization will not be ready for Tutor v18.0.0 (the initial Redwood release), but it will hopefully be ready for Tutor v18.1.0. Backporting this PR to Redwood makes that possible.

Without this PR: the Tutor Dev optimization mentioned above could be made available on Tutor Nightly, but it would not be feasible for standard Tutor until Sumac (v19.0.0).

The git-ignored target directory for LMS Sass compilation is:
    lms/static/css

Unfortunately, that directory contains git-controlled directory of
vendored-in static assets:
    lms/static/css/vendor

This is a problem for a couple reasons:

1. In Tutor, we would like to make lms/static/css a symlink to an
   external location for the sake of build efficiency. This is
   impossible to do without clobbering lms/static/css/vendor and
   dirtying the git state.

2. More generally, when optimizing (or just understanding) a build
   system, it adds complexity when git-controlled source directories are
   mixed up inside git-ignored target directories.

The solution is to simply merge these vendored-in assets to another
existing git-controlled vendor directory:
    common/static/css/vendor

LMS already reads assets from this folder, so no further changes need to
be made. common/static/css is fully git-controlled, so we avoid the
complexity described above.

Backport of: 97a9f08
Remove the trailing slashes from the .gitignore entries for static asset
build artifacts. With these slashes, only directory contents are
ignored. Without these slashes, the artifact is ignored whether it is a
directory *or* an actual file (particularly, in our case: a symlink).

This allows us to build edx-platform static assets into a separate
directory, and then symlink to them from edx-platform.

Also: We remove the duplicate cms/static/css/ gitignore entry.

Backport of: 1f41529
@kdmccormick kdmccormick added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Jun 11, 2024
@kdmccormick kdmccormick requested a review from feanil June 11, 2024 13:58
@kdmccormick
Copy link
Member Author

@feanil Since you reviewed the original PR, can you give this backport a preliminary thumbs-up too?

I'll still get Max's final approval before merging.

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@kdmccormick kdmccormick requested a review from cmltaWt0 June 17, 2024 14:49
@kdmccormick kdmccormick marked this pull request as ready for review June 17, 2024 14:50
Copy link
Contributor

@cmltaWt0 cmltaWt0 left a comment

Choose a reason for hiding this comment

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

I've builded the openedx image and re-deployed a Tutor installation with the changes.
Did some quick smoke testing - no issue found.

@kdmccormick kdmccormick merged commit 6ab0b7a into openedx:open-release/redwood.master Jun 17, 2024
78 checks passed
@kdmccormick kdmccormick deleted the kdmccormick/backport-assets-split branch June 17, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-sandbox open-craft-grove should create a sandbox environment from this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants