Skip to content

Commit 47a6551

Browse files
authored
Merge branch 'main' into atif/coder-desktop-docs
2 parents d0f71d3 + 7c66dcd commit 47a6551

File tree

72 files changed

+3326
-693
lines changed

Some content is hidden

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

72 files changed

+3326
-693
lines changed

.github/.linkspector.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ ignorePatterns:
2525
- pattern: "docs.github.com"
2626
- pattern: "claude.ai"
2727
- pattern: "splunk.com"
28+
- pattern: "stackoverflow.com/questions"
2829
aliveStatusCodes:
2930
- 200

.github/workflows/release.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,29 @@ jobs:
634634
- name: ls build
635635
run: ls -lh build
636636

637+
- name: Publish Coder CLI binaries and detached signatures to GCS
638+
if: ${{ !inputs.dry_run && github.ref == 'refs/heads/main' && github.repository_owner == 'coder'}}
639+
run: |
640+
set -euxo pipefail
641+
642+
version="$(./scripts/version.sh)"
643+
644+
binaries=(
645+
"coder-darwin-amd64"
646+
"coder-darwin-arm64"
647+
"coder-linux-amd64"
648+
"coder-linux-arm64"
649+
"coder-linux-armv7"
650+
"coder-windows-amd64.exe"
651+
"coder-windows-arm64.exe"
652+
)
653+
654+
for binary in "${binaries[@]}"; do
655+
detached_signature="${binary}.asc"
656+
gcloud storage cp "./site/out/bin/${binary}" "gs://releases.coder.com/coder-cli/${version}/${binary}"
657+
gcloud storage cp "./site/out/bin/${detached_signature}" "gs://releases.coder.com/coder-cli/${version}/${detached_signature}"
658+
done
659+
637660
- name: Publish release
638661
run: |
639662
set -euo pipefail

CODEOWNERS

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
# These APIs are versioned, so any changes need to be carefully reviewed for whether
2-
# to bump API major or minor versions.
1+
# These APIs are versioned, so any changes need to be carefully reviewed for
2+
# whether to bump API major or minor versions.
33
agent/proto/ @spikecurtis @johnstcn
4+
provisionerd/proto/ @spikecurtis @johnstcn
5+
provisionersdk/proto/ @spikecurtis @johnstcn
46
tailnet/proto/ @spikecurtis @johnstcn
57
vpn/vpn.proto @spikecurtis @johnstcn
68
vpn/version.go @spikecurtis @johnstcn
7-
provisionerd/proto/ @spikecurtis @johnstcn
8-
provisionersdk/proto/ @spikecurtis @johnstcn
9+
10+
11+
# This caching code is particularly tricky, and one must be very careful when
12+
# altering it.
13+
coderd/files/ @aslilac
14+
15+
16+
site/ @aslilac

agent/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ type Client interface {
9898
ConnectRPC26(ctx context.Context) (
9999
proto.DRPCAgentClient26, tailnetproto.DRPCTailnetClient26, error,
100100
)
101-
RewriteDERPMap(derpMap *tailcfg.DERPMap)
101+
tailnet.DERPMapRewriter
102102
}
103103

104104
type Agent interface {

agent/agentcontainers/api_test.go

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,15 +358,22 @@ func TestAPI(t *testing.T) {
358358
fakeCLI = &fakeContainerCLI{
359359
listErr: firstErr,
360360
}
361+
fWatcher = newFakeWatcher(t)
361362
)
362363

363364
api := agentcontainers.NewAPI(logger,
365+
agentcontainers.WithWatcher(fWatcher),
364366
agentcontainers.WithClock(mClock),
365367
agentcontainers.WithContainerCLI(fakeCLI),
366368
)
367369
api.Start()
368370
defer api.Close()
369371

372+
// The watcherLoop writes a log when it is initialized.
373+
// We want to ensure this has happened before we start
374+
// the test so that it does not intefere.
375+
fWatcher.waitNext(ctx)
376+
370377
// Make sure the ticker function has been registered
371378
// before advancing the clock.
372379
tickerTrap.MustWait(ctx).MustRelease(ctx)
@@ -2883,8 +2890,12 @@ func TestAPI(t *testing.T) {
28832890
Op: fsnotify.Write,
28842891
})
28852892

