Skip to content

Commit b0ecf52

Browse files
committed
Merge remote-tracking branch 'origin/main' into 666-unheading-premium
2 parents a7b6e98 + badebc7 commit b0ecf52

File tree

194 files changed

+8270
-2769
lines changed

Some content is hidden

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

194 files changed

+8270
-2769
lines changed

.github/.linkspector.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ ignorePatterns:
1818
- pattern: "i.imgur.com"
1919
- pattern: "code.visualstudio.com"
2020
- pattern: "www.emacswiki.org"
21+
- pattern: "linux.die.net/man"
2122
aliveStatusCodes:
2223
- 200

.github/workflows/ci.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
189189
# Check for any typos
190190
- name: Check for typos
191-
uses: crate-ci/typos@2872c382bb9668d4baa5eade234dcbc0048ca2cf # v1.28.2
191+
uses: crate-ci/typos@d1c850b2b5d502763520c25fb4a6a1128ad99bd9 # v1.28.3
192192
with:
193193
config: .github/workflows/typos.toml
194194

@@ -630,11 +630,8 @@ jobs:
630630
working-directory: site
631631

632632
test-e2e:
633-
# test-e2e fails on 2-core 8GB runners, so we use the 4-core 16GB runner
634633
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-4' || 'ubuntu-latest' }}
635634
needs: changes
636-
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
637-
timeout-minutes: 20
638635
strategy:
639636
fail-fast: false
640637
matrix:
@@ -643,6 +640,9 @@ jobs:
643640
name: test-e2e
644641
- premium: true
645642
name: test-e2e-premium
643+
# Skip test-e2e on forks as they don't have access to CI secrets
644+
if: (needs.changes.outputs.go == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main') && !(github.event.pull_request.head.repo.fork)
645+
timeout-minutes: 20
646646
name: ${{ matrix.variant.name }}
647647
steps:
648648
- name: Harden Runner
@@ -749,7 +749,7 @@ jobs:
749749
# Prevent excessive build runs on minor version changes
750750
skip: "@(renovate/**|dependabot/**)"
751751
# Run TurboSnap to trace file dependencies to related stories
752-
# and tell chromatic to only take snapshots of relevent stories
752+
# and tell chromatic to only take snapshots of relevant stories
753753
onlyChanged: true
754754
# Avoid uploading single files, because that's very slow
755755
zip: true
@@ -776,7 +776,7 @@ jobs:
776776
workingDir: "./site"
777777
storybookBaseDir: "./site"
778778
# Run TurboSnap to trace file dependencies to related stories
779-
# and tell chromatic to only take snapshots of relevent stories
779+
# and tell chromatic to only take snapshots of relevant stories
780780
onlyChanged: true
781781
# Avoid uploading single files, because that's very slow
782782
zip: true
@@ -895,7 +895,7 @@ jobs:
895895
needs: changes
896896
# We always build the dylibs on Go changes to verify we're not merging unbuildable code,
897897
# but they need only be signed and uploaded on coder/coder main.
898-
if: needs.changes.outputs.docs-only == 'false' || github.ref == 'refs/heads/main'
898+
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
899899
runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest' }}
900900
steps:
901901
- name: Harden Runner
@@ -976,7 +976,7 @@ jobs:
976976
- changes
977977
- build-dylib
978978
if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork
979-
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
979+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-22.04' }}
980980
permissions:
981981
packages: write # Needed to push images to ghcr.io
982982
env:

.github/workflows/contrib.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ jobs:
4141

4242
cla:
4343
runs-on: ubuntu-latest
44+
permissions:
45+
pull-requests: write
4446
steps:
4547
- name: Harden Runner
4648
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
@@ -53,7 +55,7 @@ jobs:
5355
env:
5456
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5557
# the below token should have repo scope and must be manually added by you in the repository's secret
56-
PERSONAL_ACCESS_TOKEN: ${{ secrets.CDRCOMMUNITY_GITHUB_TOKEN }}
58+
PERSONAL_ACCESS_TOKEN: ${{ secrets.CDRCI2_GITHUB_TOKEN }}
5759
with:
5860
remote-organization-name: "coder"
5961
remote-repository-name: "cla"

.github/workflows/dogfood.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
uses: depot/setup-action@b0b1ea4f69e92ebf5dea3f8713a1b0c37b2126a5 # v1.6.0
5151

5252
- name: Set up Docker Buildx
53-
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
53+
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
5454

5555
- name: Login to DockerHub
5656
if: github.ref == 'refs/heads/main'

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ jobs:
4747

4848
# Upload the results to GitHub's code scanning dashboard.
4949
- name: "Upload to code-scanning"
50-
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
50+
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
5151
with:
5252
sarif_file: results.sarif

.github/workflows/security.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: ./.github/actions/setup-go
3939

4040
- name: Initialize CodeQL
41-
uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
41+
uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
4242
with:
4343
languages: go, javascript
4444

@@ -48,7 +48,7 @@ jobs:
4848
rm Makefile
4949
5050
- name: Perform CodeQL Analysis
51-
uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
51+
uses: github/codeql-action/analyze@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
5252

5353
- name: Send Slack notification on failure
5454
if: ${{ failure() }}
@@ -144,7 +144,7 @@ jobs:
144144
severity: "CRITICAL,HIGH"
145145

146146
- name: Upload Trivy scan results to GitHub Security tab
147-
uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6
147+
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
148148
with:
149149
sarif_file: trivy-results.sarif
150150
category: "Trivy"

.github/workflows/weekly-docs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ permissions:
1515

1616
jobs:
1717
check-docs:
18-
runs-on: ubuntu-latest
18+
# later versions of Ubuntu have disabled unprivileged user namespaces, which are required by the action
19+
runs-on: ubuntu-22.04
1920
permissions:
2021
pull-requests: write # required to post PR review comments by the action
2122
steps:

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,9 @@ vpn/vpn.pb.go: vpn/vpn.proto
640640
./vpn/vpn.proto
641641

642642
site/src/api/typesGenerated.ts: $(wildcard scripts/apitypings/*) $(shell find ./codersdk $(FIND_EXCLUSIONS) -type f -name '*.go')
643-
go run ./scripts/apitypings/ > $@
643+
# -C sets the directory for the go run command
644+
go run -C ./scripts/apitypings main.go > $@
645+
(cd ./site && npx biome format --write ./src/api/typesGenerated.ts)
644646
./scripts/pnpm_install.sh
645647

646648
site/e2e/provisionerGenerated.ts: provisionerd/proto/provisionerd.pb.go provisionersdk/proto/provisioner.pb.go

cli/testdata/coder_list_--output_json.golden

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@
5050
"deadline": "[timestamp]",
5151
"max_deadline": null,
5252
"status": "running",
53-
"daily_cost": 0
53+
"daily_cost": 0,
54+
"matched_provisioners": {
55+
"count": 0,
56+
"available": 0,
57+
"most_recently_seen": null
58+
}
5459
},
5560
"outdated": false,
5661
"name": "test-workspace",

cmd/coder/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
"os"
66
_ "time/tzdata"
77

8+
tea "github.com/charmbracelet/bubbletea"
9+
810
"github.com/coder/coder/v2/agent/agentexec"
911
"github.com/coder/coder/v2/cli"
1012
)
@@ -15,6 +17,9 @@ func main() {
1517
_, _ = fmt.Fprintln(os.Stderr, err)
1618
os.Exit(1)
1719
}
20+
// This preserves backwards compatibility with an init function that is causing grief for
21+
// web terminals using agent-exec + screen. See https://github.com/coder/coder/pull/15817
22+
tea.InitTerminal()
1823
var rootCmd cli.RootCmd
1924
rootCmd.RunWithSubcommands(rootCmd.AGPL())
2025
}

coderd/apidoc/docs.go

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/autobuild/lifecycle_executor.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package autobuild
33
import (
44
"context"
55
"database/sql"
6+
"fmt"
67
"net/http"
78
"sync"
89
"sync/atomic"
@@ -177,6 +178,15 @@ func (e *Executor) runOnce(t time.Time) Stats {
177178
err := e.db.InTx(func(tx database.Store) error {
178179
var err error
179180

181+
ok, err := tx.TryAcquireLock(e.ctx, database.GenLockID(fmt.Sprintf("lifecycle-executor:%s", wsID)))
182+
if err != nil {
183+
return xerrors.Errorf("try acquire lifecycle executor lock: %w", err)
184+
}
185+
if !ok {
186+
log.Debug(e.ctx, "unable to acquire lock for workspace, skipping")
187+
return nil
188+
}
189+
180190
// Re-check eligibility since the first check was outside the
181191
// transaction and the workspace settings may have changed.
182192
ws, err = tx.GetWorkspaceByID(e.ctx, wsID)
@@ -389,7 +399,7 @@ func (e *Executor) runOnce(t time.Time) Stats {
389399
}
390400
return nil
391401
}()
392-
if err != nil {
402+
if err != nil && !xerrors.Is(err, context.Canceled) {
393403
log.Error(e.ctx, "failed to transition workspace", slog.Error(err))
394404
statsMu.Lock()
395405
stats.Errors[wsID] = err

0 commit comments

Comments
 (0)