From ca2d447ba76154ebf94e35770c2f121148cd3d38 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Thu, 1 Aug 2024 16:14:41 -0400 Subject: [PATCH] chore: rm screenshot pipeline Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com> --- build/generate/screenshots.go | 134 ------------------ build/main.go | 21 --- dagger.json | 12 +- go.work.sum | 4 + ui/screenshot.js | 63 -------- ui/screenshot/concepts/constraints.js | 9 -- ui/screenshot/concepts/constraints_types.js | 12 -- ui/screenshot/concepts/distributions.js | 9 -- ui/screenshot/concepts/evaluation.js | 13 -- .../concepts/fixtures/constraints.yml | 9 -- .../concepts/fixtures/constraints_types.yml | 5 - .../concepts/fixtures/distributions.yml | 25 ---- .../concepts/fixtures/evaluation.yml | 25 ---- ui/screenshot/concepts/fixtures/flags.yml | 12 -- .../concepts/fixtures/namespaces_default.yml | 5 - .../fixtures/namespaces_production.yml | 1 - ui/screenshot/concepts/fixtures/rollouts.yml | 11 -- ui/screenshot/concepts/fixtures/rules.yml | 19 --- ui/screenshot/concepts/fixtures/segments.yml | 5 - ui/screenshot/concepts/fixtures/variants.yml | 17 --- ui/screenshot/concepts/flags.js | 5 - ui/screenshot/concepts/flags_boolean.js | 10 -- ui/screenshot/concepts/namespaces_default.js | 5 - .../concepts/namespaces_production.js | 8 -- ui/screenshot/concepts/rollouts.js | 8 -- ui/screenshot/concepts/rules.js | 9 -- ui/screenshot/concepts/segments.js | 7 - ui/screenshot/concepts/settings_namespaces.js | 14 -- ui/screenshot/concepts/settings_tokens.js | 11 -- ui/screenshot/concepts/variants.js | 8 -- ui/screenshot/extra/fixtures/darkmode.yml | 25 ---- ui/screenshot/extra/fixtures/readonly.yml | 25 ---- ui/screenshot/extra/readonly.js | 16 --- .../getting_started/create_constraint.js | 16 --- ui/screenshot/getting_started/create_flag.js | 12 -- ui/screenshot/getting_started/create_rule.js | 12 -- .../getting_started/create_segment.js | 10 -- .../getting_started/create_variant.js | 16 --- .../getting_started/evaluation_console.js | 10 -- .../fixtures/create_constraint.yml | 4 - .../getting_started/fixtures/create_rule.yml | 11 -- .../fixtures/create_variant.yml | 5 - .../fixtures/evaluation_console.yml | 20 --- 43 files changed, 6 insertions(+), 672 deletions(-) delete mode 100644 build/generate/screenshots.go delete mode 100644 ui/screenshot.js delete mode 100644 ui/screenshot/concepts/constraints.js delete mode 100644 ui/screenshot/concepts/constraints_types.js delete mode 100644 ui/screenshot/concepts/distributions.js delete mode 100644 ui/screenshot/concepts/evaluation.js delete mode 100644 ui/screenshot/concepts/fixtures/constraints.yml delete mode 100644 ui/screenshot/concepts/fixtures/constraints_types.yml delete mode 100644 ui/screenshot/concepts/fixtures/distributions.yml delete mode 100644 ui/screenshot/concepts/fixtures/evaluation.yml delete mode 100644 ui/screenshot/concepts/fixtures/flags.yml delete mode 100644 ui/screenshot/concepts/fixtures/namespaces_default.yml delete mode 100644 ui/screenshot/concepts/fixtures/namespaces_production.yml delete mode 100644 ui/screenshot/concepts/fixtures/rollouts.yml delete mode 100644 ui/screenshot/concepts/fixtures/rules.yml delete mode 100644 ui/screenshot/concepts/fixtures/segments.yml delete mode 100644 ui/screenshot/concepts/fixtures/variants.yml delete mode 100644 ui/screenshot/concepts/flags.js delete mode 100644 ui/screenshot/concepts/flags_boolean.js delete mode 100644 ui/screenshot/concepts/namespaces_default.js delete mode 100644 ui/screenshot/concepts/namespaces_production.js delete mode 100644 ui/screenshot/concepts/rollouts.js delete mode 100644 ui/screenshot/concepts/rules.js delete mode 100644 ui/screenshot/concepts/segments.js delete mode 100644 ui/screenshot/concepts/settings_namespaces.js delete mode 100644 ui/screenshot/concepts/settings_tokens.js delete mode 100644 ui/screenshot/concepts/variants.js delete mode 100644 ui/screenshot/extra/fixtures/darkmode.yml delete mode 100644 ui/screenshot/extra/fixtures/readonly.yml delete mode 100644 ui/screenshot/extra/readonly.js delete mode 100644 ui/screenshot/getting_started/create_constraint.js delete mode 100644 ui/screenshot/getting_started/create_flag.js delete mode 100644 ui/screenshot/getting_started/create_rule.js delete mode 100644 ui/screenshot/getting_started/create_segment.js delete mode 100644 ui/screenshot/getting_started/create_variant.js delete mode 100644 ui/screenshot/getting_started/evaluation_console.js delete mode 100644 ui/screenshot/getting_started/fixtures/create_constraint.yml delete mode 100644 ui/screenshot/getting_started/fixtures/create_rule.yml delete mode 100644 ui/screenshot/getting_started/fixtures/create_variant.yml delete mode 100644 ui/screenshot/getting_started/fixtures/evaluation_console.yml diff --git a/build/generate/screenshots.go b/build/generate/screenshots.go deleted file mode 100644 index 600f32fec1..0000000000 --- a/build/generate/screenshots.go +++ /dev/null @@ -1,134 +0,0 @@ -package generate - -import ( - "context" - "log" - "os" - "path" - "time" - - "go.flipt.io/build/internal/dagger" - "golang.org/x/sync/errgroup" -) - -func Screenshots(ctx context.Context, client *dagger.Client, source *dagger.Directory, flipt *dagger.Container) error { - if err := os.RemoveAll("./tmp/screenshots"); err != nil { - return err - } - - src := client.Directory().WithFiles("ui", []*dagger.File{ - source.File("ui/package.json"), - source.File("ui/package-lock.json"), - source.File("ui/playwright.config.ts"), - }).WithDirectory("ui/screenshot", source.Directory("ui/screenshot")) - - cache := client.CacheVolume("node-modules-screenshot") - - ui, err := client.Container().From("node:18-bullseye"). - WithMountedDirectory("/src", src).WithWorkdir("/src"). - WithMountedCache("/src/node_modules", cache). - WithExec([]string{"npm", "install"}). - WithExec([]string{"npx", "playwright", "install", "chromium", "--with-deps"}). - Sync(ctx) - if err != nil { - return err - } - - src = source.Directory("./ui/"). - WithoutDirectory("./dist/"). - WithoutDirectory("./node_modules/") - - // remount entire directory with module cache - ui, err = ui.WithMountedDirectory("/src", src). - WithMountedCache("/src/node_modules", cache). - WithExec([]string{"npm", "install"}). - Sync(ctx) - if err != nil { - return err - } - - dirs := []string{ - "getting_started", "concepts", "configuration", "extra", - } - - for _, dir := range dirs { - var ( - g errgroup.Group - containers = make(chan *dagger.Container) - dir = dir - ) - - entries, err := ui.Directory("screenshot/" + dir).Entries(ctx) - if err != nil { - // skip if directory does not exist - continue - } - - go func() { - _ = g.Wait() - close(containers) - }() - - for _, theme := range []string{"", "dark"} { - theme := theme - for _, entry := range entries { - entry := entry - g.Go(func() error { - test, err := buildUI(ctx, ui, flipt, theme) - if err != nil { - return err - } - - if ext := path.Ext(entry); ext != ".js" { - return nil - } - - c, err := test.WithExec([]string{"node", path.Join("screenshot", dir, entry)}).Sync(ctx) - if err != nil { - return err - } - - containers <- c - log.Printf("Generating screenshot for %s %s/%s\n", theme, dir, entry) - - return err - }) - } - } - - for c := range containers { - if _, err := c.Directory("screenshots"). - Export(ctx, "./tmp/screenshots"); err != nil { - return err - } - } - } - - return err -} - -func buildUI(ctx context.Context, ui, flipt *dagger.Container, theme string) (_ *dagger.Container, err error) { - flipt, err = flipt.Sync(ctx) - if err != nil { - return nil, err - } - - ui, err = ui.Sync(ctx) - if err != nil { - return nil, err - } - - flipt = flipt. - WithEnvVariable("CI", os.Getenv("CI")). - WithEnvVariable("FLIPT_AUTHENTICATION_METHODS_TOKEN_ENABLED", "true"). - WithEnvVariable("UNIQUE", time.Now().String()). - WithExposedPort(8080) - - if theme != "" { - flipt = flipt.WithEnvVariable("FLIPT_UI_DEFAULT_THEME", theme) - } - - return ui. - WithServiceBinding("flipt", flipt.WithExec(nil).AsService()).WithFile("/usr/bin/flipt", flipt.File("/flipt")). - WithEnvVariable("FLIPT_ADDRESS", "http://flipt:8080"), nil -} diff --git a/build/main.go b/build/main.go index 16fdb15804..694e13d307 100644 --- a/build/main.go +++ b/build/main.go @@ -20,7 +20,6 @@ import ( "strings" "github.com/containerd/containerd/platforms" - "go.flipt.io/build/generate" "go.flipt.io/build/internal" "go.flipt.io/build/internal/dagger" "go.flipt.io/build/testing" @@ -131,23 +130,3 @@ func (t *Test) Integration( return testing.Integration(ctx, dag, t.BaseContainer, t.FliptContainer, opts...) } - -type Generate struct { - Source *dagger.Directory - FliptContainer *dagger.Container -} - -// Execute generate function with subcommand -// see all available subcommands with dagger call generate --help -func (f *Flipt) Generate(ctx context.Context, source *dagger.Directory) (*Generate, error) { - flipt, err := f.Build(ctx, source) - if err != nil { - return nil, err - } - - return &Generate{source, flipt}, nil -} - -func (g *Generate) Screenshots(ctx context.Context) error { - return generate.Screenshots(ctx, dag, g.Source, g.FliptContainer) -} diff --git a/dagger.json b/dagger.json index 04f65af150..a09b1138b3 100644 --- a/dagger.json +++ b/dagger.json @@ -1,21 +1,13 @@ { "name": "flipt", "sdk": "go", - "exclude": [ - ".git", - "bin", - "screenshots", - "ui/node_modules" - ], + "exclude": [".git", "bin", "ui/node_modules"], "source": "build", "engineVersion": "v0.12.3", "views": [ { "name": "default", - "patterns": [ - "!.git", - "!**/node_modules" - ] + "patterns": ["!.git", "!**/node_modules"] } ] } diff --git a/go.work.sum b/go.work.sum index f911fd72ce..5f0a8044c4 100644 --- a/go.work.sum +++ b/go.work.sum @@ -658,6 +658,7 @@ github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9 github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= github.com/google/go-containerregistry v0.17.0/go.mod h1:u0qB2l7mvtWVR5kNcbFIhFY1hLbf8eeGapA+vbFDCtQ= @@ -888,10 +889,12 @@ github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2J github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78= github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= +github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= +github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= @@ -1410,6 +1413,7 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/ui/screenshot.js b/ui/screenshot.js deleted file mode 100644 index 38d1572a0b..0000000000 --- a/ui/screenshot.js +++ /dev/null @@ -1,63 +0,0 @@ -import { exec } from 'child_process'; -import { existsSync } from 'fs'; -import { chromium } from 'playwright'; - -const fliptAddr = process.env.FLIPT_ADDRESS ?? 'http://localhost:8080'; - -const screenshot = async (page, name) => { - await page.screenshot({ path: 'screenshots/' + name }); -}; - -const scrollToBottom = async (page) => { - await sleep(1000); - await page.evaluate(() => { - window.scrollTo(0, document.body.scrollHeight); - }); -}; - -const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay)); - -const capture = async function (folder, name, fn, opts = {}) { - try { - const path = `${__dirname}/screenshot/${folder}/fixtures/${name}.yml`; - if (existsSync(path)) { - exec( - `flipt import --address=${fliptAddr} ${path}`, - (error, stdout, stderr) => { - if (error) { - console.error(`error: ${error.message}`); - return; - } - - if (stderr) { - console.error(`stderr: ${stderr}`); - return; - } - - console.log(`stdout:\n${stdout}`); - } - ); - } - } catch (err) { - // ignore and we will just skip seeding - console.debug(err); - } - - const browser = await chromium.launch({ headless: true }); - const context = await browser.newContext({ - viewport: { width: 1440, height: 900 }, - deviceScaleFactor: 3 - }); - const page = await context.newPage(); - - await page.goto(fliptAddr); - await fn(page); - await sleep(5000); - let random = Math.floor(Math.random() * 100000); - await screenshot(page, `${folder}/${name}${random}.png`); - - await context.close(); - await browser.close(); -}; - -export default { capture, sleep, screenshot, scrollToBottom }; diff --git a/ui/screenshot/concepts/constraints.js b/ui/screenshot/concepts/constraints.js deleted file mode 100644 index 2570030993..0000000000 --- a/ui/screenshot/concepts/constraints.js +++ /dev/null @@ -1,9 +0,0 @@ -import { capture, scrollToBottom } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'constraints', async (page) => { - await page.getByRole('link', { name: 'Segments' }).click(); - await page.getByRole('link', { name: 'new-users' }).click(); - await scrollToBottom(page); - }); -})(); diff --git a/ui/screenshot/concepts/constraints_types.js b/ui/screenshot/concepts/constraints_types.js deleted file mode 100644 index f4002bbbe1..0000000000 --- a/ui/screenshot/concepts/constraints_types.js +++ /dev/null @@ -1,12 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'constraints_types', async (page) => { - await page.getByRole('link', { name: 'Segments' }).click(); - await page.getByRole('link', { name: 'lunch-party' }).click(); - await page.getByRole('button', { name: 'New Constraint' }).click(); - await page.getByLabel('Property').fill('sale_date'); - await page.getByLabel('Type').selectOption('DATETIME_COMPARISON_TYPE'); - await page.getByLabel('Operator').selectOption('gt'); - }); -})(); diff --git a/ui/screenshot/concepts/distributions.js b/ui/screenshot/concepts/distributions.js deleted file mode 100644 index c6c44b6998..0000000000 --- a/ui/screenshot/concepts/distributions.js +++ /dev/null @@ -1,9 +0,0 @@ -import { capture, scrollToBottom } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'distributions', async (page) => { - await page.getByRole('link', { name: 'colorscheme' }).click(); - await page.getByRole('link', { name: 'Rules' }).click(); - await scrollToBottom(page); - }); -})(); diff --git a/ui/screenshot/concepts/evaluation.js b/ui/screenshot/concepts/evaluation.js deleted file mode 100644 index f64231c421..0000000000 --- a/ui/screenshot/concepts/evaluation.js +++ /dev/null @@ -1,13 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'evaluation', async (page) => { - await page.getByRole('link', { name: 'Console' }).click(); - await page.locator('#flagKey-select-button').click(); - await page - .getByRole('option', { name: 'colorscheme Color Scheme' }) - .click(); - await page.getByText('{}').type('{\n\t"finished_onboarding":"false"\n}'); - await page.getByRole('button', { name: 'Evaluate', exact: true }).click(); - }); -})(); diff --git a/ui/screenshot/concepts/fixtures/constraints.yml b/ui/screenshot/concepts/fixtures/constraints.yml deleted file mode 100644 index 257ecaca7b..0000000000 --- a/ui/screenshot/concepts/fixtures/constraints.yml +++ /dev/null @@ -1,9 +0,0 @@ -namespace: default -segments: - - key: new-users - name: New Users - description: Users who haven't finished onboarding - constraints: - - property: finished_onboarding - type: BOOLEAN_COMPARISON_TYPE - operator: false diff --git a/ui/screenshot/concepts/fixtures/constraints_types.yml b/ui/screenshot/concepts/fixtures/constraints_types.yml deleted file mode 100644 index 7438bdd6ac..0000000000 --- a/ui/screenshot/concepts/fixtures/constraints_types.yml +++ /dev/null @@ -1,5 +0,0 @@ -namespace: default -segments: - - key: lunch-party - name: Lunch Party - description: Lunch party? It should be launch party! diff --git a/ui/screenshot/concepts/fixtures/distributions.yml b/ui/screenshot/concepts/fixtures/distributions.yml deleted file mode 100644 index 560846d478..0000000000 --- a/ui/screenshot/concepts/fixtures/distributions.yml +++ /dev/null @@ -1,25 +0,0 @@ -namespace: default -flags: - - key: colorscheme - name: Color Scheme - description: The color scheme for the site - type: VARIANT_FLAG_TYPE - enabled: true - variants: - - key: dark - - key: light - - key: auto - rules: - - segment: new-users - rank: 1 - distributions: - - variant: dark - rollout: 10 - - variant: light - rollout: 30 - - variant: auto - rollout: 60 -segments: - - key: new-users - name: New Users - match_type: ALL_MATCH_TYPE diff --git a/ui/screenshot/concepts/fixtures/evaluation.yml b/ui/screenshot/concepts/fixtures/evaluation.yml deleted file mode 100644 index 560846d478..0000000000 --- a/ui/screenshot/concepts/fixtures/evaluation.yml +++ /dev/null @@ -1,25 +0,0 @@ -namespace: default -flags: - - key: colorscheme - name: Color Scheme - description: The color scheme for the site - type: VARIANT_FLAG_TYPE - enabled: true - variants: - - key: dark - - key: light - - key: auto - rules: - - segment: new-users - rank: 1 - distributions: - - variant: dark - rollout: 10 - - variant: light - rollout: 30 - - variant: auto - rollout: 60 -segments: - - key: new-users - name: New Users - match_type: ALL_MATCH_TYPE diff --git a/ui/screenshot/concepts/fixtures/flags.yml b/ui/screenshot/concepts/fixtures/flags.yml deleted file mode 100644 index 7a1654242d..0000000000 --- a/ui/screenshot/concepts/fixtures/flags.yml +++ /dev/null @@ -1,12 +0,0 @@ -namespace: default -flags: - - key: new-contact-page - name: New Contact Page - description: Show users the new contact page - type: BOOLEAN_FLAG_TYPE - enabled: true - - key: colorscheme - name: Color Scheme - description: The color scheme for the site - type: VARIANT_FLAG_TYPE - enabled: true diff --git a/ui/screenshot/concepts/fixtures/namespaces_default.yml b/ui/screenshot/concepts/fixtures/namespaces_default.yml deleted file mode 100644 index dee583c877..0000000000 --- a/ui/screenshot/concepts/fixtures/namespaces_default.yml +++ /dev/null @@ -1,5 +0,0 @@ -namespace: default -flags: - - key: new-login - name: New Login - description: Enables the new login page for users diff --git a/ui/screenshot/concepts/fixtures/namespaces_production.yml b/ui/screenshot/concepts/fixtures/namespaces_production.yml deleted file mode 100644 index 600bcc0406..0000000000 --- a/ui/screenshot/concepts/fixtures/namespaces_production.yml +++ /dev/null @@ -1 +0,0 @@ -namespace: production diff --git a/ui/screenshot/concepts/fixtures/rollouts.yml b/ui/screenshot/concepts/fixtures/rollouts.yml deleted file mode 100644 index 2472954815..0000000000 --- a/ui/screenshot/concepts/fixtures/rollouts.yml +++ /dev/null @@ -1,11 +0,0 @@ -namespace: default -flags: - - key: new-contact-page - name: New Contact Page - description: Show users the new contact page - type: BOOLEAN_FLAG_TYPE - enabled: true - rollouts: - - threshold: - percentage: 50 - value: true diff --git a/ui/screenshot/concepts/fixtures/rules.yml b/ui/screenshot/concepts/fixtures/rules.yml deleted file mode 100644 index 4809b5574f..0000000000 --- a/ui/screenshot/concepts/fixtures/rules.yml +++ /dev/null @@ -1,19 +0,0 @@ -namespace: default -flags: - - key: colorscheme - name: Color Scheme - description: The color scheme for the site - type: VARIANT_FLAG_TYPE - enabled: true - variants: - - key: dark - rules: - - segment: new-users - rank: 1 - distributions: - - variant: dark - rollout: 100 -segments: - - key: new-users - name: New Users - match_type: ALL_MATCH_TYPE diff --git a/ui/screenshot/concepts/fixtures/segments.yml b/ui/screenshot/concepts/fixtures/segments.yml deleted file mode 100644 index 6f01485eaa..0000000000 --- a/ui/screenshot/concepts/fixtures/segments.yml +++ /dev/null @@ -1,5 +0,0 @@ -namespace: default -segments: - - key: new-users - name: New Users - description: Users who haven't finished onboarding diff --git a/ui/screenshot/concepts/fixtures/variants.yml b/ui/screenshot/concepts/fixtures/variants.yml deleted file mode 100644 index 173c0c9d13..0000000000 --- a/ui/screenshot/concepts/fixtures/variants.yml +++ /dev/null @@ -1,17 +0,0 @@ -namespace: default -flags: - - key: colorscheme - name: Color Scheme - description: The color scheme for the site - type: VARIANT_FLAG_TYPE - enabled: true - variants: - - key: dark - name: Dark - description: A dark color scheme - - key: light - name: Light - description: A light color scheme - - key: auto - name: Auto - description: A color scheme based on the user's preferences diff --git a/ui/screenshot/concepts/flags.js b/ui/screenshot/concepts/flags.js deleted file mode 100644 index 31ab8320ea..0000000000 --- a/ui/screenshot/concepts/flags.js +++ /dev/null @@ -1,5 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'flags', async (page) => {}); -})(); diff --git a/ui/screenshot/concepts/flags_boolean.js b/ui/screenshot/concepts/flags_boolean.js deleted file mode 100644 index 31ce6b63bb..0000000000 --- a/ui/screenshot/concepts/flags_boolean.js +++ /dev/null @@ -1,10 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'flags_boolean', async (page) => { - await page.getByRole('button', { name: 'New Flag' }).click(); - await page.getByLabel('Name').fill('New Contact Page'); - await page.getByLabel('Boolean').check(); - await page.getByRole('button', { name: 'Create' }).click(); - }); -})(); diff --git a/ui/screenshot/concepts/namespaces_default.js b/ui/screenshot/concepts/namespaces_default.js deleted file mode 100644 index 8a489b4c1b..0000000000 --- a/ui/screenshot/concepts/namespaces_default.js +++ /dev/null @@ -1,5 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'namespaces_default', async (page) => {}); -})(); diff --git a/ui/screenshot/concepts/namespaces_production.js b/ui/screenshot/concepts/namespaces_production.js deleted file mode 100644 index e26469e242..0000000000 --- a/ui/screenshot/concepts/namespaces_production.js +++ /dev/null @@ -1,8 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'namespaces_production', async (page) => { - await page.getByRole('button', { name: 'Default' }).click(); - await page.getByText('production').click(); - }); -})(); diff --git a/ui/screenshot/concepts/rollouts.js b/ui/screenshot/concepts/rollouts.js deleted file mode 100644 index a73827dd25..0000000000 --- a/ui/screenshot/concepts/rollouts.js +++ /dev/null @@ -1,8 +0,0 @@ -import { capture, scrollToBottom } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'rollouts', async (page) => { - await page.getByRole('link', { name: 'new-contact-page' }).click(); - await scrollToBottom(page); - }); -})(); diff --git a/ui/screenshot/concepts/rules.js b/ui/screenshot/concepts/rules.js deleted file mode 100644 index 72984ef208..0000000000 --- a/ui/screenshot/concepts/rules.js +++ /dev/null @@ -1,9 +0,0 @@ -import { capture, scrollToBottom } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'rules', async (page) => { - await page.getByRole('link', { name: 'colorscheme' }).click(); - await page.getByRole('link', { name: 'Rules' }).click(); - await scrollToBottom(page); - }); -})(); diff --git a/ui/screenshot/concepts/segments.js b/ui/screenshot/concepts/segments.js deleted file mode 100644 index 15150661ea..0000000000 --- a/ui/screenshot/concepts/segments.js +++ /dev/null @@ -1,7 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'segments', async (page) => { - await page.getByRole('link', { name: 'Segments' }).click(); - }); -})(); diff --git a/ui/screenshot/concepts/settings_namespaces.js b/ui/screenshot/concepts/settings_namespaces.js deleted file mode 100644 index d76fd4eb86..0000000000 --- a/ui/screenshot/concepts/settings_namespaces.js +++ /dev/null @@ -1,14 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'settings_namespaces', async (page) => { - await page.getByRole('link', { name: 'Settings' }).click(); - await page.getByRole('link', { name: 'Namespaces' }).click(); - await page.getByRole('button', { name: 'New Namespace' }).click(); - await page.getByLabel('Name', { exact: true }).fill('Production'); - await page.getByLabel('Description').fill('Production Environment'); - await page.getByRole('button', { name: 'Create' }).click(); - await page.getByRole('link', { name: 'Settings' }).click(); - await page.getByRole('link', { name: 'Namespaces' }).click(); - }); -})(); diff --git a/ui/screenshot/concepts/settings_tokens.js b/ui/screenshot/concepts/settings_tokens.js deleted file mode 100644 index c5db235326..0000000000 --- a/ui/screenshot/concepts/settings_tokens.js +++ /dev/null @@ -1,11 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'settings_tokens', async (page) => { - await page.getByRole('link', { name: 'Settings' }).click(); - await page.getByRole('link', { name: 'API Tokens' }).click(); - await page.getByRole('button', { name: 'New Token' }).click(); - await page.getByLabel('Name', { exact: true }).fill('Production'); - await page.getByLabel('Description').fill('Production API Token'); - }); -})(); diff --git a/ui/screenshot/concepts/variants.js b/ui/screenshot/concepts/variants.js deleted file mode 100644 index 70e723c917..0000000000 --- a/ui/screenshot/concepts/variants.js +++ /dev/null @@ -1,8 +0,0 @@ -import { capture, scrollToBottom } from '../../screenshot.js'; - -(async () => { - await capture('concepts', 'variants', async (page) => { - await page.getByRole('link', { name: 'colorscheme' }).click(); - await scrollToBottom(page); - }); -})(); diff --git a/ui/screenshot/extra/fixtures/darkmode.yml b/ui/screenshot/extra/fixtures/darkmode.yml deleted file mode 100644 index 560846d478..0000000000 --- a/ui/screenshot/extra/fixtures/darkmode.yml +++ /dev/null @@ -1,25 +0,0 @@ -namespace: default -flags: - - key: colorscheme - name: Color Scheme - description: The color scheme for the site - type: VARIANT_FLAG_TYPE - enabled: true - variants: - - key: dark - - key: light - - key: auto - rules: - - segment: new-users - rank: 1 - distributions: - - variant: dark - rollout: 10 - - variant: light - rollout: 30 - - variant: auto - rollout: 60 -segments: - - key: new-users - name: New Users - match_type: ALL_MATCH_TYPE diff --git a/ui/screenshot/extra/fixtures/readonly.yml b/ui/screenshot/extra/fixtures/readonly.yml deleted file mode 100644 index 560846d478..0000000000 --- a/ui/screenshot/extra/fixtures/readonly.yml +++ /dev/null @@ -1,25 +0,0 @@ -namespace: default -flags: - - key: colorscheme - name: Color Scheme - description: The color scheme for the site - type: VARIANT_FLAG_TYPE - enabled: true - variants: - - key: dark - - key: light - - key: auto - rules: - - segment: new-users - rank: 1 - distributions: - - variant: dark - rollout: 10 - - variant: light - rollout: 30 - - variant: auto - rollout: 60 -segments: - - key: new-users - name: New Users - match_type: ALL_MATCH_TYPE diff --git a/ui/screenshot/extra/readonly.js b/ui/screenshot/extra/readonly.js deleted file mode 100644 index cb8372d5b1..0000000000 --- a/ui/screenshot/extra/readonly.js +++ /dev/null @@ -1,16 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('extra', 'readonly', async (page) => { - await page.route(/\/meta\/config/, async (route) => { - const response = await route.fetch(); - const json = await response.json(); - json.storage = { type: 'git' }; - // Fulfill using the original response, while patching the - // response body with our changes to mock git storage for read only mode - await route.fulfill({ response, json }); - }); - - await page.getByRole('link', { name: 'Flags' }).click(); - }); -})(); diff --git a/ui/screenshot/getting_started/create_constraint.js b/ui/screenshot/getting_started/create_constraint.js deleted file mode 100644 index 57c1672453..0000000000 --- a/ui/screenshot/getting_started/create_constraint.js +++ /dev/null @@ -1,16 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('getting_started', 'create_constraint', async (page) => { - await page.getByRole('link', { name: 'Segments' }).click(); - await page.getByRole('link', { name: 'all-users' }).click(); - await page.getByRole('button', { name: 'New Constraint' }).click(); - await page.getByLabel('Property').fill('admin'); - await page - .getByRole('combobox', { name: 'Type' }) - .selectOption('BOOLEAN_COMPARISON_TYPE'); - await page - .getByRole('combobox', { name: 'Operator' }) - .selectOption('notpresent'); - }); -})(); diff --git a/ui/screenshot/getting_started/create_flag.js b/ui/screenshot/getting_started/create_flag.js deleted file mode 100644 index 441b513582..0000000000 --- a/ui/screenshot/getting_started/create_flag.js +++ /dev/null @@ -1,12 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('getting_started', 'create_flag', async (page) => { - await page.getByRole('button', { name: 'New Flag' }).click(); - await page.getByLabel('Name').fill('New Login'); - await page.getByLabel('Key').fill('new-login'); - await page - .getByLabel('Description') - .fill('Enables the new login page for users'); - }); -})(); diff --git a/ui/screenshot/getting_started/create_rule.js b/ui/screenshot/getting_started/create_rule.js deleted file mode 100644 index 81c316213b..0000000000 --- a/ui/screenshot/getting_started/create_rule.js +++ /dev/null @@ -1,12 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('getting_started', 'create_rule', async (page) => { - await page.getByRole('link', { name: 'new-login' }).click(); - await page.getByRole('link', { name: 'Rules' }).click(); - await page.getByRole('button', { name: 'New Rule' }).click(); - await page.locator('#segmentKey-0-select-button').click(); - await page.getByText('all-users').click(); - await page.getByLabel('Multi-Variate').check(); - }); -})(); diff --git a/ui/screenshot/getting_started/create_segment.js b/ui/screenshot/getting_started/create_segment.js deleted file mode 100644 index 106b27ae7d..0000000000 --- a/ui/screenshot/getting_started/create_segment.js +++ /dev/null @@ -1,10 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('getting_started', 'create_segment', async (page) => { - await page.getByRole('link', { name: 'Segments' }).click(); - await page.getByRole('button', { name: 'New Segment' }).click(); - await page.getByLabel('Name').fill('All Users'); - await page.getByLabel('Key').fill('all-users'); - }); -})(); diff --git a/ui/screenshot/getting_started/create_variant.js b/ui/screenshot/getting_started/create_variant.js deleted file mode 100644 index e12c2ec466..0000000000 --- a/ui/screenshot/getting_started/create_variant.js +++ /dev/null @@ -1,16 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('getting_started', 'create_variant', async (page) => { - await page.getByRole('link', { name: 'new-login' }).click(); - await page.getByRole('button', { name: 'New Variant' }).click(); - await page - .getByRole('dialog', { name: 'New Variant' }) - .locator('#key') - .fill('big-blue-login-button'); - await page - .getByRole('dialog', { name: 'New Variant' }) - .locator('#name') - .fill('Big Blue Login Button'); - }); -})(); diff --git a/ui/screenshot/getting_started/evaluation_console.js b/ui/screenshot/getting_started/evaluation_console.js deleted file mode 100644 index e90c9f2533..0000000000 --- a/ui/screenshot/getting_started/evaluation_console.js +++ /dev/null @@ -1,10 +0,0 @@ -import { capture } from '../../screenshot.js'; - -(async () => { - await capture('getting_started', 'evaluation_console', async (page) => { - await page.getByRole('link', { name: 'Console' }).click(); - await page.locator('#flagKey-select-button').click(); - await page.getByRole('option', { name: 'new-login New Login' }).click(); - await page.getByRole('button', { name: 'Evaluate', exact: true }).click(); - }); -})(); diff --git a/ui/screenshot/getting_started/fixtures/create_constraint.yml b/ui/screenshot/getting_started/fixtures/create_constraint.yml deleted file mode 100644 index 5ee77f1513..0000000000 --- a/ui/screenshot/getting_started/fixtures/create_constraint.yml +++ /dev/null @@ -1,4 +0,0 @@ -namespace: default -segments: - - key: all-users - name: All Users diff --git a/ui/screenshot/getting_started/fixtures/create_rule.yml b/ui/screenshot/getting_started/fixtures/create_rule.yml deleted file mode 100644 index c3fb0e386a..0000000000 --- a/ui/screenshot/getting_started/fixtures/create_rule.yml +++ /dev/null @@ -1,11 +0,0 @@ -namespace: default -flags: - - key: new-login - name: New Login - description: Enables the new login page for users - variants: - - key: big-blue-login-button - - key: big-red-login-button -segments: - - key: all-users - name: All Users diff --git a/ui/screenshot/getting_started/fixtures/create_variant.yml b/ui/screenshot/getting_started/fixtures/create_variant.yml deleted file mode 100644 index dee583c877..0000000000 --- a/ui/screenshot/getting_started/fixtures/create_variant.yml +++ /dev/null @@ -1,5 +0,0 @@ -namespace: default -flags: - - key: new-login - name: New Login - description: Enables the new login page for users diff --git a/ui/screenshot/getting_started/fixtures/evaluation_console.yml b/ui/screenshot/getting_started/fixtures/evaluation_console.yml deleted file mode 100644 index dc56aacc31..0000000000 --- a/ui/screenshot/getting_started/fixtures/evaluation_console.yml +++ /dev/null @@ -1,20 +0,0 @@ -namespace: default -flags: - - key: new-login - name: New Login - description: Enables the new login page for users - enabled: true - variants: - - key: big-blue-login-button - - key: big-red-login-button - rules: - - segment: all-users - rank: 1 - distributions: - - variant: big-blue-login-button - rollout: 50 - - variant: big-red-login-button - rollout: 50 -segments: - - key: all-users - name: All Users