edx-platform icon indicating copy to clipboard operation
edx-platform copied to clipboard

[DEPR]: Asset processing in Paver

Open kdmccormick opened this issue 2 years ago • 9 comments

ℹ️ This DEPR is a prerequisite to the general Paver DEPR.

Proposed

10 March 2023

Accepted

3 May 2023

First Open edX Named Release Without This Functionality

Sumac.

Details:

Release Old (paver *_assets ...) New (npm run build, etc)
Palm Supported Available
Quince Supported Available
Redwood Deprecated Supported
Sumac Removed Supported

(Latest timeline update)

Rationale

See Reimplement static asset processing: Context: Current Pain Points

Removal

We are replacing edx-platform's current CLI for building, collecting & watching assets, which is built on an old Python library, paver.

The affected commands are:

  • edx-platform: paver update_assets
  • edx-platform: paver watch_assets
  • edx-platform: paver compile_sass
  • edx-platform: paver process_xmodule_assets
  • tutor: tutor ... [run|exec] [lms|cms] openedx-assets ...

and the affected LMS & CMS Django settings are:

  • JS_ENV_EXTRA_CONFIG
  • WEBPACK_CONFIG_PATH

Cleanup steps

  • [ ] Search the codebase & docs, and update and dangling references to:
    • pavelib/assets.py
    • pavelib.assets
    • paver update_assets
    • paver watch_assets
    • paver webpack
    • paver process_xmodule_assets
    • paver compile_sass
  • [ ] Remove pavelib/assets.py and all associated unit tests
  • [ ] Remove asset-related requirements from requirements/edx/paver.in:
    • libsass (note: this should have been added to a separate asset.in file, for use by scripts/build-assets.sh)
    • watchdog
  • [ ] ...anything else?

Replacement

The new CLI for building, collecting and watching assets will use npm scripts and django management commands.

Deprecation

The paver commands will raise warnings before the Redwood release.

Migration

Additional Info

The eventual goal is to remove not just Paver, but all Python from the asset build process. The work to remove Python will continue once this DEPR is complete:

  • https://github.com/openedx/edx-platform/issues/31800

kdmccormick avatar Mar 08 '23 15:03 kdmccormick

Announcement: https://discuss.openedx.org/t/deprecation-removal-edx-platform-asset-processing-in-paver/9552

kdmccormick avatar Mar 10 '23 15:03 kdmccormick

The new implementation won't be landing in Palm, most likely. I pushed the acceptance date out to May 3rd, and pushed the final removal out to Redwood.

kdmccormick avatar Apr 12 '23 19:04 kdmccormick

This deprecation has been Accepted. Development of the replacement asset script is ongoing (see issues linked in description). When the replacement is ready, I'll put a warning in the output of the old asset processing script and move this issue to Deprecated.

kdmccormick avatar May 30 '23 14:05 kdmccormick

The new asset processing suite has been merged as "experimental". I will continue to test it, and will communicate when it's time to mark the Paver assets suite as deprecated and encourage folks to switch to the new suite.

kdmccormick avatar Aug 18 '23 16:08 kdmccormick

I am hoping to mark the old asset build as deprecated in Quince so we can remove it in Redwood, although the content libraries V2 project is competing for my time. Here's my WIP PR: https://github.com/kdmccormick/tutor/pull/37

kdmccormick avatar Oct 17 '23 17:10 kdmccormick

@feanil As I alluded to earlier, carrying out this DEPR will allow us to circumvent libsass-python's Python API (which isn't compatible with Python>3.9) and instead go straight to the underlying libsass C API. I'll take this on.

kdmccormick avatar Feb 28 '24 20:02 kdmccormick

This has renewed urgency, since the Python 3.8->3.12 upgrade is blocked by libsass-python. This must be resolved well ahead of the Redwood cutoff (late April).

Here is my updated plan:

  • Before the Redwood cutoff, to unblock the Python upgrade:
  • Before the Sumac cutoff:
    • I will remove all of pavelib/assets.py. This is the breaking change. Users of the paver assets CLI, such as the openedx/configuration and openedx-unsupported/devstack, will need to update to the new npm CLI.

I've updated the ticket description with the latest dates and migration steps.

FYI @feanil , @awais786 , @robrap , @regisb

kdmccormick avatar Mar 20 '24 20:03 kdmccormick

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.94%. Comparing base (ac9f2d5) to head (22fb824). Report is 49 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #10320       +/-   ##
===========================================
+ Coverage   48.75%   90.94%   +42.18%     
===========================================
  Files          32        8       -24     
  Lines        3095      497     -2598     
===========================================
- Hits         1509      452     -1057     
+ Misses       1586       45     -1541     
Flag Coverage Δ
autograder ?
migrator ?
python_submitty_utils ?
submitty_daemon_jobs 90.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

robrap avatar Mar 20 '24 20:03 robrap

UPDATE: This PR switches the old paver static asset build commands to be simple wrappers around npm run commands, with instructive deprecation warnings:

  • https://github.com/openedx/edx-platform/pull/34318.

This prepares us to drop the paver asset build commands after Redwood. After this PR merges, I will move the ticket status to Deprecated.

kdmccormick avatar Mar 26 '24 22:03 kdmccormick

I am rolling this DEPR into a larger proposed deprecation of all edx-platform Paver usage: https://github.com/openedx/edx-platform/issues/34467

kdmccormick avatar Apr 30 '24 22:04 kdmccormick