Skip to content

feat: add BADGE_GENERATION event and submit button#13

Open
Henrrypg wants to merge 3 commits intomainfrom
hpg/send-event
Open

feat: add BADGE_GENERATION event and submit button#13
Henrrypg wants to merge 3 commits intomainfrom
hpg/send-event

Conversation

@Henrrypg
Copy link
Collaborator

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 extends BadgeTemplateData to include course_id and criteria_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

  • Implemented OpenEdXEventsProcessor, a service class responsible for building and emitting the BADGE_GENERATION event, including normalization of input and error handling.

Workflow Integration

  • Integrated the event emission into the badge workflow orchestrator via a new submit method, allowing the frontend to trigger badge event submission.

Dependency Management

  • Added openedx-events and related dependencies to requirements files to support event emission and data modeling.

@Henrrypg Henrrypg changed the title Hpg/send event feat: add BADGE_GENERATION event and submit button Mar 10, 2026
@Henrrypg Henrrypg requested a review from Copilot March 10, 2026 20:45
Copy link
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

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-events and 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.

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.

2 participants