8000 Merge remote-tracking branch 'origin/main' into update-documentation-… · coder/coder@aee782e · GitHub
[go: up one dir, main page]

Skip to content

Commit aee782e

Browse files
committed
Merge remote-tracking branch 'origin/main' into update-documentation-link/kira-pilot
2 parents 61050cd + f581724 commit aee782e

File tree

99 files changed

+2251
-1003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2251
-1003
lines changed

.github/workflows/coder.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: golangci-lint
4343
uses: golangci/golangci-lint-action@v3.1.0
4444
with:
45-
version: v1.45.2
45+
version: v1.46.0
4646

4747
style-lint-typescript:
4848
name: "style/lint/typescript"

.golangci.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ linters-settings:
7777
# - sloppyReassign
7878
- sloppyTypeAssert
7979
- sortSlice
80-
# - sprintfQuotedString
80+
- sprintfQuotedString
8181
- sqlQuery
8282
# - stringConcatSimplify
8383
# - stringXbytes
@@ -105,6 +105,13 @@ linters-settings:
105105
failOn: all
106106
rules: rules.go
107107

108+
staticcheck:
109+
# https://staticcheck.io/docs/options#checks
110+
# We disable SA1019 because it gets angry about our usage of xerrors. We
111+
# intentionally xerrors because stack frame support didn't make it into the
112+
# stdlib port.
113+
checks: ["all", "-SA1019"]
114+
108115
goimports:
109116
local-prefixes: coder.com,cdr.dev,go.coder.com,github.com/cdr,github.com/coder
110117

@@ -235,7 +242,7 @@ linters:
235242
# without testing any exported functions. This is enabled to promote
236243
# decomposing a package before testing it's internals. A function caller
237244
# should be able to test most of the functionality from exported functions.
238-
#
245+
#
239246
# There are edge-cases to this rule, but they should be carefully considered
240247
# to avoid structural inconsistency.
241248
- testpackage

