Skip to content

feat: refactor deployment config #6347

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

Merged
merged 89 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
6c29207
Initial scaffold
ammario Feb 25, 2023
12dcc45
Add Duration
ammario Feb 25, 2023
d1e2e15
Begin converting AccessURL
ammario Feb 25, 2023
8db4626
fixup! Begin converting AccessURL
ammario Feb 25, 2023
dc81f47
Start migrating Server
ammario Feb 25, 2023
d511001
Convert a couple more fields
ammario Feb 26, 2023
8cc406e
replace DeploymentConfig[T] with bigcli.[T]
ammario Feb 26, 2023
18b2552
Remove .Value calls
ammario Feb 26, 2023
bad7aca
Finish destroying newConfig
ammario Feb 26, 2023
f075ad5
delete deployment/
ammario Feb 26, 2023
69600d7
rewrite server.go
ammario Feb 26, 2023
63159a6
ugh
ammario Feb 26, 2023
03b08fa
Server boots
ammario Feb 26, 2023
e0d6c1e
Move critical options code into `codersdk`
ammario Feb 26, 2023
5bebd0f
DefaultCacheDir
ammario Feb 26, 2023
2c7b39d
Merge remote-tracking branch 'origin/main' into bigcli
ammario Feb 26, 2023
05b3a10
Fix config dir bug
ammario Feb 26, 2023
dcbd0d8
update golden --help
ammario Feb 26, 2023
fc06f64
Support NoOptDefValue
ammario Feb 26, 2023
d31fa37
Don't hide pflag.FlagSet
ammario Feb 26, 2023
0d7d557
Help template scaffold
ammario Feb 26, 2023
f3d45d3
Show env in help output
ammario Feb 26, 2023
d322114
Merge remote-tracking branch 'origin/main' into bigcli
ammario Feb 26, 2023
8f9d44b
Write more descriptions
ammario Feb 26, 2023
acac92d
Organize telemetry
ammario Feb 26, 2023
1c8359b
Finish grouping up flags
ammario Feb 26, 2023
8d0020f
Render subcommands
ammario Feb 26, 2023
882a80f
Convert Groups to first class bigcli feature
ammario Feb 26, 2023
ae858b4
deepMapNode?
ammario Feb 26, 2023
b34d481
Add YAML tags everywhere.......
ammario Feb 26, 2023
e0e113b
Minor changes
ammario Feb 26, 2023
02c8f6c
Group Enterprise flags
ammario Feb 26, 2023
000466f
Massive refactor to improve help formatting
ammario Feb 27, 2023
c6133f2
Improve help formatting again
ammario Feb 27, 2023
ab21e8f
Send group descriptions to YAML
ammario Feb 27, 2023
b816b1a
Fix YAML tests
ammario Feb 27, 2023
559b046
make gen
ammario Feb 27, 2023
3b24149
Pass linter
ammario Feb 27, 2023
e422c1d
Fix slim bugs
ammario Feb 27, 2023
ea6c3b7
Start frontend... about to go to sleep 🥱
ammario Feb 27, 2023
d4aa8d3
Merge remote-tracking branch 'origin/main' into bigcli
ammario Feb 27, 2023
58b6324
Fix remaining go compilation errors
ammario Feb 27, 2023
cae2eab
Do some type generation
ammario Feb 27, 2023
d4bd380
Fix most broken frontend code...
ammario Feb 27, 2023
8a493ef
Add envparse library
ammario Feb 27, 2023
84b59be
Add legacy git auth env support
ammario Feb 27, 2023
ac3507f
Fix Git Provider rendering in frontend
ammario Feb 27, 2023
95db142
Remove unused lint rules
ammario Feb 27, 2023
790f45a
Update golden files
ammario Feb 27, 2023
360b600
Fix all stories
ammario Feb 28, 2023
2344013
Fix server tests
ammario Feb 28, 2023
394fbfa
Merge remote-tracking branch 'origin/main' into bigcli
ammario Feb 28, 2023
ac909b5
Disable clidocsgen.. for now
ammario Feb 28, 2023
8a2637d
Server tests pass?
ammario Feb 28, 2023
3ed919e
Start figuring out CLI array bug
ammario Feb 28, 2023
d397839
bigcli: fix slice parsing
ammario Feb 28, 2023
957500b
fix remaining calls to deprecated "experimental"
ammario Feb 28, 2023
0890005
Fix more tests
ammario Feb 28, 2023
622df7f
make gen
ammario Feb 28, 2023
362618e
Fix another server test bug
ammario Feb 28, 2023
2fa8b78
Fix logger!
ammario Feb 28, 2023
28e4b07
fix access url test
ammario Feb 28, 2023
410ad26
make gen
ammario Feb 28, 2023
5c3f648
fix frontend!
ammario Feb 28, 2023
f29889f
Merge remote-tracking branch 'origin/main' into bigcli
ammario Feb 28, 2023
6ced9cf
Debug log gitAuthConfigs
ammario Feb 28, 2023
d9d1592
No more implicit options
ammario Mar 1, 2023
74c6da2
Re-enable cli docs gen
ammario Mar 1, 2023
9e53c96
De-pointer DeploymentValues
ammario Mar 1, 2023
06f82b5
Decompose DeploymentConfig
ammario Mar 1, 2023
2f5a522
Some comments
ammario Mar 1, 2023
53e92fc
Move envparse into bigcli
ammario Mar 6, 2023
e9e2908
Minor changes
ammario Mar 6, 2023
c3a11fd
Add context to clitest.Start
ammario Mar 6, 2023
a090cd4
Remove dead function
ammario Mar 6, 2023
d9a8da6
Merge remote-tracking branch 'origin/main' into bigcli
ammario Mar 6, 2023
e53367a
Fix FE
ammario Mar 6, 2023
6252316
make lint passes
ammario Mar 6, 2023
bf1a099
Pass highlyConfigurable
ammario Mar 6, 2023
274d5c5
Context bug
ammario Mar 6, 2023
a213d25
Rename to clibase
ammario Mar 6, 2023
2938980
fix slim build
ammario Mar 6, 2023
140438e
Merge remote-tracking branch 'origin/main' into bigcli
ammario Mar 7, 2023
46936f5
Fix merge issues
ammario Mar 7, 2023
06277c4
Set max token lifetime correctly
ammario Mar 7, 2023
fc8e6ca
Command -> Cmd
ammario Mar 7, 2023
2a74445
Typo
ammario Mar 7, 2023
3cfb4bf
Show disabled badge in zero option table
ammario Mar 7, 2023
4d8bc75
Merge remote-tracking branch 'origin/main' into bigcli
ammario Mar 7, 2023
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
Prev Previous commit
Next Next commit
Command -> Cmd
  • Loading branch information
