Skip to content

Commit 67cdad5

Browse files
committed
Merge branch 'main' into TECHNOFAB11/main
2 parents 9d2b35a + fbdbc8a commit 67cdad5

File tree

162 files changed

+4475
-2760
lines changed

Some content is hidden

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

162 files changed

+4475
-2760
lines changed

.github/actions/setup-go/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ runs:
77
- uses: buildjet/setup-go@v4
88
with:
99
cache: true
10-
go-version: "~1.20"
10+
go-version: "1.20.5"
1111
- name: Install gotestsum
1212
uses: jaxxstorm/action-install-gh-release@v1.10.0
1313
with:

.github/dependabot.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ updates:
4747
interval: "weekly"
4848
time: "06:00"
4949
timezone: "America/Chicago"
50+
commit-message:
51+
prefix: "chore"
52+
labels: []
5053
ignore:
5154
# We need to coordinate terraform updates with the version hardcoded in
5255
# our Go code.
@@ -86,3 +89,26 @@ updates:
8689
ignore:
8790
# We likely want to update this ourselves.
8891
- dependency-name: "coder/coder"
92+
93+
# Update dogfood.
94+
- package-ecosystem: "docker"
95+
directory: "/dogfood/"
96+
schedule:
97+
interval: "weekly"
98+
time: "06:00"
99+
timezone: "America/Chicago"
100+
commit-message:
101+
prefix: "chore"
102+
labels: []
103+
104+
- package-ecosystem: "terraform"
105+
directory: "/dogfood/"
106+
schedule:
107+
interval: "weekly"
108+
time: "06:00"
109+
timezone: "America/Chicago"
110+
commit-message:
111+
prefix: "chore"
112+
labels: []
113+
ignore:
114+
- dependency-name: "coder/coder"

.github/workflows/dogfood.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ on:
66
- main
77
paths:
88
- "dogfood/**"
9+
- ".github/workflows/dogfood.yaml"
910
# Uncomment these lines when testing with CI.
1011
# pull_request:
1112
# paths:
1213
# - "dogfood/**"
14+
# - ".github/workflows/dogfood.yaml"
1315
workflow_dispatch:
1416

1517
jobs:
1618
deploy_image:
17-
runs-on: ubuntu-latest
19+
runs-on: buildjet-4vcpu-ubuntu-2204
1820
steps:
1921
- name: Get branch name
2022
id: branch-name
@@ -57,14 +59,13 @@ jobs:
5759
- name: Get short commit SHA
5860
id: vars
5961
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
60-
- name: "Install latest Coder"
62+
- name: "Get latest Coder binary from the server"
6163
run: |
62-
curl -L https://coder.com/install.sh | sh
63-
# env:
64-
# VERSION: 0.x
64+
curl -fsSL "https://dev.coder.com/bin/coder-linux-amd64" -o "./coder"
65+
chmod +x "./coder"
6566
- name: "Push template"
6667
run: |
67-
coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION
68+
./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION
6869
env:
6970
# Consumed by Coder CLI
7071
CODER_URL: https://dev.coder.com

.github/workflows/release.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ on:
66
- "v*"
77
workflow_dispatch:
88
inputs:
9-
go_version:
10-
description: "Go version to use for building."
11-
required: false
12-
default: "1.20.4"
139
dry_run:
1410
description: Perform a dry-run release (devel). Note that ref must be an annotated tag when run without dry-run.
1511
type: boolean
@@ -35,7 +31,7 @@ env:
3531
# For some reason, setup-go won't actually pick up a new patch version if
3632
# it has an old one cached. We need to manually specify the versions so we
3733
# can get the latest release. Never use "~1.xx" here!
38-
CODER_GO_VERSION: "1.20.4"
34+
CODER_GO_VERSION: "1.20.5"
3935

4036
jobs:
4137
release:
@@ -98,10 +94,7 @@ jobs:
9894
username: ${{ github.actor }}
9995
password: ${{ secrets.GITHUB_TOKEN }}
10096

101-
- uses: buildjet/setup-go@v4
102-
with:
103-
go-version: ${{ env.CODER_GO_VERSION }}
104-
cache: true
97+
- uses: ./.github/actions/setup-go
10598

10699
- name: Cache Node
107100
id: cache-node

.github/workflows/security.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2020

2121
env:
22-
CODER_GO_VERSION: "1.20.4"
22+
CODER_GO_VERSION: "1.20.5"
2323

2424
jobs:
2525
codeql:
@@ -32,10 +32,7 @@ jobs:
3232
with:
3333
languages: go, javascript
3434

35-
- name: Setup Go
36-
uses: buildjet/setup-go@v4
37-
with:
38-
go-version: ${{ env.CODER_GO_VERSION }}
35+
- uses: ./.github/actions/setup-go
3936

4037
# Workaround to prevent CodeQL from building the dashboard.
4138
- name: Remove Makefile
@@ -63,10 +60,7 @@ jobs:
6360
with:
6461
fetch-depth: 0
6562

66-
- uses: buildjet/setup-go@v4
67-
with:
68-
go-version: ${{ env.CODER_GO_VERSION }}
69-
cache: true
63+
- uses: ./.github/actions/setup-go
7064