.goreleaser.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,18 @@ builds:
3232
["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
3333
env: [CGO_ENABLED=0]
3434
goos: [darwin, linux, windows]
35-
goarch: [amd64]
35+
goarch: [amd64, arm, arm64]
36+
goarm: ["7"]
37+
# Only build arm 7 for Linux
38+
ignore:
39+
- goos: windows
40+
goarm: '7'
41+
- goos: darwin
42+
goarm: '7'
3643
hooks:
3744
# The "trimprefix" appends ".exe" on Windows.
3845
post: |
39-
cp {{.Path}} site/out/bin/coder-{{ .Os }}-{{ .Arch }}{{ trimprefix .Name "coder" }}
46+
cp {{.Path}} site/out/bin/coder-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ trimprefix .Name "coder" }}
4047
4148
- id: coder-linux
4249
dir: cmd/coder
@@ -45,7 +52,8 @@ builds:
4552
["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
4653
env: [CGO_ENABLED=0]
4754
goos: [linux]
48-
goarch: [amd64, arm64]
55+
goarch: [amd64, arm, arm64]
56+
goarm: ["7"]
4957

5058
- id: coder-windows
5159
dir: cmd/coder

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ site/out/index.html: $(shell find ./site -not -path './site/node_modules/*' -typ
8383
# Restores GITKEEP files!
8484
git checkout HEAD site/out
8585

86-
site/src/api/typesGenerated.ts: $(shell find codersdk -type f -name '*.go')
86+
site/src/api/typesGenerated.ts: scripts/apitypings/main.go $(shell find codersdk -type f -name '*.go')
8787
go run scripts/apitypings/main.go > site/src/api/typesGenerated.ts
8888
cd site && yarn run format:types
8989

cli/autostart.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ The default schedule is at 09:00 in your local timezone (TZ env, UTC by default)
1818

1919
func autostart() *cobra.Command {
2020
autostartCmd := &cobra.Command{
21-
Use: "autostart enable <workspace>",
22-
Short: "schedule a workspace to automatically start at a regular time",
23-
Long: autostartDescriptionLong,
24-
Example: "coder autostart enable my-workspace --minute 30 --hour 9 --days 1-5 --tz Europe/Dublin",
25-
Hidden: true,
21+
Annotations: workspaceCommand,
22+
Use: "autostart enable <workspace>",
23+
Short: "schedule a workspace to automatically start at a regular time",
24+
Long: autostartDescriptionLong,
25+
Example: "coder autostart enable my-workspace --minute 30 --hour 9 --days 1-5 --tz Europe/Dublin",
26+
Hidden: true,
2627
}
2728

2829
autostartCmd.AddCommand(autostartEnable())

cli/cliui/cliui_darwin.go

Lines changed: 0 additions & 31 deletions
This file was deleted.

cli/cliui/cliui_other.go

Lines changed: 0 additions & 10 deletions
This file was deleted.

cli/cliui/prompt.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"fmt"
88
"os"
99
"os/signal"
10-
"runtime"
1110
"strings"
1211

1312
"github.com/bgentry/speakeasy"
@@ -48,16 +47,6 @@ func Prompt(cmd *cobra.Command, opts PromptOptions) (string, error) {
4847
if opts.Secret && isInputFile && isatty.IsTerminal(inFile.Fd()) {
4948
line, err = speakeasy.Ask("")
5049
} else {
51-
if !opts.IsConfirm && runtime.GOOS == "darwin" && isInputFile {
52-
var restore func()
53-
restore, err = removeLineLengthLimit(int(inFile.Fd()))
54-
if err != nil {
55-
errCh <- err
56-
return
57-
}
58-
defer restore()
59-
}
60-
6150
reader := bufio.NewReader(cmd.InOrStdin())
6251
line, err = reader.ReadString('\n')
6352

cli/cliui/table.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package cliui
2+
3+
import (
4+
"strings"
5+
6+
"github.com/jedib0t/go-pretty/v6/table"
7+
)
8+
9+
// Table creates a new table with standardized styles.
10+
func Table() table.Writer {
11+
tableWriter := table.NewWriter()
12+
tableWriter.Style().Box.PaddingLeft = ""
13+
tableWriter.Style().Box.PaddingRight = " "
14+
tableWriter.Style().Options.DrawBorder = false
15+
tableWriter.Style().Options.SeparateHeader = false
16+
tableWriter.Style().Options.SeparateColumns = false
17+
return tableWriter
18+
}
19+
20+
// FilterTableColumns returns configurations to hide columns
21+
// that are not provided in the array. If the array is empty,
22+
// no filtering will occur!
23+
func FilterTableColumns(header table.Row, columns []string) []table.ColumnConfig {
24+
if len(columns) == 0 {
25+
return nil
26+
}
27+
columnConfigs := make([]table.ColumnConfig, 0)
28+
for _, headerTextRaw := range header {
29+
headerText, _ := headerTextRaw.(string)
30+
hidden := true
31+
for _, column := range columns {
32+
if strings.EqualFold(strings.ReplaceAll(column, "_", " "), headerText) {
33+
hidden = false
34+
break
35+
}
36+
}
37+
columnConfigs = append(columnConfigs, table.ColumnConfig{
38+
Name: headerText,
39+
Hidden: hidden,
40+
})
41+
}
42+
return columnConfigs
43+
}

cli/configssh.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ func configSSH() *cobra.Command {
3636
skipProxyCommand bool
3737
)
3838
cmd := &cobra.Command{
39-
Use: "config-ssh",
39+
Annotations: workspaceCommand,
40+
Use: "config-ssh",
41+
Short: "Populate your SSH config with Host entries for all of your workspaces",
4042
RunE: func(cmd *cobra.Command, args []string) error {
4143 3D4B
client, err := createClient(cmd)
4244
if err != nil {

0 commit comments

Comments
 (0)
0