Skip to content

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

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

Faraz32123 wants to merge 7 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
@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
Comment thread .github/workflows/generate_openapi_schemas.yml Outdated
Comment thread .github/workflows/generate_openapi_schemas.yml
Comment thread .github/workflows/generate_openapi_schemas.yml Outdated
Comment thread .github/workflows/generate_openapi_schemas.yml Outdated
@Faraz32123
Faraz32123 requested a review from feanil September 9, 2026 11:49
Comment thread .github/workflows/generate_openapi_schemas.yml Outdated
Comment thread .github/workflows/generate_openapi_schemas.yml Outdated
Comment thread .github/workflows/generate_openapi_schemas.yml
Faraz32123 added a commit to edly-io/openedx-platform-sdk that referenced this pull request Sep 17, 2026
openedx/openedx-platform#39025 writes the generated schemas to
docs/lms-openapi.yaml and docs/cms-openapi.yaml instead of the repo root, so
follow the sparse-checkout, the CI env vars, and the PLATFORM_DIR copy. The
SDK's own local copies keep their cms_schema.yml / lms_schema.yml names.
Comment thread .github/workflows/generate_openapi_schemas.yml Outdated
Comment thread .github/workflows/generate_openapi_schemas.yml
Comment thread .github/workflows/generate_openapi_schemas.yml Outdated
Add GH workflow to automatically generate openapi schema whenever view file tagged with the "openedx-platform-sdk" @extend_schema tag changes
address comments on generate_openapi_schemas workflow
- weekly schedule
- use team-reviewers param
- write to docs/lms-openapi.yaml and docs/cms-openapi.yaml instead of
  creating new schema files at the repo root
- generate the LMS schema under docs.docs_settings so the workflow writes
  the same full API surface `make swagger` does, rather than overwriting
  the docs schema with the narrow SDK-facing one
uv sync installed no groups, so ora2 was missing and both schema steps died
with ModuleNotFoundError. Use the docs group, which pulls in bundled, the same
set .readthedocs.yaml installs.

manage.py cms defaults to cms.envs.devstack, which needs a CMS_CFG file CI
does not have. Run it under cms.envs.development, and give cms/envs/common.py
the schema title and version — the Authoring API's SPECTACULAR_SETTINGS lives
in devstack and production, so development would otherwise emit an untitled
0.0.0 document.

Also align the setup-uv pin with the other workflows, and add branch-suffix
and workflow_ref provenance to match the other PR-opening ones.
@Faraz32123
Faraz32123 force-pushed the feat/add_workflow_to_automatically_generate_openapi_schema branch from 32eba76 to 9532c3c Compare September 22, 2026 16:54
@Faraz32123
Faraz32123 requested a review from feanil September 22, 2026 16:55
Comment thread .github/workflows/generate_openapi_schemas.yml
Comment thread cms/envs/common.py
Generation needs migrated tables, not just a server: drf-spectacular evaluates
a queryset while building a warning for edxval's VideoList. Add the mysql
service and a migrate step the way migrations-check.yml does.

cms.envs.development inherited the Authoring API's title and version but none
of its filtering, so docs/cms-openapi.yaml came out at 235 paths with the rest
of the service in it. Only SERVERS and the long DESCRIPTION depend on CMS_BASE
and AUTHORING_API_URL, so the hooks and the path prefix move down to
cms/envs/common.py as well. 57 paths.
Comment thread .github/workflows/generate_openapi_schemas.yml Outdated
Comment thread .github/workflows/generate_openapi_schemas.yml Outdated
split_modulestore_django's 0002_data_migration reads the modulestore, so
migrating from empty needs Mongo even though generation doesn't. Add the
service and the user setup step from migrations-check.yml.

manage.py falls back to devstack without DJANGO_SETTINGS_MODULE, and devstack's
DATABASES is empty without an LMS_CFG, so both migrate steps failed before
reaching the service. Run each under the same settings as its generate step.

This branch has not been deployed

No deployments
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