From c9a9b1bc0a8379565f07308fe5fae8360879038c Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 11:05:46 +0200 Subject: [PATCH 01/28] breaking: Fixed #1 --- creyPY/fastapi/crud.py | 4 ++-- creyPY/fastapi/pagination.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/creyPY/fastapi/crud.py b/creyPY/fastapi/crud.py index 73844cb..ec47cf2 100644 --- a/creyPY/fastapi/crud.py +++ b/creyPY/fastapi/crud.py @@ -23,9 +23,9 @@ def get_object_or_404( # TODO: Add testing def create_obj_from_data( - data: BaseModel, model: Type[T], db: Session, additonal_data={}, exclude={} + data: BaseModel, model: Type[T], db: Session, additional_data={}, exclude={} ) -> T: - obj = model(**data.model_dump(exclude=exclude) | additonal_data) + obj = model(**data.model_dump(exclude=exclude) | additional_data) db.add(obj) db.commit() db.refresh(obj) diff --git a/creyPY/fastapi/pagination.py b/creyPY/fastapi/pagination.py index ad339ab..a74c477 100644 --- a/creyPY/fastapi/pagination.py +++ b/creyPY/fastapi/pagination.py @@ -102,8 +102,7 @@ def paginate( transformer: Optional[SyncItemsTransformer] = None, additional_data: Optional[AdditionalData] = None, ): - - params, raw_params = verify_params(params, "limit-offset", "cursor") + params, _ = verify_params(params, "limit-offset", "cursor") count_query = create_count_query(query) total = connection.scalar(count_query) From 4a5a777ef5b65e4e68134c89bd8f78b06b77bfd9 Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 11:07:44 +0200 Subject: [PATCH 02/28] breaking: Fixed #3 --- creyPY/fastapi/crud.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/creyPY/fastapi/crud.py b/creyPY/fastapi/crud.py index ec47cf2..2a68978 100644 --- a/creyPY/fastapi/crud.py +++ b/creyPY/fastapi/crud.py @@ -38,13 +38,13 @@ def update_obj_from_data( model: Type[T], id: UUID | str, db: Session, - partial: bool = False, # TODO: inverse, because it is currently the wrong way around + partial: bool = True, ignore_fields=[], additional_data={}, exclude={}, ) -> T: obj = get_object_or_404(model, id, db) - data_dict = data.model_dump(exclude_unset=not partial, exclude=exclude) + data_dict = data.model_dump(exclude_unset=partial, exclude=exclude) data_dict.update(additional_data) # merge additional_data into data_dict for field in data_dict: if field not in ignore_fields: From cfa1da08d3f2230f884373dc9022b64e2cac3b33 Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 11:30:51 +0200 Subject: [PATCH 03/28] fix: pipeline now pushes pre-release versions --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c273c1..e1b949e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,6 @@ jobs: - run: python test.py tag_and_publish: - if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest needs: test permissions: @@ -73,7 +72,13 @@ jobs: major-identifier: "breaking:" - name: Create Tag - run: git tag ${{ steps.git_version.outputs.version }} + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' + run: | + if [ "${{ github.ref }}" == "refs/heads/master" ]; then + git tag ${{ steps.git_version.outputs.version }} + elif [ "${{ github.ref }}" == "refs/heads/dev" ]; then + git tag ${{ steps.git_version.outputs.version }}-rc + fi - name: Push tag run: git push origin ${{ steps.git_version.outputs.version }} From 851573d9648ec1a26caef9deac08daa7b921c354 Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 11:38:15 +0200 Subject: [PATCH 04/28] fix: fixed pipeline tagging --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1b949e..7cb2e7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-tags: true - ref: ${{ github.ref }} + ref: ${{ github.head_ref }} fetch-depth: 0 - name: setup git @@ -74,9 +74,9 @@ jobs: - name: Create Tag if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' run: | - if [ "${{ github.ref }}" == "refs/heads/master" ]; then + if [ "${{ github.head_ref }}" == "master" ]; then git tag ${{ steps.git_version.outputs.version }} - elif [ "${{ github.ref }}" == "refs/heads/dev" ]; then + elif [ "${{ github.head_ref }}" == "dev" ]; then git tag ${{ steps.git_version.outputs.version }}-rc fi From aa44b9ebe9e4942c84f53681a35fca10e9bf7060 Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 11:42:19 +0200 Subject: [PATCH 05/28] fix: fixed pipeline tagging --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cb2e7c..1a1a103 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: major-identifier: "breaking:" - name: Create Tag - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' + if: github.head_ref == 'master' || github.head_ref == 'dev' run: | if [ "${{ github.head_ref }}" == "master" ]; then git tag ${{ steps.git_version.outputs.version }} From 8740eafce2d5e6b076166334b8887e2cf0801abb Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 11:47:41 +0200 Subject: [PATCH 06/28] fix: fixed pipeline tagging --- .github/workflows/ci.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a1a103..fc0cebe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,12 +73,7 @@ jobs: - name: Create Tag if: github.head_ref == 'master' || github.head_ref == 'dev' - run: | - if [ "${{ github.head_ref }}" == "master" ]; then - git tag ${{ steps.git_version.outputs.version }} - elif [ "${{ github.head_ref }}" == "dev" ]; then - git tag ${{ steps.git_version.outputs.version }}-rc - fi + run: git tag ${{ steps.git_version.outputs.version }} - name: Push tag run: git push origin ${{ steps.git_version.outputs.version }} From 983553e97a334f61c2ba5eaf04ae373422e820ed Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 11:56:00 +0200 Subject: [PATCH 07/28] fix: locked tag and publish to master and dev --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc0cebe..4ae1897 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,7 @@ jobs: tag_and_publish: runs-on: ubuntu-latest + if: github.head_ref == 'master' || github.head_ref == 'dev' needs: test permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing From f11b8b886442e0397ab02c550e2f2f3069ca2b92 Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 12:00:19 +0200 Subject: [PATCH 08/28] fix: alternative attempt on the fix --- .github/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ae1897..0a3ed56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,10 +71,16 @@ jobs: with: minor-identifier: "feat:" major-identifier: "breaking:" + release-branch: ${{ github.head_ref }} - name: Create Tag - if: github.head_ref == 'master' || github.head_ref == 'dev' - run: git tag ${{ steps.git_version.outputs.version }} + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' + run: | + if [ "${{ github.ref }}" == "refs/heads/master" ]; then + git tag ${{ steps.git_version.outputs.version }} + elif [ "${{ github.ref }}" == "refs/heads/dev" ]; then + git tag ${{ steps.git_version.outputs.version }}-rc + fi - name: Push tag run: git push origin ${{ steps.git_version.outputs.version }} From c91e684f08fda31e34f579d3ff5e60462166909c Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 12:03:37 +0200 Subject: [PATCH 09/28] fix: fix attempt for the github pipeline --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a3ed56..4439a0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,11 +74,11 @@ jobs: release-branch: ${{ github.head_ref }} - name: Create Tag - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' + if: github.head_ref == 'master' || github.head_ref == 'dev' run: | - if [ "${{ github.ref }}" == "refs/heads/master" ]; then + if [ "${{ github.head_ref }}" == "master" ]; then git tag ${{ steps.git_version.outputs.version }} - elif [ "${{ github.ref }}" == "refs/heads/dev" ]; then + elif [ "${{ github.head_ref }}" == "dev" ]; then git tag ${{ steps.git_version.outputs.version }}-rc fi From 5f39966223683008b0d8e2edce1280d7a78ead73 Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 12:07:40 +0200 Subject: [PATCH 10/28] fix: Fixed tag pushing and changelog --- .github/workflows/ci.yml | 7 +++---- CHANGELOG.md | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4439a0e..9467201 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,18 +73,17 @@ jobs: major-identifier: "breaking:" release-branch: ${{ github.head_ref }} - - name: Create Tag + - name: Create & Push Tag if: github.head_ref == 'master' || github.head_ref == 'dev' run: | if [ "${{ github.head_ref }}" == "master" ]; then git tag ${{ steps.git_version.outputs.version }} + git push origin ${{ steps.git_version.outputs.version }} elif [ "${{ github.head_ref }}" == "dev" ]; then git tag ${{ steps.git_version.outputs.version }}-rc + git push origin ${{ steps.git_version.outputs.version }}-rc fi - - name: Push tag - run: git push origin ${{ steps.git_version.outputs.version }} - - name: Set up Python uses: actions/setup-python@v5 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 645831d..e85c963 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to this project will be documented in this file. +## 2.0.0 + +- Fixed #1 +- Fixed #3 + +Notes: + +You will need to change calls to `create_obj_from_data` according to #1 (rename additonal_data to additional_data) + +You will need to change calls to `update_obj_from_data` according to #3 (if you supplied `partial`, you will need to reverse it: `true` -> `false` and `false` -> `true`) + +## 1.3.0 + +- Addition of pagination proxy and pagination=off functionality (Thanks to @vikbhas) + +## 1.2.5 + +- Bumped dependencies + ## 1.2.4 - Enabled newer versions for all dependencies From 39ae74becb31bbdbdc943863db727bbe28088918 Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 12:15:23 +0200 Subject: [PATCH 11/28] fix: minor changelog adjustment --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e85c963..5b998b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ All notable changes to this project will be documented in this file. ## 2.0.0 -- Fixed #1 -- Fixed #3 +- Fixed #1 Rename misspelled additonal_data to additional_data on create_obj_from_data +- Fixed #3 Inverse partial flag: bool = False because it was wrong on update_obj_from_data Notes: From c7e205f14ba4a2e5a2fb2aa3b50c7f3bafe5c711 Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 12:18:50 +0200 Subject: [PATCH 12/28] fix: fixed naming of pre-release commits --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9467201..9e66e65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,8 +80,8 @@ jobs: git tag ${{ steps.git_version.outputs.version }} git push origin ${{ steps.git_version.outputs.version }} elif [ "${{ github.head_ref }}" == "dev" ]; then - git tag ${{ steps.git_version.outputs.version }}-rc - git push origin ${{ steps.git_version.outputs.version }}-rc + git tag ${{ steps.git_version.outputs.version }}-rc.${{ github.sha }} + git push origin ${{ steps.git_version.outputs.version }}-rc.${{ github.sha }} fi - name: Set up Python From 714178d68fc341cc1195ce5ed5c4af24a59ecacd Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 12:22:45 +0200 Subject: [PATCH 13/28] fix: fixed naming of pre-release commits --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e66e65..87e69dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,8 +80,9 @@ jobs: git tag ${{ steps.git_version.outputs.version }} git push origin ${{ steps.git_version.outputs.version }} elif [ "${{ github.head_ref }}" == "dev" ]; then - git tag ${{ steps.git_version.outputs.version }}-rc.${{ github.sha }} - git push origin ${{ steps.git_version.outputs.version }}-rc.${{ github.sha }} + calculatedSha=$(git rev-parse --short ${{ github.sha }}) + git tag ${{ steps.git_version.outputs.version }}-rc${calculatedSha} + git push origin ${{ steps.git_version.outputs.version }}-rc${calculatedSha} fi - name: Set up Python From 3f4a0ee00da952ee647e8b3f2445351e026882a7 Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 12:25:30 +0200 Subject: [PATCH 14/28] fix: fixed naming of pre-release commits --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87e69dc..37e9e13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,8 +81,8 @@ jobs: git push origin ${{ steps.git_version.outputs.version }} elif [ "${{ github.head_ref }}" == "dev" ]; then calculatedSha=$(git rev-parse --short ${{ github.sha }}) - git tag ${{ steps.git_version.outputs.version }}-rc${calculatedSha} - git push origin ${{ steps.git_version.outputs.version }}-rc${calculatedSha} + git tag ${{ steps.git_version.outputs.version }}rc${calculatedSha} + git push origin ${{ steps.git_version.outputs.version }}rc${calculatedSha} fi - name: Set up Python From d6f79c3ed8083983be14913c9c720c26a7294a8a Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 12:35:13 +0200 Subject: [PATCH 15/28] fix: fixed naming of pre-release commits --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37e9e13..e79b13e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,8 +81,8 @@ jobs: git push origin ${{ steps.git_version.outputs.version }} elif [ "${{ github.head_ref }}" == "dev" ]; then calculatedSha=$(git rev-parse --short ${{ github.sha }}) - git tag ${{ steps.git_version.outputs.version }}rc${calculatedSha} - git push origin ${{ steps.git_version.outputs.version }}rc${calculatedSha} + git tag ${{ steps.git_version.outputs.version }}-rc+${calculatedSha} + git push origin ${{ steps.git_version.outputs.version }}-rc+${calculatedSha} fi - name: Set up Python From d54146e05b5da1fe310a220bd81c9369561b8537 Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 24 Oct 2024 12:41:04 +0200 Subject: [PATCH 16/28] fix: fixed naming of pre-release commits --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e79b13e..38f9cb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,8 +81,8 @@ jobs: git push origin ${{ steps.git_version.outputs.version }} elif [ "${{ github.head_ref }}" == "dev" ]; then calculatedSha=$(git rev-parse --short ${{ github.sha }}) - git tag ${{ steps.git_version.outputs.version }}-rc+${calculatedSha} - git push origin ${{ steps.git_version.outputs.version }}-rc+${calculatedSha} + git tag ${{ steps.git_version.outputs.version }}rc.dev${calculatedSha} + git push origin ${{ steps.git_version.outputs.version }}rc.dev${calculatedSha} fi - name: Set up Python From 0bf89fe14dc9976b8c220c91acaa3e86c7c69ea0 Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 25 Oct 2024 14:12:04 +0200 Subject: [PATCH 17/28] fix: switched to semantic versioning action --- .github/workflows/ci.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38f9cb6..a14aeac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,6 @@ on: - master - dev paths-ignore: - - "**/.github/**" - "**/.gitignore" - "**/.vscode/**" - "**/README.md" @@ -65,25 +64,30 @@ jobs: git config --local user.email "15138480+creyD@users.noreply.github.com" git config --local user.name "creyD" + - name: Set version format + id: set_version + run: | + if [[ "${{ github.head_ref }}" == "master" ]]; then + echo "::set-output name=version_format::${major}.${minor}.${patch}" + elif [[ "${{ github.head_ref }}" == "dev" ]]; then + echo "::set-output name=version_format::${major}.${minor}.${patch}-rc${increment}" + fi + - name: Git Version - uses: codacy/git-version@2.8.0 + uses: PaulHatch/semantic-version@v5.4.0 id: git_version with: - minor-identifier: "feat:" - major-identifier: "breaking:" - release-branch: ${{ github.head_ref }} + tag_prefix: "" + major_pattern: "breaking:" + minor_pattern: "feat:" + enable_prerelease_mode: false + version_format: ${{ steps.set_version.outputs.version_format }} - name: Create & Push Tag if: github.head_ref == 'master' || github.head_ref == 'dev' run: | - if [ "${{ github.head_ref }}" == "master" ]; then - git tag ${{ steps.git_version.outputs.version }} - git push origin ${{ steps.git_version.outputs.version }} - elif [ "${{ github.head_ref }}" == "dev" ]; then - calculatedSha=$(git rev-parse --short ${{ github.sha }}) - git tag ${{ steps.git_version.outputs.version }}rc.dev${calculatedSha} - git push origin ${{ steps.git_version.outputs.version }}rc.dev${calculatedSha} - fi + git tag ${{ steps.git_version.outputs.version }} + git push origin ${{ steps.git_version.outputs.version }} - name: Set up Python uses: actions/setup-python@v5 From 5903de2aadf6357f6c06543f6aac7da214c5b36d Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 25 Oct 2024 14:19:11 +0200 Subject: [PATCH 18/28] fix: fixed semantic versioning format selector --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a14aeac..b3d4efa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,9 +68,9 @@ jobs: id: set_version run: | if [[ "${{ github.head_ref }}" == "master" ]]; then - echo "::set-output name=version_format::${major}.${minor}.${patch}" + echo "V_FORMAT='${major}.${minor}.${patch}'" >> $GITHUB_OUTPUT elif [[ "${{ github.head_ref }}" == "dev" ]]; then - echo "::set-output name=version_format::${major}.${minor}.${patch}-rc${increment}" + echo "V_FORMAT='${major}.${minor}.${patch}-rc${increment}'" >> $GITHUB_OUTPUT fi - name: Git Version @@ -81,7 +81,7 @@ jobs: major_pattern: "breaking:" minor_pattern: "feat:" enable_prerelease_mode: false - version_format: ${{ steps.set_version.outputs.version_format }} + version_format: ${{ steps.set_version.outputs.V_FORMAT }} - name: Create & Push Tag if: github.head_ref == 'master' || github.head_ref == 'dev' From 8463eef90708e863c8cb8bc0369cb8ab0826beb0 Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 25 Oct 2024 14:25:48 +0200 Subject: [PATCH 19/28] fix: attempt on fixing the versioning issue --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3d4efa..d4a7a9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,9 +68,9 @@ jobs: id: set_version run: | if [[ "${{ github.head_ref }}" == "master" ]]; then - echo "V_FORMAT='${major}.${minor}.${patch}'" >> $GITHUB_OUTPUT + echo "V_FORMAT=${major}.${minor}.${patch}" >> $GITHUB_ENV elif [[ "${{ github.head_ref }}" == "dev" ]]; then - echo "V_FORMAT='${major}.${minor}.${patch}-rc${increment}'" >> $GITHUB_OUTPUT + echo "V_FORMAT=${major}.${minor}.${patch}-rc${increment}" >> $GITHUB_ENV fi - name: Git Version From 0bed0e0da4ac4d9216ab7712b8f8de85e81922e8 Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 25 Oct 2024 14:34:56 +0200 Subject: [PATCH 20/28] fix: attempt on fixing the versioning issue --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4a7a9d..a9f85f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: if [[ "${{ github.head_ref }}" == "master" ]]; then echo "V_FORMAT=${major}.${minor}.${patch}" >> $GITHUB_ENV elif [[ "${{ github.head_ref }}" == "dev" ]]; then - echo "V_FORMAT=${major}.${minor}.${patch}-rc${increment}" >> $GITHUB_ENV + echo "V_FORMAT=${major}.${minor}.${patch}${increment}" >> $GITHUB_ENV fi - name: Git Version From c24f8933fb9d6cf87ee0a123f7c71af0878acd9f Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 25 Oct 2024 14:38:58 +0200 Subject: [PATCH 21/28] fix: attempt on fixing the versioning issue --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9f85f2..c773564 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: if [[ "${{ github.head_ref }}" == "master" ]]; then echo "V_FORMAT=${major}.${minor}.${patch}" >> $GITHUB_ENV elif [[ "${{ github.head_ref }}" == "dev" ]]; then - echo "V_FORMAT=${major}.${minor}.${patch}${increment}" >> $GITHUB_ENV + echo "V_FORMAT=${major}.${minor}.${patch}-prerelease${increment}" >> $GITHUB_ENV fi - name: Git Version From 89351d714bfa048ed53e216a0a811620986d669f Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 25 Oct 2024 14:44:18 +0200 Subject: [PATCH 22/28] fix: debugging pipeline --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c773564..e59da9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,8 +71,11 @@ jobs: echo "V_FORMAT=${major}.${minor}.${patch}" >> $GITHUB_ENV elif [[ "${{ github.head_ref }}" == "dev" ]]; then echo "V_FORMAT=${major}.${minor}.${patch}-prerelease${increment}" >> $GITHUB_ENV - fi + fi" + - name: get version format + run: echo "${{ steps.set_version.outputs.V_FORMAT }}" >> $GITHUB_STEP_SUMMARY + - name: Git Version uses: PaulHatch/semantic-version@v5.4.0 id: git_version @@ -81,7 +84,7 @@ jobs: major_pattern: "breaking:" minor_pattern: "feat:" enable_prerelease_mode: false - version_format: ${{ steps.set_version.outputs.V_FORMAT }} + version_format: "${major}.${minor}.${patch}-prerelease${increment}" - name: Create & Push Tag if: github.head_ref == 'master' || github.head_ref == 'dev' From 6d5411a8ae8ad1ac7c08221b82d9b978a109fe0b Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 25 Oct 2024 14:46:35 +0200 Subject: [PATCH 23/28] fix: debugging pipeline --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e59da9f..274326b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: echo "V_FORMAT=${major}.${minor}.${patch}" >> $GITHUB_ENV elif [[ "${{ github.head_ref }}" == "dev" ]]; then echo "V_FORMAT=${major}.${minor}.${patch}-prerelease${increment}" >> $GITHUB_ENV - fi" + fi - name: get version format run: echo "${{ steps.set_version.outputs.V_FORMAT }}" >> $GITHUB_STEP_SUMMARY From e381992f8e7aa72152dac2f0ec453b970a68fbba Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 25 Oct 2024 15:09:15 +0200 Subject: [PATCH 24/28] fix: fixing dev versioning --- .github/workflows/ci.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 274326b..858ea6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,18 +64,6 @@ jobs: git config --local user.email "15138480+creyD@users.noreply.github.com" git config --local user.name "creyD" - - name: Set version format - id: set_version - run: | - if [[ "${{ github.head_ref }}" == "master" ]]; then - echo "V_FORMAT=${major}.${minor}.${patch}" >> $GITHUB_ENV - elif [[ "${{ github.head_ref }}" == "dev" ]]; then - echo "V_FORMAT=${major}.${minor}.${patch}-prerelease${increment}" >> $GITHUB_ENV - fi - - - name: get version format - run: echo "${{ steps.set_version.outputs.V_FORMAT }}" >> $GITHUB_STEP_SUMMARY - - name: Git Version uses: PaulHatch/semantic-version@v5.4.0 id: git_version @@ -84,7 +72,7 @@ jobs: major_pattern: "breaking:" minor_pattern: "feat:" enable_prerelease_mode: false - version_format: "${major}.${minor}.${patch}-prerelease${increment}" + version_format: "${major}.${minor}.${patch}rc${increment}" - name: Create & Push Tag if: github.head_ref == 'master' || github.head_ref == 'dev' From 378d1d60f169a10d09435b603386188c6bf0151b Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 25 Oct 2024 15:22:35 +0200 Subject: [PATCH 25/28] fix: adjusting pipeline for prod as well --- .github/workflows/ci.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 858ea6c..1a8ac51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,6 +64,19 @@ jobs: git config --local user.email "15138480+creyD@users.noreply.github.com" git config --local user.name "creyD" + - name: set version format + id: version_format + run: | + if [[ ${{ github.head_ref }} == 'master' ]]; then + echo "version_format=${major}.${minor}.${patch}" >> $GITHUB_OUTPUT + else + echo "version_format=${major}.${minor}.${patch}rc${increment}" >> $GITHUB_OUTPUT + fi + + - name: print version format + run: | + echo "Version format: ${{ steps.version_format.outputs.version_format }}" + - name: Git Version uses: PaulHatch/semantic-version@v5.4.0 id: git_version @@ -72,7 +85,7 @@ jobs: major_pattern: "breaking:" minor_pattern: "feat:" enable_prerelease_mode: false - version_format: "${major}.${minor}.${patch}rc${increment}" + version_format: ${{ steps.version_format.outputs.version_format }} - name: Create & Push Tag if: github.head_ref == 'master' || github.head_ref == 'dev' From b7df0bfdcdaa824f70d11af7b6546d7b7506d971 Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 25 Oct 2024 15:27:50 +0200 Subject: [PATCH 26/28] fix: added escape for variable names --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a8ac51..33c4373 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,9 +68,9 @@ jobs: id: version_format run: | if [[ ${{ github.head_ref }} == 'master' ]]; then - echo "version_format=${major}.${minor}.${patch}" >> $GITHUB_OUTPUT + echo "version_format=\${major}.\${minor}.\${patch}" >> $GITHUB_OUTPUT else - echo "version_format=${major}.${minor}.${patch}rc${increment}" >> $GITHUB_OUTPUT + echo "version_format=\${major}.\${minor}.\${patch}rc\${increment}" >> $GITHUB_OUTPUT fi - name: print version format From 5a32a5908b517f924cc111e02204650ea9768c05 Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 25 Oct 2024 15:34:16 +0200 Subject: [PATCH 27/28] Removed debug statement --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33c4373..82223a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,10 +72,6 @@ jobs: else echo "version_format=\${major}.\${minor}.\${patch}rc\${increment}" >> $GITHUB_OUTPUT fi - - - name: print version format - run: | - echo "Version format: ${{ steps.version_format.outputs.version_format }}" - name: Git Version uses: PaulHatch/semantic-version@v5.4.0 From c5b2ab9932a1fca1f43a03249cffc71e16863754 Mon Sep 17 00:00:00 2001 From: vikynoah Date: Mon, 28 Oct 2024 15:37:14 +0100 Subject: [PATCH 28/28] fix: Add condition for total greater than zero (#7) --- creyPY/fastapi/pagination.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/creyPY/fastapi/pagination.py b/creyPY/fastapi/pagination.py index a74c477..2973e23 100644 --- a/creyPY/fastapi/pagination.py +++ b/creyPY/fastapi/pagination.py @@ -107,7 +107,7 @@ def paginate( count_query = create_count_query(query) total = connection.scalar(count_query) - if paginationFlag is False: + if paginationFlag is False and total > 0: params = Params(page=1, size=total) query = create_paginate_query(query, params)