2886-
err = api.RefreshContainers(ctx)
2887-
require.NoError(t, err)
2893+
require.Eventuallyf(t, func() bool {
2894+
err = api.RefreshContainers(ctx)
2895+
require.NoError(t, err)
2896+
2897+
return len(fakeSAC.agents) == 1
2898+
}, testutil.WaitShort, testutil.IntervalFast, "subagent should be created after config change")
28882899

28892900
t.Log("Phase 2: Cont, waiting for sub agent to exit")
28902901
exitSubAgentOnce.Do(func() {
@@ -2919,8 +2930,12 @@ func TestAPI(t *testing.T) {
29192930
Op: fsnotify.Write,
29202931
})
29212932

2922-
err = api.RefreshContainers(ctx)
2923-
require.NoError(t, err)
2933+
require.Eventuallyf(t, func() bool {
2934+
err = api.RefreshContainers(ctx)
2935+
require.NoError(t, err)
2936+
2937+
return len(fakeSAC.agents) == 0
2938+
}, testutil.WaitShort, testutil.IntervalFast, "subagent should be deleted after config change")
29242939

29252940
req = httptest.NewRequest(http.MethodGet, "/", nil).WithContext(ctx)
29262941
rec = httptest.NewRecorder()

cli/delete_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,6 @@ func TestDelete(t *testing.T) {
233233
t.Skip("this test requires postgres")
234234
}
235235

236-
clock := quartz.NewMock(t)
237-
ctx := testutil.Context(t, testutil.WaitSuperLong)
238-
239236
// Setup
240237
db, pb := dbtestutil.NewDB(t, dbtestutil.WithDumpOnFailure())
241238
client, _ := coderdtest.NewWithProvisionerCloser(t, &coderdtest.Options{
@@ -301,6 +298,9 @@ func TestDelete(t *testing.T) {
301298
t.Run(tc.name, func(t *testing.T) {
302299
t.Parallel()
303300

301+
clock := quartz.NewMock(t)
302+
ctx := testutil.Context(t, testutil.WaitSuperLong)
303+
304304
// Create one prebuilt workspace (owned by system user) and one normal workspace (owned by a user)
305305
// Each workspace is persisted in the DB along with associated workspace jobs and builds.
306306
dbPrebuiltWorkspace := setupTestDBWorkspace(t, clock, db, pb, orgID, database.PrebuildsSystemUserID, template.ID, version.ID, preset.ID)

cli/testdata/coder_list_--output_json.golden

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"automatic_updates": "never",
8787
"allow_renames": false,
8888
"favorite": false,
89-
"next_start_at": "====[timestamp]====="
89+
"next_start_at": "====[timestamp]=====",
90+
"is_prebuild": false
9091
}
9192
]

coderd/apidoc/docs.go

Lines changed: 34 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 34 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/coderd.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ func New(options *Options) *API {
790790
SessionTokenFunc: nil, // Default behavior
791791
PostAuthAdditionalHeadersFunc: options.PostAuthAdditionalHeadersFunc,
792792
Logger: options.Logger,
793+
AccessURL: options.AccessURL,
793794
})
794795
// Same as above but it redirects to the login page.
795796
apiKeyMiddlewareRedirect := httpmw.ExtractAPIKeyMW(httpmw.ExtractAPIKeyConfig{
@@ -801,6 +802,7 @@ func New(options *Options) *API {
801802
SessionTokenFunc: nil, // Default behavior
802803
PostAuthAdditionalHeadersFunc: options.PostAuthAdditionalHeadersFunc,
803804
Logger: options.Logger,
805+
AccessURL: options.AccessURL,
804806
})
805807
// Same as the first but it's optional.
806808
apiKeyMiddlewareOptional := httpmw.ExtractAPIKeyMW(httpmw.ExtractAPIKeyConfig{
@@ -812,6 +814,7 @@ func New(options *Options) *API {
812814
SessionTokenFunc: nil, // Default behavior
813815
PostAuthAdditionalHeadersFunc: options.PostAuthAdditionalHeadersFunc,
814816
Logger: options.Logger,
817+
AccessURL: options.AccessURL,
815818
})
816819

817820
workspaceAgentInfo := httpmw.ExtractWorkspaceAgentAndLatestBuild(httpmw.ExtractWorkspaceAgentAndLatestBuildConfig{

0 commit comments

Comments
 (0)