Skip to content

Commit

Permalink
:burn: [#453] remove v1
Browse files Browse the repository at this point in the history
  • Loading branch information
annashamray committed Sep 26, 2024
1 parent f517900 commit 2d01e08
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 1,299 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ jobs:
black --check src docs
oas-up-to-date:
name: Check for unexepected OAS changes
name: Check for unexpected OAS changes
runs-on: ubuntu-latest
strategy:
matrix:
version: ['v1', 'v2']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -60,18 +57,18 @@ jobs:
run: pip install -r requirements/ci.txt

- name: Generate OAS files
run: ./bin/generate_schema.sh ${{ matrix.version }} openapi-${{ matrix.version }}.yaml
run: ./bin/generate_schema.sh openapi.yaml
env:
DJANGO_SETTINGS_MODULE: objects.conf.ci

- name: Check for OAS changes
run: |
diff openapi-${{ matrix.version }}.yaml src/objects/api/${{ matrix.version }}/openapi.yaml
diff openapi.yaml src/objects/api/v2/openapi.yaml
- name: Write failure markdown
if: ${{ failure() }}
run: |
echo 'Run the following command locally and commit the changes' >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
echo './bin/generate_schema.sh ${{ matrix.version }}' >> $GITHUB_STEP_SUMMARY
echo './bin/generate_schema.sh' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
8 changes: 2 additions & 6 deletions .github/workflows/generate-postman-collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ on:
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['v1', 'v2']

name: Run with version ${{ matrix.version }}
name: Generate Postman collection

steps:
- uses: actions/checkout@v4
Expand All @@ -29,4 +25,4 @@ jobs:
- name: Create tests folder
run: mkdir -p ./tests/postman
- name: Generate Postman collection
run: openapi2postmanv2 -s ./src/objects/api/${{ matrix.version }}/openapi.yaml -o ./tests/postman/collection.json --pretty
run: openapi2postmanv2 -s ./src/objects/api/v2/openapi.yaml -o ./tests/postman/collection.json --pretty
8 changes: 2 additions & 6 deletions .github/workflows/generate-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ on:
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'v1', 'v2' ]

name: Run with version ${{ matrix.version }}
name: Generate SDKs

steps:
- uses: actions/checkout@v4
Expand All @@ -28,7 +24,7 @@ jobs:
run: npm install -g @openapitools/openapi-generator-cli
- name: Determing oas path
id: vars
run: echo ::set-output name=oas::./src/objects/api/${{ matrix.version }}/openapi.yaml
run: echo ::set-output name=oas::./src/objects/api/v2/openapi.yaml
- name: Validate schema
run: openapi-generator-cli validate -i ${{ steps.vars.outputs.oas }}
- name: Generate Java client
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/lint-oas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ on:
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'v1', 'v2' ]

name: Run with version ${{ matrix.version }}
name: Lint OAS

steps:
- uses: actions/checkout@v4
Expand All @@ -27,4 +23,4 @@ jobs:
- name: Install spectral
run: npm install -g @stoplight/spectral@5
- name: Run OAS linter
run: spectral lint ./src/objects/api/${{ matrix.version }}/openapi.yaml
run: spectral lint ./src/objects/api/v2/openapi.yaml
15 changes: 3 additions & 12 deletions bin/generate_schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@
#
# Run this script from the root of the repository

if [ "$1" = "" ]; then
echo "You need to pass a version in the first argument"
exit 1
fi

if [ "$1" != "v1" ] && [ "$1" != "v2" ]; then
echo "You need to pass a correct version in the first argument. Available values: v1, v2"
exit 1
fi
export SCHEMA_PATH=src/objects/api/v2/openapi.yaml

export SCHEMA_PATH=src/objects/api/$1/openapi.yaml
OUTPUT_FILE=$1

OUTPUT_FILE=$2

src/manage.py spectacular --file ${OUTPUT_FILE:-$SCHEMA_PATH} --validate --api-version $1
src/manage.py spectacular --file ${OUTPUT_FILE:-$SCHEMA_PATH} --validate
1 change: 0 additions & 1 deletion src/objects/api/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.urls import include, path

urlpatterns = [
path("v1", include("objects.api.v1.urls", namespace="v1")),
path("v2", include("objects.api.v2.urls", namespace="v2")),
]
Empty file removed src/objects/api/v1/__init__.py
Empty file.
121 changes: 0 additions & 121 deletions src/objects/api/v1/filters.py

This file was deleted.

Loading

0 comments on commit 2d01e08

Please sign in to comment.