Skip to content

Conversation

@Ang-m4
Copy link
Contributor

@Ang-m4 Ang-m4 commented May 28, 2025

Description

This pull request introduces the initial implementation of the paragon build-tokens CLI command within the Tutor plugin ecosystem. It leverages a lightweight Docker container and Tutor's custom job framework to facilitate the building of Paragon design tokens.

Key Changes

Docker and Build Process

  • Dockerfile (paragon-builder): Added a Dockerfile for the Paragon Builder, which uses a Node.js Alpine base image to install the Paragon CLI and execute theme builds.
  • Entrypoint Script (entrypoint.sh): Added a script to handle argument parsing and the theme compilation, it integrates with tutor jobs execution framework.
  • Docker Compose Service: Added a paragon-builder-job service in local-docker-compose-jobs-services to run theme builds as Docker-based jobs.

Command Execution

  • Custom Tutor Command: Registered a custom do command (build_tokens) in plugin.py to enable the flexible theme building via the Tutor CLI. This command supports options for source-only builds, token references, specific themes, and verbose logging.

Usage Instructions

  1. Build the Docker Image:
    After installing and enabling the plugin, build the Docker image with the following command:

    tutor images build paragon-builder
  2. Run the Build Job:
    Execute the build job using:

    tutor local do paragon-build-tokens <options>

    Note: A comprehensive list of available options for the build-tokens command can be found in the README.rst file.

@openedx-webhooks
Copy link

Thanks for the pull request, @Ang-m4!

This repository is currently maintained by @arbrandes.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label May 28, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions May 28, 2025
@Ang-m4 Ang-m4 requested a review from brian-smith-tcril May 28, 2025 19:29
@Ang-m4
Copy link
Contributor Author

Ang-m4 commented May 28, 2025

@Alec4r It would be great if you could take a look at this!

Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

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

Overall this is looking good! I left a couple little comments but nothing major!

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Jun 3, 2025
@mphilbrick211 mphilbrick211 moved this from Ready for Review to In Eng Review in Contributions Jun 3, 2025
Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

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

LGTM!

Thank you for this!

@brian-smith-tcril brian-smith-tcril merged commit 380a6fc into openedx:main Jun 5, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from In Eng Review to Done in Contributions Jun 5, 2025
@Ang-m4 Ang-m4 deleted the afg/tutor-paragon-imp branch June 30, 2025 18:01
@Pauldic
Copy link

Pauldic commented Aug 3, 2025

How would I use this plugin to implement Admin Action Button:
I have a folder adminUser with 2 files init.py (from . import admin) and admin.py see content below:

`from django.contrib import admin
from django.contrib.auth.models import User

@admin.action(description="Mark selected Users as inactive")
def mark_users_inactive(modeladmin, request, queryset):
queryset.update(is_active=False)
modeladmin.message_user(request, f"{queryset.count()} users marked as inactive.")

admin.site.unregister(User)

@admin.register(User)
class CustomUserAdmin(admin.ModelAdmin):
list_display = ("username", "email", "first_name", "last_name", "is_staff", "is_active")
actions = [mark_users_inactive]`

I added the lines below to the plugin.py:

PLUGIN_ROOT = Path(__file__).parent.parent.resolve() hooks.Filters.COMPOSE_MOUNTS.add_item(("lms", (str(PLUGIN_ROOT / "adminAction"), "/openedx/edx-platform/adminAction"))) hooks.Filters.COMPOSE_MOUNTS.add_item(("cms", (str(PLUGIN_ROOT / "adminAction"), "/openedx/edx-platform/adminAction")))

Added patches/openedx-lms-env with INSTALLED_APPS += ["adminAction"]
Added recursive-include adminAction * in ./MANIFEST.in
In pyproject.toml
Added include = ["adminAction"] under [tool.hatch.build.targets.wheel]
Updated include = [ "/tutoradmin", "/adminAction", ".hatch_build.py"] under [tool.hatch.build.targets.sdist]

Yet the Action Button is not visible. Please what am I doing wrong?

@brian-smith-tcril
Copy link
Contributor

@Pauldic this is a closed PR and not an appropriate place to discuss a question like that. Please create a forum thread on https://discuss.openedx.org/ instead. The chances of someone in the community that understands your issue seeing it there are much higher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants