Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 ensure backwards compatibility of api server #6866

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
2d68532
ensure price and meta endpoints are backwards compatible
bisgaard-itis Nov 29, 2024
ad235fe
ensure backwards compatibility of credits price
bisgaard-itis Nov 29, 2024
c72f500
updated openapi.json
bisgaard-itis Nov 29, 2024
0805f3a
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Nov 29, 2024
29c7a41
add github workflow to check backwards compatibility of api-server
bisgaard-itis Nov 29, 2024
efcae2a
add github workflow for checking api server backwards compatibility
bisgaard-itis Dec 2, 2024
1b8e35a
make sure github wf always runs
bisgaard-itis Dec 2, 2024
53c0486
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 2, 2024
90e6fd6
begin adding make target for updating all openapi-specs
bisgaard-itis Dec 2, 2024
a168647
add make target for generating openapi-specs
bisgaard-itis Dec 2, 2024
aaafe9d
add make target
bisgaard-itis Dec 2, 2024
fc0bc9a
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 2, 2024
8c49ab7
@matusdrobuliak66 update openapi-specs make target
bisgaard-itis Dec 2, 2024
3363109
start removing openapi specs (artifacts)
bisgaard-itis Dec 2, 2024
9577c83
remove last openapi.json artifacts from repo
bisgaard-itis Dec 2, 2024
5c37a19
bugfix in webserver
bisgaard-itis Dec 2, 2024
81c5e9f
remove openapi.yaml files
bisgaard-itis Dec 2, 2024
18e0f14
ensure parent dir exists for webserver openapi.yaml
bisgaard-itis Dec 2, 2024
0b4e750
progress on gh workflow
bisgaard-itis Dec 2, 2024
dae362f
improve makefile
bisgaard-itis Dec 3, 2024
e8fd7a7
ensure fast failure in make targets
bisgaard-itis Dec 3, 2024
d02c990
readd all openapi specs (tests depend on them)
bisgaard-itis Dec 3, 2024
7ba4caa
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 3, 2024
8a96c60
readd openapi specs for director
bisgaard-itis Dec 3, 2024
db35a67
minor fix
bisgaard-itis Dec 3, 2024
d473429
add github workflow job to ensure openapi specs are up to date
bisgaard-itis Dec 3, 2024
b8f9fcb
minor fix
bisgaard-itis Dec 3, 2024
800a3a8
yet another minor fix
bisgaard-itis Dec 3, 2024
c79a0a6
fix
bisgaard-itis Dec 3, 2024
eb23309
manual testing
bisgaard-itis Dec 3, 2024
1ca4b67
fix
bisgaard-itis Dec 3, 2024
f3eaea2
fix
bisgaard-itis Dec 3, 2024
8fc6f0e
yet another fix
bisgaard-itis Dec 3, 2024
7f1bd60
improve error message
bisgaard-itis Dec 3, 2024
2f06105
test
bisgaard-itis Dec 3, 2024
933d988
update error message
bisgaard-itis Dec 3, 2024
316ab66
update webserver specs
bisgaard-itis Dec 3, 2024
8b6e9f8
fix webserver openapi specs
bisgaard-itis Dec 3, 2024
4658914
yet again webserver
bisgaard-itis Dec 3, 2024
b8d4d38
fix
bisgaard-itis Dec 3, 2024
7dc7b11
fix randomness in openapi-spec generation in webserver
bisgaard-itis Dec 3, 2024
59c3049
test
bisgaard-itis Dec 3, 2024
71ebf58
update api server specs
bisgaard-itis Dec 3, 2024
e942c8d
update gh workflow
bisgaard-itis Dec 3, 2024
5139b98
test
bisgaard-itis Dec 3, 2024
23d9e32
update api-server specs
bisgaard-itis Dec 3, 2024
6b04eeb
start developing backwards compatibility check
bisgaard-itis Dec 3, 2024
cb9a46d
add script for comparing openapi specs
bisgaard-itis Dec 3, 2024
ba6216c
add test in ci workflow
bisgaard-itis Dec 3, 2024
af55161
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 3, 2024
ad1c3e2
improve docs
bisgaard-itis Dec 3, 2024
66f96b2
ensure api servers price model is independent
bisgaard-itis Dec 3, 2024
56c2f92
update api server openapi.json
bisgaard-itis Dec 3, 2024
d321db8
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 3, 2024
80499ad
@sanderegg long options names for .SHELLFLAGS
bisgaard-itis Dec 4, 2024
f143b0c
remove glob from ci uv cache @sanderegg
bisgaard-itis Dec 4, 2024
1cb4386
needs.changes.outputs.anything -> needs.changes.outputs.anything-py
bisgaard-itis Dec 4, 2024
f8cac9b
trigger warnings in pr
bisgaard-itis Dec 4, 2024
69b7b8a
update reqs
bisgaard-itis Dec 4, 2024
5d807d9
update openapi.jsons after merge
bisgaard-itis Dec 4, 2024
0be51fc
test check if pure warnings are displayed
bisgaard-itis Dec 4, 2024
12cfc90
test with error message
bisgaard-itis Dec 4, 2024
0da732c
try out continue on error
bisgaard-itis Dec 4, 2024
a927e63
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 4, 2024
7033543
fail in case of failures
bisgaard-itis Dec 4, 2024
864d190
improve ci script
bisgaard-itis Dec 4, 2024
7779f13
use ci script @gitHK
bisgaard-itis Dec 4, 2024
c32fff6
add required gh workflow for api-server backwards compatibility
bisgaard-itis Dec 4, 2024
306e62f
bugfix
bisgaard-itis Dec 4, 2024
80ec30b
@pcrespov delete empty script
bisgaard-itis Dec 4, 2024
4f42a25
ensure ci workflows are required
bisgaard-itis Dec 4, 2024
8fbcd5b
only run compatibility checks when specs up to date
bisgaard-itis Dec 4, 2024
b0058f9
fix
bisgaard-itis Dec 4, 2024
5bc19ff
split make commands @pcrespov
bisgaard-itis Dec 4, 2024
a09c444
minor fix
bisgaard-itis Dec 4, 2024
b92ac7e
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 4, 2024
a30635d
update openapi specs
bisgaard-itis Dec 4, 2024
8fb1914
make PricingUnitget backwards compatible
bisgaard-itis Dec 4, 2024
b7616e9
update wallet get
bisgaard-itis Dec 4, 2024
050e585
handle WalletGetWithAvailableCredits
bisgaard-itis Dec 4, 2024
597c375
fix pricing plan endpoint
bisgaard-itis Dec 5, 2024
367908f
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 5, 2024
dff8933
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 5, 2024
a60bcdf
fix typo
bisgaard-itis Dec 5, 2024
1eb3659
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 5, 2024
b7e09b4
update api specs
bisgaard-itis Dec 5, 2024
794cbf3
backwards_compatibility.py -> model_adapter.py
bisgaard-itis Dec 5, 2024
ad1020f
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 5, 2024
fe31052
change name of diff script
bisgaard-itis Dec 5, 2024
9f20961
move to legacy notation
bisgaard-itis Dec 5, 2024
cc17b2e
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 5, 2024
947ffd8
update openapi specs
bisgaard-itis Dec 5, 2024
f7c82c2
allow to populate cover models by name
bisgaard-itis Dec 5, 2024
62955cd
Merge branch 'master' into 6865-ensure-backwards-compatibility-of-api…
bisgaard-itis Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/ci-testing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2655,6 +2655,8 @@ jobs:
system-test-environment-setup,
system-test-public-api,
system-test-swarm-deploy,
system-api-specs,
system-backwards-compatibility
]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -2719,3 +2721,78 @@ jobs:
env:
TAG_PREFIX: hotfix-staging-github
run: ./ci/deploy/dockerhub-deploy.bash -n

