Skip to content

feat: add GH workflow to generate openapi schema - #39025

Open
Faraz32123 wants to merge 2 commits into
masterfrom
feat/add_workflow_to_automatically_generate_openapi_schema
Open

feat: add GH workflow to generate openapi schema#39025
Faraz32123 wants to merge 2 commits into
masterfrom
feat/add_workflow_to_automatically_generate_openapi_schema

Conversation

@Faraz32123

Copy link
Copy Markdown
Contributor

Add GH workflow to automatically generate openapi schema whenever view file tagged with the "openedx-platform-sdk" @extend_schema tag changes.
Related PR: edly-io/openedx-platform-sdk#1

Comment thread .github/workflows/generate_openapi_schemas.yml Fixed
Add GH workflow to automatically generate openapi schema whenever view file tagged with the "openedx-platform-sdk" @extend_schema tag changes
@Faraz32123
Faraz32123 force-pushed the feat/add_workflow_to_automatically_generate_openapi_schema branch from b5c8f71 to 69a3dd8 Compare August 25, 2026 13:09
@Faraz32123
Faraz32123 requested a review from feanil August 27, 2026 13:47

- name: Install dependencies
run: |
pip install --upgrade pip

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We're using uv in this repo now, see how we do this in other workflows and sync it up.

Comment thread .github/workflows/generate_openapi_schemas.yml
--file cms_schema.yml

- name: Open pull request if schemas changed
uses: peter-evans/create-pull-request@v6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR should tag the current on-call engineer via the @openedx/wg-maintenance-openedx-platform-oncall team.

# Switch to a lighter settings module if production settings require
# environment variables or external services that are unavailable in CI.
python manage.py spectacular \
--settings=lms.envs.production \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason this can't use the default settings file? Today it's the devstack settings file.

@Faraz32123
Faraz32123 requested a review from feanil September 9, 2026 11:49

**Do not edit these files by hand** — they will be overwritten on the next run.

@openedx/wg-maintenance-openedx-platform-oncall heads up on this automated PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use team-reviewers parameter instead: https://github.com/peter-evans/create-pull-request

Comment on lines +17 to +37
push:
branches:
- master
paths:
# Triggers whenever a view file tagged with the openedx-platform-sdk
# @extend_schema tag changes — add new tagged view paths here as more
# APIs are onboarded to the SDK.
#
# LMS — Enrollment v2
- 'openedx/core/djangoapps/enrollments/**'
# CMS — XBlock v1, Home v3/v4, Course Details v3, Authoring Grading v3
- 'cms/djangoapps/contentstore/rest_api/v1/views/xblock.py'
- 'cms/djangoapps/contentstore/rest_api/v3/views/home.py'
- 'cms/djangoapps/contentstore/rest_api/v3/views/course_details.py'
- 'cms/djangoapps/contentstore/rest_api/v3/views/authoring_grading.py'
- 'cms/djangoapps/contentstore/rest_api/v4/views/home.py'
# drf-spectacular config changes in either service
- 'lms/lib/spectacular.py'
- 'cms/lib/spectacular.py'
- 'lms/envs/common.py'
- 'cms/envs/common.py'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rather than running this on every change to these files, what about running this once weekly on any changes. That way we don't need to maintain a list of files here, any changes to any of our tagged schemas will get picked up.

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.

4 participants