Skip to content

Commit 408bc4c

Browse files
authored
Adding quickstart update (#571)
* Adding quickstart update * Fixing some minor bug with TUI and adding better delete behavior when removing a context * Fixing and adding tests * Saving gif
1 parent e98b0ad commit 408bc4c

6 files changed

Lines changed: 567 additions & 35 deletions

File tree

cli/tools/context.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,20 @@ func newDeleteContext() simplecobra.Commander {
139139
NameP: "delete",
140140
Short: "delete context <context>",
141141
Long: "delete context <context>",
142+
WithCFunc: func(cmd *cobra.Command, r *domain.RootCommand) {
143+
cmd.Aliases = []string{"del"}
144+
cmd.Flags().Bool("skip-confirmation", false, "Skip confirmation prompt and delete all credential files (except default.yaml)")
145+
},
142146
RunFunc: func(ctx context.Context, cd *simplecobra.Commandeer, rootCmd *domain.RootCommand, args []string) error {
143147
if len(args) < 1 {
144148
return errors.New("requires a context argument")
145149
}
146150
contextEntry := args[0]
147-
config.DeleteContext(rootCmd.ConfigSvc(), contextEntry)
151+
skipConfirm, _ := cd.CobraCommand.Flags().GetBool("skip-confirmation")
152+
config.DeleteContext(rootCmd.ConfigSvc(), contextEntry, skipConfirm)
148153
slog.Info("Successfully deleted context", "context", contextEntry)
149154
return nil
150155
},
151-
InitCFunc: func(cd *simplecobra.Commandeer, runner *simplecobra.Commandeer, r *domain.RootCommand) error {
152-
cd.CobraCommand.Aliases = []string{"del"}
153-
return nil
154-
},
155156
}
156157
}
157158

gdg.tape

Lines changed: 157 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,184 @@ Set Height 600
1010

1111

