Skip to content

feat: adding a processor to store b64 images in course assets#27

Merged
Henrrypg merged 8 commits intomainfrom
fmo/save_img_to_assets
Apr 8, 2026
Merged

feat: adding a processor to store b64 images in course assets#27
Henrrypg merged 8 commits intomainfrom
fmo/save_img_to_assets

Conversation

@felipemontoya
Copy link
Copy Markdown
Member

This PR adds a image processor that is capable of uploading the b64 image into assets in the course that authors can see in the files tab.

Then the orchestrator removes the Base 64 version and turns it into a URL that can be published and accessed publicly.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a processor that converts base64-encoded badge images into course assets and returns a public URL, using a configurable contentstore wrapper to avoid importing CMS modules at import time.

Changes:

  • Added BadgeImageUploadProcessor to decode base64 PNGs, upload to course assets, and return a public asset URL.
  • Introduced a contentstore wrapper + Redwood backend module selected via OPENEDX_AI_BADGES_CONTENTSTORE_BACKEND.
  • Added unit tests for both the wrapper and the new processor behavior.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
backend/openedx_ai_badges/processors/badge_image_upload_processor.py Implements base64 decode → asset upload → public URL generation
backend/openedx_ai_badges/edxapp_wrapper/contentstore.py Adds dynamic backend delegation for contentstore APIs
backend/openedx_ai_badges/edxapp_wrapper/backends/contentstore_r_v1.py Redwood backend bindings to platform contentstore APIs
backend/openedx_ai_badges/settings/common.py Registers default contentstore backend setting
backend/openedx_ai_badges/workflows/orchestrators.py Adds processor import for orchestrator usage
backend/tests/test_badge_image_upload_processor.py Tests successful upload, conversions, and failure modes
backend/tests/test_contentstore_wrapper.py Tests wrapper delegation and delayed imports

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/openedx_ai_badges/settings/common.py
Comment thread backend/openedx_ai_badges/processors/badge_image_upload_processor.py Outdated
Comment thread backend/openedx_ai_badges/edxapp_wrapper/contentstore.py Outdated
Comment thread backend/tests/test_badge_image_upload_processor.py Outdated
@felipemontoya felipemontoya force-pushed the fmo/save_img_to_assets branch from ba2b528 to 6a5919c Compare April 7, 2026 22:48
@felipemontoya felipemontoya force-pushed the fmo/save_img_to_assets branch from 6a5919c to 161ea7b Compare April 7, 2026 23:29
@felipemontoya felipemontoya force-pushed the fmo/save_img_to_assets branch from 6645317 to 6b9bc1a Compare April 8, 2026 00:45
@felipemontoya
Copy link
Copy Markdown
Member Author

@Henrrypg ready for your review

Copy link
Copy Markdown
Collaborator

@Henrrypg Henrrypg left a comment

Choose a reason for hiding this comment

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

It is working fine, thanks @felipemontoya

@Henrrypg Henrrypg merged commit 13cc091 into main Apr 8, 2026
6 checks passed
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