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

api: optimise pagination in API schema #6478

Merged
merged 2 commits into from
Aug 5, 2023
Merged

Conversation

BeryJu
Copy link
Member

@BeryJu BeryJu commented Aug 5, 2023

Details

Instead of having the schema of the pagination in each response component, have the pagination object once and reference it


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)
  • The translation files have been updated (make i18n-extract)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

@BeryJu BeryJu marked this pull request as ready for review August 5, 2023 12:16
@BeryJu BeryJu requested a review from a team as a code owner August 5, 2023 12:16
@BeryJu BeryJu requested review from rissson and removed request for a team August 5, 2023 12:16
@netlify
Copy link

netlify bot commented Aug 5, 2023

Deploy Preview for authentik-storybook failed.

Name Link
🔨 Latest commit 747cb90
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/64ce3e5d14508400085f3638

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu BeryJu force-pushed the api/optimise-pagination branch from 9b38610 to 31a0cdd Compare August 5, 2023 12:17
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@codecov
Copy link

codecov bot commented Aug 5, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (efc6609) 92.47% compared to head (747cb90) 92.46%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6478      +/-   ##
==========================================
- Coverage   92.47%   92.46%   -0.01%     
==========================================
  Files         561      561              
  Lines       27075    27080       +5     
==========================================
  Hits        25036    25036              
- Misses       2039     2044       +5     
Flag Coverage Δ
e2e 51.67% <16.67%> (+0.06%) ⬆️
integration 26.56% <16.67%> (+0.01%) ⬆️
unit 89.27% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
authentik/api/pagination.py 88.24% <100.00%> (+1.57%) ⬆️
authentik/api/schema.py 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2023

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-api-optimise-pagination-1691241673-31a0cdd
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

For arm64, use these values:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-api-optimise-pagination-1691241673-31a0cdd-arm64
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
    repository: ghcr.io/goauthentik/dev-server
    tag: gh-api-optimise-pagination-1691241673-31a0cdd

For arm64, use these values:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
    repository: ghcr.io/goauthentik/dev-server
    tag: gh-api-optimise-pagination-1691241673-31a0cdd-arm64

Afterwards, run the upgrade commands from the latest release notes.

"end_index",
],
},
"pagination": {"$ref": f"#/components/schemas/{PAGINATION_COMPONENT_NAME}"},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this wouldn't be hardcoded and we directly get the reference from the created component, but that's a bit of a challenge with the imports

@BeryJu BeryJu merged commit 00fae23 into main Aug 5, 2023
@BeryJu BeryJu deleted the api/optimise-pagination branch August 5, 2023 13:37
BeryJu added a commit that referenced this pull request Aug 7, 2023
kensternberg-authentik added a commit that referenced this pull request Aug 7, 2023
* main:
  web/flows: fix identification stage band color (#6489)
  providers/proxy: only intercept auth header when a value is set (#6488)
  web: bump @goauthentik/api from 2023.6.1-1691242648 to 2023.6.1-1691266058 in /web (#6486)
  providers/proxy: set outpost session cookie to httponly and secure wh… (#6482)
  web: bump @esbuild/linux-arm64 from 0.18.17 to 0.18.18 in /web (#6483)
  web/admin: fix user sorting by active field (#6485)
  web: bump @esbuild/darwin-arm64 from 0.18.17 to 0.18.18 in /web (#6484)
  web: bump storybook (#6481)
  web: bump the sentry group in /web with 2 updates (#6480)
  web: bump API Client version (#6479)
  api: optimise pagination in API schema (#6478)
  website/dev-docs: tweaks to template (#6474)
  website: bump react-tooltip from 5.19.0 to 5.20.0 in /website (#6471)
  website: bump prettier from 3.0.0 to 3.0.1 in /website (#6472)
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.

1 participant