feat: add BADGE_GENERATION event and submit button#13
Open
Conversation
af3bd6d to
e8d4c43
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an Open edX local event (BADGE_GENERATION) for AI-generated badge definitions and wires it into the existing badge workflow so downstream systems (e.g., Credentials/Credly) can consume the emitted event.
Changes:
- Introduces local event schema (
BadgeGenerationData) and signal definition (BADGE_GENERATION), plus a processor to build/emit the event. - Adds a new backend workflow action (
submit) and a frontend “Submit Badge” CTA to trigger emission. - Updates backend requirements to include
openedx-eventsand transitive pins across env requirement sets.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/messages.ts | Adds i18n strings for the new “Submit Badge” UI states. |
| frontend/src/hooks/useBadgeGeneration.ts | Adds submit state + handler to call the workflow submit action. |
| frontend/src/components/AIBadgesTab/BadgePreview.tsx | Renders submit button + success/error alerts in the preview pane. |
| frontend/src/components/AIBadgesTab/AIBadgesTab.tsx | Plumbs submit props from hook into BadgePreview. |
| backend/openedx_ai_badges/workflows/orchestrators.py | Adds submit action to emit BADGE_GENERATION from session badge data. |
| backend/openedx_ai_badges/processors/openedx_events_processor.py | New service to normalize inputs and send the Open edX event. |
| backend/openedx_ai_badges/events/data.py | Defines BadgeGenerationData attrs payload for the event. |
| backend/openedx_ai_badges/events/signals.py | Defines local BADGE_GENERATION signal using openedx-events tooling. |
| backend/openedx_ai_badges/events/init.py | Documents local event package purpose/conventions. |
| backend/requirements/base.in | Adds openedx-events dependency to base input requirements. |
| backend/requirements/base.txt | Compiled base requirements updated for openedx-events + transitive deps. |
| backend/requirements/test.txt | Compiled test requirements updated for openedx-events + transitive deps. |
| backend/requirements/quality.txt | Compiled lint/quality requirements updated for openedx-events + transitive deps. |
| backend/requirements/dev.txt | Compiled dev requirements updated for openedx-events + transitive deps. |
| backend/requirements/doc.txt | Compiled docs requirements updated for openedx-events + transitive deps. |
| backend/requirements/pip.txt | Minor metadata/comment adjustments for pip pin provenance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backend/openedx_ai_badges/processors/openedx_events_processor.py
Outdated
Show resolved
Hide resolved
backend/openedx_ai_badges/processors/openedx_events_processor.py
Outdated
Show resolved
Hide resolved
b34b9d3 to
38b2262
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new local Open edX event for AI-generated badge definitions, enabling course-level badge generation events to be emitted and consumed by downstream systems. The changes include the definition of event data and signals, a processor for emitting the event, integration into the badge workflow, and the addition of required dependencies.
Open edX Event Integration for Badge Generation:
Event and Data Model Definitions
Introduced
BadgeGenerationData, a data class that extendsBadgeTemplateDatato includecourse_idandcriteria_narrative, following OEP-49 conventions. This enables course-level badge information to be included in events.Added local event and signal definitions for
BADGE_GENERATION, following OEP-41 naming conventions, to be contributed upstream in the future.Event Emission Processor
OpenEdXEventsProcessor, a service class responsible for building and emitting theBADGE_GENERATIONevent, including normalization of input and error handling.Workflow Integration
submitmethod, allowing the frontend to trigger badge event submission.Dependency Management
openedx-eventsand related dependencies to requirements files to support event emission and data modeling.