Skip to content

Commit 9619b59

Browse files
committed
Merge branch 'main' into change-theme
2 parents 7649852 + f67c5cf commit 9619b59

File tree

66 files changed

+720
-209
lines changed

Some content is hidden

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

66 files changed

+720
-209
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,16 @@ jobs:
568568
with:
569569
directory: offlinedocs
570570

571+
- name: Install Protoc
572+
run: |
573+
mkdir -p /tmp/proto
574+
pushd /tmp/proto
575+
curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v23.3/protoc-23.3-linux-x86_64.zip
576+
unzip protoc.zip
577+
cp -r ./bin/* /usr/local/bin
578+
cp -r ./include /usr/local/bin/include
579+
popd
580+
571581
- name: Setup Go
572582
uses: ./.github/actions/setup-go
573583

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ lint/ts:
428428

429429
lint/go:
430430
./scripts/check_enterprise_imports.sh
431-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
431+
linter_ver=$(shell egrep -o 'GOLANGCI_LINT_VERSION=\S+' dogfood/Dockerfile | cut -d '=' -f 2)
432+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$$linter_ver
432433
golangci-lint run
433434
.PHONY: lint/go
434435

agent/agentproc/proc_other.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ import (
77
"github.com/spf13/afero"
88
)
99

10-
func (p *Process) Niceness(sc Syscaller) (int, error) {
10+
func (*Process) Niceness(Syscaller) (int, error) {
1111
return 0, errUnimplemented
1212
}
1313

14-
func (p *Process) SetNiceness(sc Syscaller, score int) error {
14+
func (*Process) SetNiceness(Syscaller, int) error {
1515
return errUnimplemented
1616
}
1717

18-
func (p *Process) Cmd() string {
18+
func (*Process) Cmd() string {
1919
return ""
2020
}
2121

22-
func List(fs afero.Fs, syscaller Syscaller) ([]*Process, error) {
22+
func List(afero.Fs, Syscaller) ([]*Process, error) {
2323
return nil, errUnimplemented
2424
}

agent/agentproc/syscaller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ type Syscaller interface {
1010
Kill(pid int32, sig syscall.Signal) error
1111
}
1212

13+
// nolint: unused // used on some but no all platforms
1314
const defaultProcDir = "/proc"
1415

1516
type Process struct {

agent/agentproc/syscaller_other.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ var errUnimplemented = xerrors.New("unimplemented")
1717

1818
type nopSyscaller struct{}
1919

20-
func (nopSyscaller) SetPriority(pid int32, priority int) error {
20+
func (nopSyscaller) SetPriority(int32, int) error {
2121
return errUnimplemented
2222
}
2323

24-
func (nopSyscaller) GetPriority(pid int32) (int, error) {
24+
func (nopSyscaller) GetPriority(int32) (int, error) {
2525
return 0, errUnimplemented
2626
}
2727

28-
func (nopSyscaller) Kill(pid int32, sig syscall.Signal) error {
28+
func (nopSyscaller) Kill(int32, syscall.Signal) error {
2929
return errUnimplemented
3030
}

agent/agentssh/jetbrainstrack.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import (
44
"strings"
55
"sync"
66

7-
"cdr.dev/slog"
87
"github.com/gliderlabs/ssh"
98
"go.uber.org/atomic"
109
gossh "golang.org/x/crypto/ssh"
10+
11+
"cdr.dev/slog"
1112
)
1213

1314
// localForwardChannelData is copied from the ssh package.

agent/agentssh/portinspection_unsupported.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
package agentssh
44

5-
func getListeningPortProcessCmdline(port uint32) (string, error) {
5+
func getListeningPortProcessCmdline(uint32) (string, error) {
66
// We are not worrying about other platforms at the moment because Gateway
77
// only supports Linux anyway.
88
return "", nil

agent/api.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ type listeningPortsHandler struct {
4444
ignorePorts map[int]string
4545
cacheDuration time.Duration
4646

47-
mut sync.Mutex
47+
//nolint: unused // used on some but not all platforms
48+
mut sync.Mutex
49+
//nolint: unused // used on some but not all platforms
4850
ports []codersdk.WorkspaceAgentListeningPort
51+
//nolint: unused // used on some but not all platforms
4952
mtime time.Time
5053
}
5154

agent/ports_unsupported.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package agent
44

55
import "github.com/coder/coder/v2/codersdk"
66

7-
func (lp *listeningPortsHandler) getListeningPorts() ([]codersdk.WorkspaceAgentListeningPort, error) {
7+
func (*listeningPortsHandler) getListeningPorts() ([]codersdk.WorkspaceAgentListeningPort, error) {
88
// Can't scan for ports on non-linux or non-windows_amd64 systems at the
99
// moment. The UI will not show any "no ports found" message to the user, so
1010
// the user won't suspect a thing.

agent/usershell/usershell_darwin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import (
1313
func Get(username string) (string, error) {
1414
// This command will output "UserShell: /bin/zsh" if successful, we
1515
// can ignore the error since we have fallback behavior.
16+
if !filepath.IsLocal(username) {
17+
return "", xerrors.Errorf("username is nonlocal path: %s", username)
18+
}
19+
//nolint: gosec // input checked above
1620
out, _ := exec.Command("dscl", ".", "-read", filepath.Join("/Users", username), "UserShell").Output()
1721
s, ok := strings.CutPrefix(string(out), "UserShell: ")
1822
if ok {

0 commit comments

Comments
 (0)