system-api-specs:
needs: [changes]
if: ${{ needs.changes.outputs.anything-py == 'true' || github.event_name == 'push' }}
timeout-minutes: 10
name: "[sys] check api-specs are up to date"
runs-on: ubuntu-latest
steps:
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.4.x"
enable-cache: false
- name: checkout source branch
uses: actions/checkout@v4
- name: Regenerate specs and check
run: |
bisgaard-itis marked this conversation as resolved.
Show resolved Hide resolved
uv venv .venv && source .venv/bin/activate
make openapi-specs
./ci/github/helpers/openapi-specs-diff.bash diff \
https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name }}/refs/heads/${{ github.event.pull_request.head.ref }} \
.

system-backwards-compatibility:
needs: [changes, system-api-specs]
if: ${{ needs.changes.outputs.anything-py == 'true' || github.event_name == 'push' }}
timeout-minutes: 10
name: "[sys] api-server backwards compatibility"
runs-on: ubuntu-latest
steps:
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.4.x"
enable-cache: false
- name: checkout
uses: actions/checkout@v4
- name: check api-server backwards compatibility
run: |
./scripts/openapi-diff.bash breaking --fail-on ERR\
https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }}/services/api-server/openapi.json \
/specs/services/api-server/openapi.json

api-spec-backwards-compatibility:
needs: [changes, system-api-specs]
if: ${{ needs.changes.outputs.anything-py == 'true' || github.event_name == 'push' }}
continue-on-error: true
timeout-minutes: 10
name: "api-specs-backwards-compatibility"
runs-on: ubuntu-latest
steps:
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.4.x"
enable-cache: false
- name: checkout
uses: actions/checkout@v4
- name: Check openapi-specs backwards compatibility
run: |
bisgaard-itis marked this conversation as resolved.
Show resolved Hide resolved
./ci/github/helpers/openapi-specs-diff.bash breaking \
https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }} \
.
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.DEFAULT_GOAL := help

