mirror of https://github.com/coder/coder.git
parent
b33dec9d38
commit
be8389fd74
|
@ -14,9 +14,9 @@ on:
|
|||
workflow_dispatch:
|
||||
inputs:
|
||||
iterationCount:
|
||||
description: 'Iteration Count'
|
||||
description: "Iteration Count"
|
||||
required: false
|
||||
default: '10'
|
||||
default: "10"
|
||||
|
||||
# Cancel in-progress runs for pull requests when developers push
|
||||
# additional changes, and serialize builds in branches.
|
||||
|
@ -43,7 +43,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "^1.17"
|
||||
go-version: "~1.18"
|
||||
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
|
|
|
@ -44,7 +44,7 @@ jobs:
|
|||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3.1.0
|
||||
with:
|
||||
version: v1.43.0
|
||||
version: v1.45.2
|
||||
|
||||
style-lint-typescript:
|
||||
name: "style/lint/typescript"
|
||||
|
@ -201,7 +201,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "~1.17"
|
||||
go-version: "~1.18"
|
||||
|
||||
- name: Echo Go Cache Paths
|
||||
id: go-cache-paths
|
||||
|
@ -299,7 +299,7 @@ jobs:
|
|||
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "~1.17"
|
||||
go-version: "~1.18"
|
||||
|
||||
- name: Echo Go Cache Paths
|
||||
id: go-cache-paths
|
||||
|
@ -362,7 +362,7 @@ jobs:
|
|||
# Go is required for uploading the test results to datadog
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "~1.17"
|
||||
go-version: "~1.18"
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
|
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
fetch-depth: 0
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "^1.17"
|
||||
go-version: "~1.18"
|
||||
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2.9.1
|
||||
|
|
|
@ -154,7 +154,7 @@ linters-settings:
|
|||
- name: import-shadowing
|
||||
- name: increment-decrement
|
||||
- name: indent-error-flow
|
||||
- name: modifies-parameter
|
||||
# - name: modifies-parameter
|
||||
- name: modifies-value-receiver
|
||||
- name: package-comments
|
||||
- name: range
|
||||
|
@ -185,6 +185,8 @@ linters-settings:
|
|||
- i
|
||||
- db
|
||||
- t
|
||||
- id
|
||||
- wg
|
||||
# Optional list of variable declarations that should be ignored completely. (defaults to empty list)
|
||||
# Entries must be in the form of "<variable name> <type>" or "<variable name> *<type>" for
|
||||
# variables, or "const <name>" for constants.
|
||||
|
@ -193,6 +195,8 @@ linters-settings:
|
|||
- r *http.Request
|
||||
- t testing.T
|
||||
- t testing.TB
|
||||
- ok bool
|
||||
- wg sync.WaitGroup
|
||||
|
||||
issues:
|
||||
# Rules listed here: https://github.com/securego/gosec#available-rules
|
||||
|
|
5
Makefile
5
Makefile
|
@ -88,3 +88,8 @@ site/out:
|
|||
# Restores GITKEEP files!
|
||||
git checkout HEAD site/out
|
||||
.PHONY: site/out
|
||||
|
||||
lint:
|
||||
@echo "--- golangci-lint"
|
||||
golangci-lint run
|
||||
.PHONY: lint
|
||||
|
|
|
@ -35,12 +35,15 @@ func Select(cmd *cobra.Command, opts SelectOptions) (string, error) {
|
|||
Templates: &promptui.SelectTemplates{
|
||||
FuncMap: template.FuncMap{
|
||||
"faint": func(value interface{}) string {
|
||||
//nolint:forcetypeassert
|
||||
return Styles.Placeholder.Render(value.(string))
|
||||
},
|
||||
"subtle": func(value interface{}) string {
|
||||
//nolint:forcetypeassert
|
||||
return defaultStyles.Subtle.Render(value.(string))
|
||||
},
|
||||
"selected": func(value interface{}) string {
|
||||
//nolint:forcetypeassert
|
||||
return defaultStyles.Keyword.Render("> " + value.(string))
|
||||
// return defaultStyles.SelectedMenuItem.Render("> " + value.(string))
|
||||
},
|
||||
|
|
|
@ -138,5 +138,7 @@ func getFreePort() (port int, err error) {
|
|||
}
|
||||
|
||||
defer listener.Close()
|
||||
// This is always a *net.TCPAddr.
|
||||
// nolint:forcetypeassert
|
||||
return listener.Addr().(*net.TCPAddr).Port, nil
|
||||
}
|
||||
|
|
|
@ -72,6 +72,9 @@ func (p *pgPubsub) Subscribe(event string, listener Listener) (cancel func(), er
|
|||
}
|
||||
|
||||
func (p *pgPubsub) Publish(event string, message []byte) error {
|
||||
// This is safe because we are calling pq.QuoteLiteral. pg_notify doesn't
|
||||
// support the first parameter being a prepared statement.
|
||||
//nolint:gosec
|
||||
_, err := p.db.ExecContext(context.Background(), `select pg_notify(`+pq.QuoteLiteral(event)+`, $1)`, message)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("exec: %w", err)
|
||||
|
|
|
@ -138,7 +138,9 @@ func (api *api) provisionerJobLogs(rw http.ResponseWriter, r *http.Request, job
|
|||
// See: https://canjs.com/doc/can-ndjson-stream.html
|
||||
rw.Header().Set("Content-Type", "application/stream+json")
|
||||
rw.WriteHeader(http.StatusOK)
|
||||
rw.(http.Flusher).Flush()
|
||||
if flusher, ok := rw.(http.Flusher); ok {
|
||||
flusher.Flush()
|
||||
}
|
||||
|
||||
// The Go stdlib JSON encoder appends a newline character after message write.
|
||||
encoder := json.NewEncoder(rw)
|
||||
|
@ -161,7 +163,9 @@ func (api *api) provisionerJobLogs(rw http.ResponseWriter, r *http.Request, job
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
rw.(http.Flusher).Flush()
|
||||
if flusher, ok := rw.(http.Flusher); ok {
|
||||
flusher.Flush()
|
||||
}
|
||||
case <-ticker.C:
|
||||
job, err := api.Database.GetProvisionerJobByID(r.Context(), job.ID)
|
||||
if err != nil {
|
||||
|
|
|
@ -94,6 +94,7 @@ func readBodyAsError(res *http.Response) error {
|
|||
}
|
||||
}
|
||||
|
||||
//nolint:varnamelen
|
||||
var m httpapi.Response
|
||||
err := json.NewDecoder(res.Body).Decode(&m)
|
||||
if err != nil {
|
||||
|
|
2
go.mod
2
go.mod
|
@ -1,6 +1,6 @@
|
|||
module github.com/coder/coder
|
||||
|
||||
go 1.17
|
||||
go 1.18
|
||||
|
||||
// Required until https://github.com/manifoldco/promptui/pull/169 is merged.
|
||||
replace github.com/manifoldco/promptui => github.com/kylecarbs/promptui v0.8.1-0.20201231190244-d8f2159af2b2
|
||||
|
|
|
@ -192,6 +192,7 @@ func TestConn(t *testing.T) {
|
|||
_ = server.Serve(srv)
|
||||
}()
|
||||
|
||||
//nolint:forcetypeassert
|
||||
defaultTransport := http.DefaultTransport.(*http.Transport).Clone()
|
||||
var cch *peer.Channel
|
||||
defaultTransport.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||
|
|
Loading…
Reference in New Issue