Skip to content

Commit 2d5fa82

Browse files
authored
Merge branch 'goauthentik:main' into sdko/docs/style-guide-n-template/prepare-2025-2
2 parents 320eb2d + e9c944c commit 2d5fa82

File tree

9 files changed

+53
-9
lines changed

9 files changed

+53
-9
lines changed

.github/workflows/ci-main.yml

+25-6
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,26 @@ jobs:
4343
uses: ./.github/actions/setup
4444
- name: run migrations
4545
run: poetry run python -m lifecycle.migrate
46+
test-make-seed:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- id: seed
50+
run: |
51+
echo "seed=$(printf "%d\n" "0x$(openssl rand -hex 4)")" >> "$GITHUB_OUTPUT"
52+
outputs:
53+
seed: ${{ steps.seed.outputs.seed }}
4654
test-migrations-from-stable:
47-
name: test-migrations-from-stable - PostgreSQL ${{ matrix.psql }}
55+
name: test-migrations-from-stable - PostgreSQL ${{ matrix.psql }} - Run ${{ matrix.run_id }}/5
4856
runs-on: ubuntu-latest
57+
timeout-minutes: 20
58+
needs: test-make-seed
4959
strategy:
5060
fail-fast: false
5161
matrix:
5262
psql:
5363
- 15-alpine
5464
- 16-alpine
65+
run_id: [1, 2, 3, 4, 5]
5566
steps:
5667
- uses: actions/checkout@v4
5768
with:
@@ -93,28 +104,36 @@ jobs:
93104
env:
94105
# Test in the main database that we just migrated from the previous stable version
95106
AUTHENTIK_POSTGRESQL__TEST__NAME: authentik
107+
CI_TEST_SEED: ${{ needs.test-make-seed.outputs.seed }}
108+
CI_RUN_ID: ${{ matrix.run_id }}
109+
CI_TOTAL_RUNS: "5"
96110
run: |
97-
poetry run make test
111+
poetry run make ci-test
98112
test-unittest:
99-
name: test-unittest - PostgreSQL ${{ matrix.psql }}
113+
name: test-unittest - PostgreSQL ${{ matrix.psql }} - Run ${{ matrix.run_id }}/5
100114
runs-on: ubuntu-latest
101-
timeout-minutes: 30
115+
timeout-minutes: 20
116+
needs: test-make-seed
102117
strategy:
103118
fail-fast: false
104119
matrix:
105120
psql:
106121
- 15-alpine
107122
- 16-alpine
123+
run_id: [1, 2, 3, 4, 5]
108124
steps:
109125
- uses: actions/checkout@v4
110126
- name: Setup authentik env
111127
uses: ./.github/actions/setup
112128
with:
113129
postgresql_version: ${{ matrix.psql }}
114130
- name: run unittest
131+
env:
132+
CI_TEST_SEED: ${{ needs.test-make-seed.outputs.seed }}
133+
CI_RUN_ID: ${{ matrix.run_id }}
134+
CI_TOTAL_RUNS: "5"
115135
run: |
116-
poetry run make test
117-
poetry run coverage xml
136+
poetry run make ci-test
118137
- if: ${{ always() }}
119138
uses: codecov/codecov-action@v5
120139
with:

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,8 @@ ci-bandit: ci--meta-debug
284284

285285
ci-pending-migrations: ci--meta-debug
286286
ak makemigrations --check
287+
288+
ci-test: ci--meta-debug
289+
coverage run manage.py test --keepdb --randomly-seed ${CI_TEST_SEED} authentik
290+
coverage report
291+
coverage xml

authentik/root/test_plugin.py

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import math
12
from os import environ
23
from ssl import OPENSSL_VERSION
34

@@ -24,3 +25,20 @@ def pytest_report_header(*_, **__):
2425
f"authentik version: {get_full_version()}",
2526
f"OpenSSL version: {OPENSSL_VERSION}, FIPS: {backend._fips_enabled}",
2627
]
28+
29+
30+
def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item]) -> None:
31+
current_id = int(environ.get("CI_RUN_ID", 0)) - 1
32+
total_ids = int(environ.get("CI_TOTAL_RUNS", 0))
33+
34+
if total_ids:
35+
num_tests = len(items)
36+
matrix_size = math.ceil(num_tests / total_ids)
37+
38+
start = current_id * matrix_size
39+
end = (current_id + 1) * matrix_size
40+
41+
deselected_items = items[:start] + items[end:]
42+
config.hook.pytest_deselected(items=deselected_items)
43+
items[:] = items[start:end]
44+
print(f" Executing {start} - {end} tests")

authentik/stages/authenticator_webauthn/mds/blob.jwt

+1-1
Large diffs are not rendered by default.

locale/ko/LC_MESSAGES/django.mo

-5.87 KB
Binary file not shown.

locale/pl/LC_MESSAGES/django.mo

-2.46 KB
Binary file not shown.

locale/zh_TW/LC_MESSAGES/django.mo

3.81 KB
Binary file not shown.

web/src/user/user-settings/details/UserPassword.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AndNext } from "@goauthentik/common/api/config";
2+
import { globalAK } from "@goauthentik/common/global";
23
import { AKElement } from "@goauthentik/elements/Base";
34

45
import { msg } from "@lit/localize";
@@ -31,7 +32,7 @@ export class UserSettingsPassword extends AKElement {
3132
<div class="pf-c-card__body">
3233
<a
3334
href="${ifDefined(this.configureUrl)}${AndNext(
34-
`/if/user/#/settings;${JSON.stringify({ page: "page-details" })}`,
35+
`${globalAK().api.base}if/user/#/settings;${JSON.stringify({ page: "page-details" })}`,
3536
)}"
3637
class="pf-c-button pf-m-primary"
3738
>

web/src/user/user-settings/mfa/MFADevicesPage.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { AndNext, DEFAULT_CONFIG } from "@goauthentik/common/api/config";
22
import { SentryIgnoredError } from "@goauthentik/common/errors";
3+
import { globalAK } from "@goauthentik/common/global";
34
import { deviceTypeName } from "@goauthentik/common/labels";
45
import { getRelativeTime } from "@goauthentik/common/utils";
56
import "@goauthentik/elements/buttons/Dropdown";
@@ -73,7 +74,7 @@ export class MFADevicesPage extends Table<Device> {
7374
return html`<li>
7475
<a
7576
href="${ifDefined(stage.configureUrl)}${AndNext(
76-
`/if/user/#/settings;${JSON.stringify({
77+
`${globalAK().api.base}if/user/#/settings;${JSON.stringify({
7778
page: "page-mfa",
7879
})}`,
7980
)}"

0 commit comments

Comments
 (0)