chore!: Introduce ZITADEL v3 (#9645)

This PR summarizes multiple changes specifically only available with
ZITADEL v3:

- feat: Web Keys management
(https://github.com/zitadel/zitadel/pull/9526)
- fix(cmd): ensure proper working of mirror
(https://github.com/zitadel/zitadel/pull/9509)
- feat(Authz): system user support for permission check v2
(https://github.com/zitadel/zitadel/pull/9640)
- chore(license): change from Apache to AGPL
(https://github.com/zitadel/zitadel/pull/9597)
- feat(console): list v2 sessions
(https://github.com/zitadel/zitadel/pull/9539)
- fix(console): add loginV2 feature flag
(https://github.com/zitadel/zitadel/pull/9682)
- fix(feature flags): allow reading "own" flags
(https://github.com/zitadel/zitadel/pull/9649)
- feat(console): add Actions V2 UI
(https://github.com/zitadel/zitadel/pull/9591)

BREAKING CHANGE
- feat(webkey): migrate to v2beta API
(https://github.com/zitadel/zitadel/pull/9445)
- chore!: remove CockroachDB Support
(https://github.com/zitadel/zitadel/pull/9444)
- feat(actions): migrate to v2beta API
(https://github.com/zitadel/zitadel/pull/9489)

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
Co-authored-by: Stefan Benz <46600784+stebenz@users.noreply.github.com>
Co-authored-by: Silvan <27845747+adlerhurst@users.noreply.github.com>
Co-authored-by: Ramon <mail@conblem.me>
Co-authored-by: Elio Bischof <elio@zitadel.com>
Co-authored-by: Kenta Yamaguchi <56732734+KEY60228@users.noreply.github.com>
Co-authored-by: Harsha Reddy <harsha.reddy@klaviyo.com>
Co-authored-by: Livio Spring <livio@zitadel.com>
Co-authored-by: Max Peintner <max@caos.ch>
Co-authored-by: Iraq <66622793+kkrime@users.noreply.github.com>
Co-authored-by: Florian Forster <florian@zitadel.com>
Co-authored-by: Tim Möhlmann <tim+github@zitadel.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Max Peintner <peintnerm@gmail.com>
This commit is contained in:
Fabienne Bühler
2025-04-02 16:53:06 +02:00
committed by GitHub
parent d14a23ae7e
commit 07ce3b6905
559 changed files with 14578 additions and 7622 deletions

View File

@@ -2,7 +2,6 @@ package command
import (
"context"
"fmt"
"io"
"os"
"testing"
@@ -14,7 +13,6 @@ import (
"github.com/zitadel/zitadel/internal/eventstore"
"github.com/zitadel/zitadel/internal/i18n"
"github.com/zitadel/zitadel/internal/repository/permission"
"github.com/zitadel/zitadel/internal/repository/user"
)
@@ -31,93 +29,6 @@ func TestMain(m *testing.M) {
os.Exit(m.Run())
}
func TestCommands_pushChunked(t *testing.T) {
aggregate := permission.NewAggregate("instanceID")
cmds := make([]eventstore.Command, 100)
for i := 0; i < 100; i++ {
cmds[i] = permission.NewAddedEvent(context.Background(), aggregate, "role", fmt.Sprintf("permission%d", i))
}
type args struct {
size uint16
}
tests := []struct {
name string
args args
eventstore func(*testing.T) *eventstore.Eventstore
wantEvents int
wantErr error
}{
{
name: "push error",
args: args{
size: 100,
},
eventstore: expectEventstore(
expectPushFailed(io.ErrClosedPipe, cmds...),
),
wantEvents: 0,
wantErr: io.ErrClosedPipe,
},
{
name: "single chunk",
args: args{
size: 100,
},
eventstore: expectEventstore(
expectPush(cmds...),
),
wantEvents: len(cmds),
},
{
name: "aligned chunks",
args: args{
size: 50,
},
eventstore: expectEventstore(
expectPush(cmds[0:50]...),
expectPush(cmds[50:100]...),
),
wantEvents: len(cmds),
},
{
name: "odd chunks",
args: args{
size: 30,
},
eventstore: expectEventstore(
expectPush(cmds[0:30]...),
expectPush(cmds[30:60]...),
expectPush(cmds[60:90]...),
expectPush(cmds[90:100]...),
),
wantEvents: len(cmds),
},
{
name: "partial error",
args: args{
size: 30,
},
eventstore: expectEventstore(
expectPush(cmds[0:30]...),
expectPush(cmds[30:60]...),
expectPushFailed(io.ErrClosedPipe, cmds[60:90]...),
),
wantEvents: len(cmds[0:60]),
wantErr: io.ErrClosedPipe,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &Commands{
eventstore: tt.eventstore(t),
}
gotEvents, err := c.pushChunked(context.Background(), tt.args.size, cmds...)
require.ErrorIs(t, err, tt.wantErr)
assert.Len(t, gotEvents, tt.wantEvents)
})
}
}
func TestCommands_asyncPush(t *testing.T) {
// make sure the test terminates on deadlock
background := context.Background()