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

feat(ext): add support for flag type and rollout definitions #1826

Merged
merged 17 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/testing/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ Use "flipt [command] --help" for more information about a command.
expectedFliptYAML = `flags:
- key: zUFtS7D0UyMeueYu
name: UAoZRksg94r1iipa
type: VARIANT_FLAG_TYPE
description: description
enabled: true
variants:
Expand All @@ -194,7 +195,6 @@ Use "flipt [command] --help" for more information about a command.
- key: sDGD6NvfCRyaQUn3
rules:
- segment: 08UoVJ96LhZblPEx
rank: 1
distributions:
- variant: NGxfcVffpMhBz9n8
rollout: 100
Expand Down
4 changes: 2 additions & 2 deletions build/testing/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func importExport(ctx context.Context, _ *dagger.Client, base, flipt *dagger.Con
if namespace == "" {
namespace = "default"
// replace namespace in expected yaml
expected = strings.ReplaceAll(expected, "version: \"1.0\"\n", fmt.Sprintf("version: \"1.0\"\nnamespace: %s\n", namespace))
expected = strings.ReplaceAll(expected, "version: \"1.1\"\n", fmt.Sprintf("version: \"1.1\"\nnamespace: %s\n", namespace))
}

// use target flipt binary to invoke import
Expand All @@ -272,7 +272,7 @@ func importExport(ctx context.Context, _ *dagger.Client, base, flipt *dagger.Con

diff := cmp.Diff(expected, generated)
if diff != "" {
fmt.Println("Unexpected difference in exported output:")
fmt.Printf("Unexpected difference in %q exported output: \n", conf.name)
fmt.Println(diff)
return errors.New("exported yaml did not match")
}
Expand Down
8 changes: 4 additions & 4 deletions build/testing/integration/readonly/readonly_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestReadOnly(t *testing.T) {
NamespaceKey: namespace,
})
require.NoError(t, err)
require.Len(t, flags.Flags, 51)
require.Len(t, flags.Flags, 52)

flag := flags.Flags[0]
assert.Equal(t, namespace, flag.NamespaceKey)
Expand All @@ -128,8 +128,8 @@ func TestReadOnly(t *testing.T) {
require.NoError(t, err)

if flags.NextPageToken == "" {
// ensure last page contains 1 entry
assert.Len(t, flags.Flags, 1)
// ensure last page contains 2 entries (boolean and disabled)
assert.Len(t, flags.Flags, 2)

found = append(found, flags.Flags...)

Expand All @@ -144,7 +144,7 @@ func TestReadOnly(t *testing.T) {
nextPage = flags.NextPageToken
}

require.Len(t, found, 51)
require.Len(t, found, 52)
})
})

Expand Down
Loading
Loading