1212
Type "gdg tools context list" Sleep 500ms Enter
13+
Sleep 5s
1314
Type "clear" Enter
1415
Type "gdg tools context new demo" Sleep 500ms Enter
15-
Down@1 Down@1 Down@1 Sleep 500ms Enter
16+
17+
# Auth type: "Basic Authentication" (first option, already selected)
18+
Sleep 500ms Enter
19+
20+
# Grafana Username
21+
Sleep 500ms
1622
Type "admin" Sleep 200ms Enter
23+
24+
# Grafana Password
1725
Type "admin" Sleep 1000ms Enter
26+
27+
# Destination Folder
1828
Type "test/data" Enter
29+
30+
# Grafana URL
1931
Type "http://localhost:3000" Sleep 500ms Enter
20-
Type "General,linux%2Fgnu/*" Sleep 500ms Enter
32+
33+
# Folder scope: "Build a folder allowlist" (second option)
34+
Sleep 500ms
35+
Down Enter
36+
37+
# Watched Folders: "Add a folder" (only option on first pass)
38+
Sleep 500ms Enter
39+
40+
# Folder name
41+
Type "General" Sleep 500ms Enter
42+
43+
# Watched Folders: "Add a folder" (first option) to add second folder
44+
Sleep 1s Enter
45+
46+
# Folder name: linux/gnu (literal, no regex metacharacters — will be URL-encoded)
47+
Sleep 500ms
48+
Type "linux/gnu" Sleep 1s Enter
49+
Sleep 1s
50+
51+
# Watched Folders: "Add a folder" (first option) to add third folder
52+
Sleep 1s Enter
53+
54+
# Folder name: linux.* (contains regex metacharacter *)
55+
Sleep 500ms
56+
Type "linux.*" Sleep 1s Enter
57+
58+
# "Regex characters detected" confirm: toggle to "Yes, it's a regex"
59+
Sleep 1s
60+
Left Sleep 500ms Enter
61+
Sleep 1s
62+
63+
# Watched Folders: "Test a folder name against current list" (second option)
64+
Sleep 1s
65+
Down Sleep 500ms Enter
66+
67+
# Test folder name: linux/gnu/foobar
68+
Sleep 500ms
69+
Type "linux/gnu/foobar" Sleep 1s Enter
70+
Sleep 2s
71+
72+
# "Test another folder name?" confirm: No (default)
73+
Sleep 1s Enter
74+
75+
# Watched Folders: select "Done" (third option)
76+
Sleep 1s
77+
Down Down Enter
78+
79+
# Configure connection settings? (default No, toggle to Yes)
80+
Sleep 1s
81+
Left Enter
82+
83+
# Configure Connection Filters? (default No, toggle to Yes)
84+
Sleep 1s
85+
Left Sleep 500ms Enter
86+
87+
# Filter Field
88+
Sleep 500ms
89+
Type "access" Sleep 1s Enter
90+
91+
# Filter Regex
92+
Sleep 500ms
93+
Type "proxy" Sleep 1s Enter
94+
95+
# Inclusive filter? (default No, toggle to Yes)
96+
Sleep 1s
97+
Left Sleep 500ms Enter
98+
Sleep 1s
99+
100+
# Test regex? (default No, skip)
101+
Sleep 1s Enter
102+
103+
# Add another filter? (default No, skip)
104+
Sleep 1s Enter
105+
106+
# Connection Default User
21107
Type "ds_admin" Sleep 500ms Enter
108+
109+
# Connection Default Password
22110
Type "ds_pass" Sleep 500ms Enter
23-
Type "gdg tools context show demo" Sleep 500ms Enter
111+
112+
# Configure Credential Rules? (default No, toggle to Yes)
113+
Sleep 2s
114+
Left Sleep 500ms Enter
115+
116+
# Secure Data File
117+
Sleep 1s
118+
Type "elastic.yaml" Sleep 1s Enter
119+
120+
# Matching Field
121+
Sleep 1s
122+
Type "type" Sleep 1s Enter
123+
124+
# Matching Regex
125+
Sleep 1s
126+
Type "elasticsearch" Sleep 1s Enter
127+
128+
# Test regex? (default No, skip)
129+
Sleep 2s Enter
130+
131+
# Add another matching rule to this credential entry? (default No, skip)
132+
Sleep 2s Enter
133+
134+
# Credentials for elastic.yaml — User
135+
Sleep 1s
136+
Type "elastic" Sleep 500ms Enter
137+
138+
# Credentials for elastic.yaml — Password
139+
Type "elastic" Sleep 500ms Enter
140+
Sleep 2s
141+
142+
# YAML preview is displayed, then: Add another credential rule? (default No, skip)
143+
Sleep 3s Enter
144+
145+
# Configure cloud storage? (default No, toggle to Yes)
146+
Sleep 2s
147+
Left Enter
148+
149+
# Cloud storage provider: "AWS S3" (second option)
150+
Sleep 2s
151+
Down Sleep 500ms Enter
152+
Sleep 3s
153+
154+
Sleep 2s
155+
Type "gdg tools context show demo --all" Sleep 500ms Enter
156+
Sleep 3s
24157
Type "echo encrypted auth using plugin" Sleep 500ms Enter
158+
Sleep 3s
25159
Type "cat test/data/secure/auth_demo.yaml" Sleep 500ms Enter
160+
Sleep 4s
26161
Type "echo encrypted connection settings using plugin" Sleep 500ms Enter
162+
Sleep 3s
27163
Type "cat test/data/secure/default.yaml" Sleep 500ms Enter
28-
Type "clear" Sleep 5000ms Enter
164+
Sleep 4s
165+
Type "echo encrypted elasticsearch credentials using plugin" Sleep 500ms Enter
166+
Sleep 3s
167+
Type "cat test/data/secure/elastic.yaml" Sleep 500ms Enter
168+
Sleep 5s
169+
Type "clear" Enter
29170
Type "gdg backup dash list" Sleep 500ms Enter
171+
Sleep 3s
30172
Type "gdg backup dash upload" Sleep 500ms Enter
173+
Sleep 1s
31174
Type "y" Sleep 500ms Enter
175+
Sleep 3s
32176
Type "gdg backup dash list" Sleep 500ms Enter
177+
Sleep 3s
33178
Type "gdg backup dash download" Sleep 500ms Enter
179+
Sleep 3s
34180
Type "gdg backup dash clear" Sleep 500ms Enter
181+
Sleep 1s
35182
Type "y" Sleep 500ms Enter
183+
Sleep 3s
36184
Type "gdg backup dash list" Sleep 500ms Enter
37-
185+
Sleep 3s
38186

39187
Type "gdg tools context delete demo" Sleep 500ms Enter
40188

189+
# Delete credential files? (default No, toggle to Yes)
190+
Sleep 2s
191+
Left Sleep 500ms Enter
192+
41193
Sleep 5s

0 commit comments

Comments
 (0)