Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit22ace04

Browse files
authored
Merge branch 'main' into mafredri/feat-cli-add-exp-tasks-delete
2 parents9924b8e +29a7313 commit22ace04

File tree

147 files changed

+3942
-8295
lines changed

Some content is hidden

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

147 files changed

+3942
-8295
lines changed

‎.devcontainer/scripts/post_create.sh‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/bin/sh
22

33
install_devcontainer_cli() {
4-
npm install -g @devcontainers/cli@0.80.0 --integrity=sha512-w2EaxgjyeVGyzfA/KUEZBhyXqu/5PyWNXcnrXsZOBrt3aN2zyGiHrXoG54TF6K0b5DSCF01Rt5fnIyrCeFzFKw==
4+
set -e
5+
echo"🔧 Installing DevContainer CLI..."
6+
cd"$(dirname"$0")/../tools/devcontainer-cli"
7+
npm ci --omit=dev
8+
ln -sf"$(pwd)/node_modules/.bin/devcontainer""$(npm config get prefix)/bin/devcontainer"
59
}
610

711
install_ssh_config() {

‎.devcontainer/tools/devcontainer-cli/package-lock.json‎

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name":"devcontainer-cli",
3+
"private":true,
4+
"version":"1.0.0",
5+
"dependencies": {
6+
"@devcontainers/cli":"^0.80.0"
7+
}
8+
}

‎.github/dependabot.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ updates:
3333
-dependency-name:"*"
3434
update-types:
3535
-version-update:semver-patch
36+
-dependency-name:"github.com/mark3labs/mcp-go"
3637

3738
# Update our Dockerfile.
3839
-package-ecosystem:"docker"