ammario committed Mar 7, 2023
commit fc8e6cafd3102e422e96bd57223612fa7a442fa3
File renamed without changes.
14 changes: 7 additions & 7 deletions cli/clibase/command.go → cli/clibase/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package clibase

import "strings"

// Command describes an executable command.
type Command struct {
// Cmd describes an executable command.
type Cmd struct {
// Parent is the direct parent of the command.
Parent *Command
Parent *Cmd
// Children is a list of direct descendants.
Children []*Command
Children []*Cmd
// Use is provided in form "command [flags] [args...]".
Use string
// Short is a one-line description of the command.
Expand All @@ -20,13 +20,13 @@ type Command struct {
}

// Name returns the first word in the Use string.
func (c *Command) Name() string {
func (c *Cmd) Name() string {
return strings.Split(c.Use, " ")[0]
}

// FullName returns the full invocation name of the command,
// as seen on the command line.
func (c *Command) FullName() string {
func (c *Cmd) FullName() string {
var names []string

if c.Parent != nil {
Expand All @@ -38,7 +38,7 @@ func (c *Command) FullName() string {

// FullName returns usage of the command, preceded
// by the usage of its parents.
func (c *Command) FullUsage() string {
func (c *Cmd) FullUsage() string {
var uses []string
if c.Parent != nil {
uses = append(uses, c.Parent.FullUsage())
Expand Down
6 changes: 3 additions & 3 deletions cli/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ func Server(newAPI func(context.Context, *coderd.Options) (*coderd.API, io.Close
flagSet := cliOpts.FlagSet()
// These parents and children will be moved once we convert the
// rest of the `cli` package to clibase.
flagSet.Usage = usageFn(cmd.ErrOrStderr(), &clibase.Command{
Parent: &clibase.Command{
flagSet.Usage = usageFn(cmd.ErrOrStderr(), &clibase.Cmd{
Parent: &clibase.Cmd{
Use: "coder",
},
Children: []*clibase.Command{
Children: []*clibase.Cmd{
{
Use: "postgres-builtin-url",
Short: "Output the connection URL for the built-in PostgreSQL deployment.",
Expand Down
4 changes: 2 additions & 2 deletions cli/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var usageTemplate = template.Must(
s = wordwrap.WrapString(s, 60)
return s
},
"optionGroups": func(cmd *clibase.Command) []optionGroup {
"optionGroups": func(cmd *clibase.Cmd) []optionGroup {
groups := []optionGroup{{
// Default group.
Name: "",
Expand Down Expand Up @@ -130,7 +130,7 @@ var usageTemplate = template.Must(

// usageFn returns a function that generates usage (help)
// output for a given command.
func usageFn(output io.Writer, cmd *clibase.Command) func() {
func usageFn(output io.Writer, cmd *clibase.Cmd) func() {
return func() {
err := usageTemplate.Execute(output, cmd)
if err != nil {
Expand Down
11 changes: 6 additions & 5 deletions codersdk/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ var (
Parent: &DeploymentGroupNetworking,
Name: "TLS",
Description: `Configure TLS / HTTPS for your Coder deployment. If you're running
Coder behind a TLS-terminating reverse proxy or are accessing Coder over a
secure link, you can safely ignore these settings.`,
Coder behind a TLS-terminating reverse proxy or are accessing Coder over a
secure link, you can safely ignore these settings.`,
}
DeploymentGroupNetworkingHTTP = clibase.Group{
Parent: &DeploymentGroupNetworking,
Expand All @@ -332,9 +332,9 @@ secure link, you can safely ignore these settings.`,
Parent: &DeploymentGroupNetworking,
Name: "DERP",
Description: `Most Coder deployments never have to think about DERP because all connections
between workspaces and users are peer-to-peer. However, when Coder cannot establish
a peer to peer connection, Coder uses a distributed relay network backed by
Tailscale and WireGuard.`,
between workspaces and users are peer-to-peer. However, when Coder cannot establish
a peer to peer connection, Coder uses a distributed relay network backed by
Tailscale and WireGuard.`,
}
DeploymentGroupIntrospection = clibase.Group{
Name: "Introspection",
Expand Down Expand Up @@ -1272,6 +1272,7 @@ Write out the current server configuration to the path specified by --config.`,
Description: "Git Authentication providers",
YAML: "gitAuthProviders",
Value: &c.GitAuthProviders,
Hidden: true,
},
}
}
Expand Down