pipelines:check OpenApi schema generation match repo schema (#2388)
This commit is contained in:
parent
a9927df89c
commit
c7bd63d1c1
|
@ -175,7 +175,7 @@ lint_api:
|
||||||
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
||||||
- changes: [api/**/*]
|
- changes: [api/**/*]
|
||||||
|
|
||||||
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.11
|
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.13
|
||||||
cache: *api_cache
|
cache: *api_cache
|
||||||
before_script:
|
before_script:
|
||||||
- cd api
|
- cd api
|
||||||
|
@ -339,7 +339,7 @@ build_api_schema:
|
||||||
# Add build_docs rules because it depends on the build_api_schema artifact
|
# Add build_docs rules because it depends on the build_api_schema artifact
|
||||||
- changes: [docs/**/*]
|
- changes: [docs/**/*]
|
||||||
|
|
||||||
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.11
|
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.13
|
||||||
services:
|
services:
|
||||||
- postgres:15-alpine
|
- postgres:15-alpine
|
||||||
- redis:7-alpine
|
- redis:7-alpine
|
||||||
|
@ -357,6 +357,11 @@ build_api_schema:
|
||||||
- poetry run funkwhale-manage migrate
|
- poetry run funkwhale-manage migrate
|
||||||
script:
|
script:
|
||||||
- poetry run funkwhale-manage spectacular --file ../docs/schema.yml
|
- poetry run funkwhale-manage spectacular --file ../docs/schema.yml
|
||||||
|
- diff ../docs/schema.yml ./funkwhale_api/common/schema.yml || (
|
||||||
|
echo "Schema files do not match! run sudo docker compose run --rm
|
||||||
|
api funkwhale-manage spectacular > ./api/funkwhale_api/common/schema.yml" &&
|
||||||
|
exit 1
|
||||||
|
)
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 2 weeks
|
expire_in: 2 weeks
|
||||||
paths:
|
paths:
|
||||||
|
|
|
@ -6,6 +6,7 @@ repos:
|
||||||
rev: v4.4.0
|
rev: v4.4.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
|
exclude: "api/funkwhale_api/common/schema.yml"
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
- id: check-executables-have-shebangs
|
- id: check-executables-have-shebangs
|
||||||
- id: check-shebang-scripts-are-executable
|
- id: check-shebang-scripts-are-executable
|
||||||
|
@ -62,6 +63,7 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: prettier
|
- id: prettier
|
||||||
files: \.(md|yml|yaml|json)$
|
files: \.(md|yml|yaml|json)$
|
||||||
|
exclude: "api/funkwhale_api/common/schema.yml"
|
||||||
|
|
||||||
- repo: https://github.com/codespell-project/codespell
|
- repo: https://github.com/codespell-project/codespell
|
||||||
rev: v2.2.6
|
rev: v2.2.6
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
||||||
|
# OpenApi schema
|
||||||
|
|
||||||
|
The frontend need up to date schemas ! If you change the api you need to upgrade the schema by running : `docker compose run --rm api funkwhale-manage spectacular > ./api/funkwhale_api/common/schema.yml`.
|
||||||
|
|
||||||
|
Then you need to upgrade the frontend schema has well by running `yarn generate-types-from-local-schema`.
|
||||||
|
|
||||||
|
Be aware that `get_signup_form_additional_fields_serializer` can tweak the schema generation.
|
Loading…
Reference in New Issue