‎.github/workflows/release.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
runs-on:${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
3838
steps:
3939
-name:Allow only maintainers/admins
40-
uses:actions/github-script@v7.0.1
40+
uses:actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea#v7.0.1
4141
with:
4242
github-token:${{ secrets.GITHUB_TOKEN }}
4343
script:|

‎cli/exp_scaletest.go‎

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,7 @@ func (r *RootCmd) scaletestWorkspaceTraffic() *serpent.Command {
864864
tickInterval time.Duration
865865
bytesPerTickint64
866866
sshbool
867+
disableDirectbool
867868
useHostLoginbool
868869
appstring
869870
templatestring
@@ -1023,15 +1024,16 @@ func (r *RootCmd) scaletestWorkspaceTraffic() *serpent.Command {
10231024

10241025
// Setup our workspace agent connection.
10251026
config:= workspacetraffic.Config{
1026-
AgentID:agent.ID,
1027-
BytesPerTick:bytesPerTick,
1028-
Duration:strategy.timeout,
1029-
TickInterval:tickInterval,
1030-
ReadMetrics:metrics.ReadMetrics(ws.OwnerName,ws.Name,agent.Name),
1031-
WriteMetrics:metrics.WriteMetrics(ws.OwnerName,ws.Name,agent.Name),
1032-
SSH:ssh,
1033-
Echo:ssh,
1034-
App:appConfig,
1027+
AgentID:agent.ID,
1028+
BytesPerTick:bytesPerTick,
1029+
Duration:strategy.timeout,
1030+
TickInterval:tickInterval,
1031+
ReadMetrics:metrics.ReadMetrics(ws.OwnerName,ws.Name,agent.Name),
1032+
WriteMetrics:metrics.WriteMetrics(ws.OwnerName,ws.Name,agent.Name),
1033+
SSH:ssh,
1034+
DisableDirect:disableDirect,
1035+
Echo:ssh,
1036+
App:appConfig,
10351037
}
10361038

10371039
ifwebClient!=nil {
@@ -1117,6 +1119,13 @@ func (r *RootCmd) scaletestWorkspaceTraffic() *serpent.Command {
11171119
Description:"Send traffic over SSH, cannot be used with --app.",
11181120
Value:serpent.BoolOf(&ssh),
11191121
},
1122+
{
1123+
Flag:"disable-direct",
1124+
Env:"CODER_SCALETEST_WORKSPACE_TRAFFIC_DISABLE_DIRECT_CONNECTIONS",
1125+
Default:"false",
1126+
Description:"Disable direct connections for SSH traffic to workspaces. Does nothing if `--ssh` is not also set.",
1127+
Value:serpent.BoolOf(&disableDirect),
1128+
},
11201129
{
11211130
Flag:"app",
11221131
Env:"CODER_SCALETEST_WORKSPACE_TRAFFIC_APP",

‎cli/exp_task_status_test.go‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,16 @@ STATE CHANGED STATUS STATE MESSAGE
188188
"id": "11111111-1111-1111-1111-111111111111",
189189
"organization_id": "00000000-0000-0000-0000-000000000000",
190190
"owner_id": "00000000-0000-0000-0000-000000000000",
191+
"owner_name": "",
191192
"name": "",
192193
"template_id": "00000000-0000-0000-0000-000000000000",
194+
"template_name": "",
195+
"template_display_name": "",
196+
"template_icon": "",
193197
"workspace_id": null,
198+
"workspace_agent_id": null,
199+
"workspace_agent_lifecycle": null,
200+
"workspace_agent_health": null,
194201
"initial_prompt": "",
195202
"status": "running",
196203
"current_state": {
@@ -236,13 +243,12 @@ STATE CHANGED STATUS STATE MESSAGE
236243
ctx=testutil.Context(t,testutil.WaitShort)
237244
now=time.Now().UTC()// TODO: replace with quartz
238245
srv=httptest.NewServer(http.HandlerFunc(tc.hf(ctx,now)))
239-
client=new(codersdk.Client)
246+
client=codersdk.New(testutil.MustURL(t,srv.URL))
240247
sb= strings.Builder{}
241248
args= []string{"exp","task","status","--watch-interval",testutil.IntervalFast.String()}
242249
)
243250

244251
t.Cleanup(srv.Close)
245-
client.URL=testutil.MustURL(t,srv.URL)
246252
args=append(args,tc.args...)
247253
inv,root:=clitest.New(t,args...)
248254
inv.Stdout=&sb

‎cli/exp_taskcreate_test.go‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ import (
55
"fmt"
66
"net/http"
77
"net/http/httptest"
8-
"net/url"
98
"strings"
109
"testing"
1110
"time"
1211

1312
"github.com/google/uuid"
1413
"github.com/stretchr/testify/assert"
15-
"github.com/stretchr/testify/require"
1614

1715
"github.com/coder/coder/v2/cli/clitest"
1816
"github.com/coder/coder/v2/cli/cliui"
@@ -236,17 +234,14 @@ func TestTaskCreate(t *testing.T) {
236234
var (
237235
ctx=testutil.Context(t,testutil.WaitShort)
238236
srv=httptest.NewServer(tt.handler(t,ctx))
239-
client=new(codersdk.Client)
237+
client=codersdk.New(testutil.MustURL(t,srv.URL))
240238
args= []string{"exp","task","create"}
241239
sb strings.Builder
242240
errerror
243241
)
244242

245243
t.Cleanup(srv.Close)
246244

247-
client.URL,err=url.Parse(srv.URL)
248-
require.NoError(t,err)
249-
250245
inv,root:=clitest.New(t,append(args,tt.args...)...)
251246
inv.Environ=serpent.ParseEnviron(tt.env,"")
252247
inv.Stdout=&sb

‎cli/root.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,9 @@ func (r *RootCmd) HeaderTransport(ctx context.Context, serverURL *url.URL) (*cod
635635
}
636636

637637
func (r*RootCmd)configureClient(ctx context.Context,client*codersdk.Client,serverURL*url.URL,inv*serpent.Invocation)error {
638+
ifclient.SessionTokenProvider==nil {
639+
client.SessionTokenProvider= codersdk.FixedSessionTokenProvider{}
640+
}
638641
transport:=http.DefaultTransport
639642
transport=wrapTransportWithTelemetryHeader(transport,inv)
640643
if!r.noVersionCheck {

‎cli/server.go‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ import (
6262
"github.com/coder/serpent"
6363
"github.com/coder/wgtunnel/tunnelsdk"
6464

65-
"github.com/coder/coder/v2/coderd/entitlements"
66-
"github.com/coder/coder/v2/coderd/notifications/reports"
67-
"github.com/coder/coder/v2/coderd/runtimeconfig"
68-
"github.com/coder/coder/v2/coderd/webpush"
69-
"github.com/coder/coder/v2/codersdk/drpcsdk"
70-
7165
"github.com/coder/coder/v2/buildinfo"
7266
"github.com/coder/coder/v2/cli/clilog"
7367
"github.com/coder/coder/v2/cli/cliui"
@@ -83,25 +77,31 @@ import (
8377
"github.com/coder/coder/v2/coderd/database/migrations"
8478
"github.com/coder/coder/v2/coderd/database/pubsub"
8579
"github.com/coder/coder/v2/coderd/devtunnel"
80+
"github.com/coder/coder/v2/coderd/entitlements"
8681
"github.com/coder/coder/v2/coderd/externalauth"
8782
"github.com/coder/coder/v2/coderd/gitsshkey"
8883
"github.com/coder/coder/v2/coderd/httpmw"
8984
"github.com/coder/coder/v2/coderd/jobreaper"
9085
"github.com/coder/coder/v2/coderd/notifications"
86+
"github.com/coder/coder/v2/coderd/notifications/reports"
9187
"github.com/coder/coder/v2/coderd/oauthpki"
9288
"github.com/coder/coder/v2/coderd/prometheusmetrics"
9389
"github.com/coder/coder/v2/coderd/prometheusmetrics/insights"
9490
"github.com/coder/coder/v2/coderd/promoauth"
91+
"github.com/coder/coder/v2/coderd/provisionerdserver"
92+
"github.com/coder/coder/v2/coderd/runtimeconfig"
9593
"github.com/coder/coder/v2/coderd/schedule"
9694
"github.com/coder/coder/v2/coderd/telemetry"
9795
"github.com/coder/coder/v2/coderd/tracing"
9896
"github.com/coder/coder/v2/coderd/updatecheck"
9997
"github.com/coder/coder/v2/coderd/util/ptr"
10098
"github.com/coder/coder/v2/coderd/util/slice"
10199
stringutil"github.com/coder/coder/v2/coderd/util/strings"
100+
"github.com/coder/coder/v2/coderd/webpush"
102101
"github.com/coder/coder/v2/coderd/workspaceapps/appurl"
103102
"github.com/coder/coder/v2/coderd/workspacestats"
104103
"github.com/coder/coder/v2/codersdk"
104+
"github.com/coder/coder/v2/codersdk/drpcsdk"
105105
"github.com/coder/coder/v2/cryptorand"
106106
"github.com/coder/coder/v2/provisioner/echo"
107107
"github.com/coder/coder/v2/provisioner/terraform"
@@ -280,6 +280,12 @@ func enablePrometheus(
280280
}
281281
}
282282

283+
provisionerdserverMetrics:=provisionerdserver.NewMetrics(logger)
284+
iferr:=provisionerdserverMetrics.Register(options.PrometheusRegistry);err!=nil {
285+
returnnil,xerrors.Errorf("failed to register provisionerd_server metrics: %w",err)
286+
}
287+
options.ProvisionerdServerMetrics=provisionerdserverMetrics
288+
283289
//nolint:revive
284290
returnServeHandler(
285291
ctx,logger,promhttp.InstrumentMetricHandler(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp