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

core: fix migrations missing using db_alias #10409

Merged
merged 2 commits into from
Jul 8, 2024
Merged

Conversation

rissson
Copy link
Member

@rissson rissson commented Jul 8, 2024

Details

Closes #9866


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)

If applicable

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

@rissson rissson self-assigned this Jul 8, 2024
@rissson rissson requested a review from a team as a code owner July 8, 2024 16:26
Copy link

netlify bot commented Jul 8, 2024

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit dba17ee
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/668c1c93aaaa7d00081a083b

Copy link

netlify bot commented Jul 8, 2024

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit dba17ee
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/668c1c932b37280008460468

Copy link
Member

@BeryJu BeryJu left a comment

Choose a reason for hiding this comment

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

Should probably make the same change in 0029_provider_backchannel_applications_and_more.py

@rissson
Copy link
Member Author

rissson commented Jul 8, 2024

Should probably make the same change in 0029_provider_backchannel_applications_and_more.py

Yeah I'm reading all RunPython migrations to make sure we're .using(db_alias) everywhere

Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.62%. Comparing base (5c8a9ab) to head (dba17ee).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10409      +/-   ##
==========================================
+ Coverage   92.61%   92.62%   +0.01%     
==========================================
  Files         714      714              
  Lines       35012    35012              
==========================================
+ Hits        32425    32430       +5     
+ Misses       2587     2582       -5     
Flag Coverage Δ
e2e 49.60% <ø> (+0.01%) ⬆️
integration 25.37% <ø> (ø)
unit 90.12% <ø> (-0.01%) ⬇️

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

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

@rissson
Copy link
Member Author

rissson commented Jul 8, 2024

Further question, how a manytomany reverse relations handled? For instance should we use flow.policies.set([]) or flow.policies.using(db_alias).set([])?

Signed-off-by: Marc 'risson' Schmitt <[email protected]>
@rissson rissson force-pushed the migrations-fix-missing-using branch from 1b55594 to 151529a Compare July 8, 2024 16:40
@rissson rissson requested a review from BeryJu July 8, 2024 16:48
@rissson
Copy link
Member Author

rissson commented Jul 8, 2024

Also, there is an event migration that uses authentik.events.utils.get_user, which we might need to change to allow passing a db_alias in there.

This is actually fine.

Copy link
Contributor

github-actions bot commented Jul 8, 2024

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-ghcr.io/goauthentik/dev-server:gh-dba17ee6deaa15cd0b7d31ffa89ce86301277bec
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-ghcr.io/goauthentik/dev-server:gh-dba17ee6deaa15cd0b7d31ffa89ce86301277bec-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-ghcr.io/goauthentik/dev-server:gh-dba17ee6deaa15cd0b7d31ffa89ce86301277bec

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-ghcr.io/goauthentik/dev-server:gh-dba17ee6deaa15cd0b7d31ffa89ce86301277bec-arm64

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

Signed-off-by: Marc 'risson' Schmitt <[email protected]>
@BeryJu
Copy link
Member

BeryJu commented Jul 8, 2024

/cherry-pick version-2024.6

@rissson rissson changed the title outposts: fix migrations missing using db_alias core: fix migrations missing using db_alias Jul 8, 2024
@rissson rissson merged commit 9ca3ff9 into main Jul 8, 2024
70 checks passed
@rissson rissson deleted the migrations-fix-missing-using branch July 8, 2024 19:23
BeryJu pushed a commit that referenced this pull request Jul 9, 2024
)

core: fix migrations missing using db_alias (#10409)

Co-authored-by: Marc 'risson' Schmitt <[email protected]>
kensternberg-authentik added a commit that referenced this pull request Jul 10, 2024
* main:
  core: fix source flow_manager not resuming flow when linking (#10436)
  ci: fix PR comment k8s snippet (#10433)
  web/admin: fix access token list calling wrong API (#10434)
  providers/proxy: bump go-oidc to v3 (#10432)
  website: bump braces from 3.0.2 to 3.0.3 in /website (#10431)
  core: bump zipp from 3.18.1 to 3.19.1 (#10425)
  web: bump country-flag-icons from 1.5.12 to 1.5.13 in /web (#10427)
  core: bump google-api-python-client from 2.136.0 to 2.137.0 (#10428)
  core: bump django from 5.0.6 to 5.0.7 (#10420)
  web: bump rollup from 4.18.0 to 4.18.1 in /web/sfe (#10418)
  web: bump glob from 10.4.3 to 11.0.0 in /web (#10417)
  core: bump django-storages from 1.14.3 to 1.14.4 (#10412)
  core: bump scim2-filter-parser from 0.5.1 to 0.6.0 (#10413)
  core: bump sentry-sdk from 2.7.1 to 2.8.0 (#10414)
  web: bump the rollup group across 1 directory with 3 updates (#10416)
  core: fix migrations missing using db_alias (#10409)
  website/integrations: add offline_access scope to DokuWiki (#10208)
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.

ak server stuck in migration Applying authentik_core.0029_provider_backchannel_applications_and_more...
2 participants