7165
- name: Cache Node
7266
id: cache-node

.github/workflows/cron-weekly.yaml renamed to .github/workflows/weekly-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Weekly Cron
1+
name: weekly-docs
22
# runs every monday at 9 am
33
on:
44
schedule:

cli/cliui/agent.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func Agent(ctx context.Context, writer io.Writer, opts AgentOptions) error {
4848
// We don't take the fast path for opts.NoWait yet because we want to
4949
// show the message.
5050
if agent.Status == codersdk.WorkspaceAgentConnected &&
51-
(agent.LoginBeforeReady || agent.LifecycleState == codersdk.WorkspaceAgentLifecycleReady) {
51+
(agent.StartupScriptBehavior == codersdk.WorkspaceAgentStartupScriptBehaviorNonBlocking || agent.LifecycleState == codersdk.WorkspaceAgentLifecycleReady) {
5252
return nil
5353
}
5454

@@ -96,7 +96,7 @@ func Agent(ctx context.Context, writer io.Writer, opts AgentOptions) error {
9696
// we do this just before starting the spinner to avoid needless
9797
// spinning.
9898
if agent.Status == codersdk.WorkspaceAgentConnected &&
99-
!agent.LoginBeforeReady && opts.NoWait {
99+
agent.StartupScriptBehavior == codersdk.WorkspaceAgentStartupScriptBehaviorBlocking && opts.NoWait {
100100
showMessage()
101101
return nil
102102
}
@@ -140,7 +140,7 @@ func Agent(ctx context.Context, writer io.Writer, opts AgentOptions) error {
140140
// NOTE(mafredri): Once we have access to the workspace agent's
141141
// startup script logs, we can show them here.
142142
// https://github.com/coder/coder/issues/2957
143-
if !agent.LoginBeforeReady && !opts.NoWait {
143+
if agent.StartupScriptBehavior == codersdk.WorkspaceAgentStartupScriptBehaviorBlocking && !opts.NoWait {
144144
switch agent.LifecycleState {
145145
case codersdk.WorkspaceAgentLifecycleReady:
146146
return nil
@@ -179,7 +179,7 @@ type message struct {
179179

180180
func waitingMessage(agent codersdk.WorkspaceAgent, opts AgentOptions) (m *message) {
181181
m = &message{
182-
Spin: fmt.Sprintf("Waiting for connection from %s...", Styles.Field.Render(agent.Name)),
182+
Spin: fmt.Sprintf("Waiting for connection from %s...", DefaultStyles.Field.Render(agent.Name)),
183183
Prompt: "Don't panic, your workspace is booting up!",
184184
}
185185
defer func() {
@@ -192,7 +192,7 @@ func waitingMessage(agent codersdk.WorkspaceAgent, opts AgentOptions) (m *messag
192192

193193
// We don't want to wrap the troubleshooting URL, so we'll handle word
194194
// wrapping ourselves (vs using lipgloss).
195-
w := wordwrap.NewWriter(Styles.Paragraph.GetWidth() - Styles.Paragraph.GetMarginLeft()*2)
195+
w := wordwrap.NewWriter(DefaultStyles.Paragraph.GetWidth() - DefaultStyles.Paragraph.GetMarginLeft()*2)
196196
w.Breakpoints = []rune{' ', '\n'}
197197

198198
_, _ = fmt.Fprint(w, m.Prompt)
@@ -208,7 +208,7 @@ func waitingMessage(agent codersdk.WorkspaceAgent, opts AgentOptions) (m *messag
208208
// We want to prefix the prompt with a caret, but we want text on the
209209
// following lines to align with the text on the first line (i.e. added
210210
// spacing).
211-
ind := " " + Styles.Prompt.String()
211+
ind := " " + DefaultStyles.Prompt.String()
212212
iw := indent.NewWriter(1, func(w io.Writer) {
213213
_, _ = w.Write([]byte(ind))
214214
ind = " " // Set indentation to space after initial prompt.
@@ -223,7 +223,7 @@ func waitingMessage(agent codersdk.WorkspaceAgent, opts AgentOptions) (m *messag
223223
case codersdk.WorkspaceAgentDisconnected:
224224
m.Prompt = "The workspace agent lost connection!"
225225
case codersdk.WorkspaceAgentConnected:
226-
m.Spin = fmt.Sprintf("Waiting for %s to become ready...", Styles.Field.Render(agent.Name))
226+
m.Spin = fmt.Sprintf("Waiting for %s to become ready...", DefaultStyles.Field.Render(agent.Name))
227227
m.Prompt = "Don't panic, your workspace agent has connected and the workspace is getting ready!"
228228
if opts.NoWait {
229229
m.Prompt = "Your workspace is still getting ready, it may be in an incomplete state."

cli/cliui/agent_test.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ func TestAgent(t *testing.T) {
3030
WorkspaceName: "example",
3131
Fetch: func(_ context.Context) (codersdk.WorkspaceAgent, error) {
3232
agent := codersdk.WorkspaceAgent{
33-
Status: codersdk.WorkspaceAgentDisconnected,
34-
LoginBeforeReady: true,
33+
Status: codersdk.WorkspaceAgentDisconnected,
34+
StartupScriptBehavior: codersdk.WorkspaceAgentStartupScriptBehaviorNonBlocking,
3535
}
3636
if disconnected.Load() {
3737
agent.Status = codersdk.WorkspaceAgentConnected
@@ -73,9 +73,9 @@ func TestAgent_TimeoutWithTroubleshootingURL(t *testing.T) {
7373
WorkspaceName: "example",
7474
Fetch: func(_ context.Context) (codersdk.WorkspaceAgent, error) {
7575
agent := codersdk.WorkspaceAgent{
76-
Status: codersdk.WorkspaceAgentConnecting,
77-
TroubleshootingURL: wantURL,
78-
LoginBeforeReady: true,
76+
Status: codersdk.WorkspaceAgentConnecting,
77+
TroubleshootingURL: wantURL,
78+
StartupScriptBehavior: codersdk.WorkspaceAgentStartupScriptBehaviorNonBlocking,
7979
}
8080
switch {
8181
case !connected.Load() && timeout.Load():
@@ -124,10 +124,10 @@ func TestAgent_StartupTimeout(t *testing.T) {
124124
WorkspaceName: "example",
125125
Fetch: func(_ context.Context) (codersdk.WorkspaceAgent, error) {
126126
agent := codersdk.WorkspaceAgent{
127-
Status: codersdk.WorkspaceAgentConnecting,
128-
LoginBeforeReady: false,
129-
LifecycleState: codersdk.WorkspaceAgentLifecycleCreated,
130-
TroubleshootingURL: wantURL,
127+
Status: codersdk.WorkspaceAgentConnecting,
128+
StartupScriptBehavior: codersdk.WorkspaceAgentStartupScriptBehaviorBlocking,
129+
LifecycleState: codersdk.WorkspaceAgentLifecycleCreated,
130+
TroubleshootingURL: wantURL,
131131
}
132132

133133
if s := status.Load(); s != "" {
@@ -183,10 +183,10 @@ func TestAgent_StartErrorExit(t *testing.T) {
183183
WorkspaceName: "example",
184184
Fetch: func(_ context.Context) (codersdk.WorkspaceAgent, error) {
185185
agent := codersdk.WorkspaceAgent{
186-
Status: codersdk.WorkspaceAgentConnecting,
187-
LoginBeforeReady: false,
188-
LifecycleState: codersdk.WorkspaceAgentLifecycleCreated,
189-
TroubleshootingURL: wantURL,
186+
Status: codersdk.WorkspaceAgentConnecting,
187+
StartupScriptBehavior: codersdk.WorkspaceAgentStartupScriptBehaviorBlocking,
188+
LifecycleState: codersdk.WorkspaceAgentLifecycleCreated,
189+
TroubleshootingURL: wantURL,
190190
}
191191

192192
if s := status.Load(); s != "" {
@@ -239,10 +239,10 @@ func TestAgent_NoWait(t *testing.T) {
239239
WorkspaceName: "example",
240240
Fetch: func(_ context.Context) (codersdk.WorkspaceAgent, error) {
241241
agent := codersdk.WorkspaceAgent{
242-
Status: codersdk.WorkspaceAgentConnecting,
243-
LoginBeforeReady: false,
244-
LifecycleState: codersdk.WorkspaceAgentLifecycleCreated,
245-
TroubleshootingURL: wantURL,
242+
Status: codersdk.WorkspaceAgentConnecting,
243+
StartupScriptBehavior: codersdk.WorkspaceAgentStartupScriptBehaviorBlocking,
244+
LifecycleState: codersdk.WorkspaceAgentLifecycleCreated,
245+
TroubleshootingURL: wantURL,
246246
}
247247

248248
if s := status.Load(); s != "" {
@@ -292,7 +292,7 @@ func TestAgent_NoWait(t *testing.T) {
292292
require.NoError(t, <-done, "ready - should exit early")
293293
}
294294

295-
func TestAgent_LoginBeforeReadyEnabled(t *testing.T) {
295+
func TestAgent_StartupScriptBehaviorNonBlocking(t *testing.T) {
296296
t.Parallel()
297297

298298
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
@@ -309,10 +309,10 @@ func TestAgent_LoginBeforeReadyEnabled(t *testing.T) {
309309
WorkspaceName: "example",
310310
Fetch: func(_ context.Context) (codersdk.WorkspaceAgent, error) {
311311
agent := codersdk.WorkspaceAgent{
312-
Status: codersdk.WorkspaceAgentConnecting,
313-
LoginBeforeReady: true,
314-
LifecycleState: codersdk.WorkspaceAgentLifecycleCreated,
315-
TroubleshootingURL: wantURL,
312+
Status: codersdk.WorkspaceAgentConnecting,
313+
StartupScriptBehavior: codersdk.WorkspaceAgentStartupScriptBehaviorNonBlocking,
314+
LifecycleState: codersdk.WorkspaceAgentLifecycleCreated,
315+
TroubleshootingURL: wantURL,
316316
}
317317

318318
if s := status.Load(); s != "" {

0 commit comments

Comments
 (0)