SHELL := /bin/bash

.SHELLFLAGS := -o errexit -o pipefail -c
MAKE_C := $(MAKE) --no-print-directory --directory

# Operating system
Expand Down Expand Up @@ -84,7 +84,7 @@ export SWARM_STACK_NAME_NO_HYPHEN = $(subst -,_,$(SWARM_STACK_NAME))
export DOCKER_IMAGE_TAG ?= latest
export DOCKER_REGISTRY ?= itisfoundation


MAKEFILES_WITH_OPENAPI_SPECS := $(shell find . -mindepth 2 -type f -name 'Makefile' -not -path '*/.*' -exec grep -l '^openapi-specs:' {} \; | xargs realpath)

get_my_ip := $(shell (hostname --all-ip-addresses || hostname -i) 2>/dev/null | cut --delimiter=" " --fields=1)

Expand Down Expand Up @@ -131,6 +131,12 @@ test_python_version: ## Check Python version, throw error if compilation would f
@.venv/bin/python ./scripts/test_python_version.py


.PHONY: _check_venv_active
_check_venv_active:
# Checking whether virtual environment was activated
@python3 -c "import sys; assert sys.base_prefix!=sys.prefix"
bisgaard-itis marked this conversation as resolved.
Show resolved Hide resolved


## DOCKER BUILD -------------------------------
#
# - all builds are immediatly tagged as 'local/{service}:${BUILD_TARGET}' where BUILD_TARGET='development', 'production', 'cache'
Expand Down Expand Up @@ -573,9 +579,13 @@ new-service: .venv ## Bakes a new project from cookiecutter-simcore-pyservice an


.PHONY: openapi-specs
openapi-specs: ## bundles and validates openapi specifications and schemas of ALL service's API
@$(MAKE_C) services/web/server $@
@$(MAKE_C) services/storage $@
openapi-specs: .env _check_venv_active ## generates and validates openapi specifications and schemas of ALL service's API
@for makefile in $(MAKEFILES_WITH_OPENAPI_SPECS); do \
echo "Generating openapi-specs using $${makefile}"; \
$(MAKE_C) $$(dirname $${makefile}) install-dev; \
$(MAKE_C) $$(dirname $${makefile}) $@; \
printf "%0.s=" {1..100} && printf "\n"; \
done


.PHONY: settings-schema.json
Expand Down
Loading
Loading