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

Commite3545c5

Browse files
committed
Merge branch 'main' into lilac/load-terraform-modules
2 parentsf90c8e0 +64807e1 commite3545c5

File tree

82 files changed

+4709
-557
lines changed

Some content is hidden

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

82 files changed

+4709
-557
lines changed

‎agent/agent.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ type Options struct {
8989
ServiceBannerRefreshInterval time.Duration
9090
BlockFileTransferbool
9191
Execer agentexec.Execer
92+
SubAgentbool
9293

9394
ExperimentalDevcontainersEnabledbool
9495
ContainerAPIOptions []agentcontainers.Option// Enable ExperimentalDevcontainersEnabled for these to be effective.
@@ -190,6 +191,8 @@ func New(options Options) Agent {
190191
metrics:newAgentMetrics(prometheusRegistry),
191192
execer:options.Execer,
192193

194+
subAgent:options.SubAgent,
195+
193196
experimentalDevcontainersEnabled:options.ExperimentalDevcontainersEnabled,
194197
containerAPIOptions:options.ContainerAPIOptions,
195198
}
@@ -272,6 +275,8 @@ type agent struct {
272275
metrics*agentMetrics
273276
execer agentexec.Execer
274277

278+
subAgentbool
279+
275280
experimentalDevcontainersEnabledbool
276281
containerAPIOptions []agentcontainers.Option
277282
containerAPI atomic.Pointer[agentcontainers.API]// Set by apiHandler.

‎agent/agenttest/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func NewClient(t testing.TB,
6060
err=agentproto.DRPCRegisterAgent(mux,fakeAAPI)
6161
require.NoError(t,err)
6262
server:=drpcserver.NewWithOptions(mux, drpcserver.Options{
63+
Manager:drpcsdk.DefaultDRPCOptions(nil),
6364
Log:func(errerror) {
6465
ifxerrors.Is(err,io.EOF) {
6566
return

‎cli/agent.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
5353
blockFileTransferbool
5454
agentHeaderCommandstring
5555
agentHeader []string
56+
subAgentbool
5657

5758
experimentalDevcontainersEnabledbool
5859
)
@@ -350,6 +351,7 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
350351
PrometheusRegistry:prometheusRegistry,
351352
BlockFileTransfer:blockFileTransfer,
352353
Execer:execer,
354+
SubAgent:subAgent,
353355

354356
ExperimentalDevcontainersEnabled:experimentalDevcontainersEnabled,
355357
})
@@ -481,6 +483,17 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
481483
Description:"Allow the agent to automatically detect running devcontainers.",
482484
Value:serpent.BoolOf(&experimentalDevcontainersEnabled),
483485
},
486+
{
487+
Flag:"is-sub-agent",
488+
Default:"false",
489+
Env:"CODER_AGENT_IS_SUB_AGENT",
490+
Description:"Specify whether this is a sub agent or not.",
491+
Value:serpent.BoolOf(&subAgent),
492+
// As `coderd` handles the creation of sub-agents, it does not make
493+
// sense for this to be exposed. We do not want people setting an
494+
// agent as a sub-agent if it is not.
495+
Hidden:true,
496+
},
484497
}
485498

486499
returncmd

‎coderd/agentapi/api.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"github.com/coder/coder/v2/coderd/wspubsub"
3131
"github.com/coder/coder/v2/codersdk"
3232
"github.com/coder/coder/v2/codersdk/agentsdk"
33+
"github.com/coder/coder/v2/codersdk/drpcsdk"
3334
"github.com/coder/coder/v2/tailnet"
3435
tailnetproto"github.com/coder/coder/v2/tailnet/proto"
3536
"github.com/coder/quartz"
@@ -209,6 +210,7 @@ func (a *API) Server(ctx context.Context) (*drpcserver.Server, error) {
209210

210211
returndrpcserver.NewWithOptions(&tracing.DRPCHandler{Handler:mux},
211212
drpcserver.Options{
213+
Manager:drpcsdk.DefaultDRPCOptions(nil),
212214
Log:func(errerror) {
213215
ifxerrors.Is(err,io.EOF) {
214216
return

‎coderd/apidoc/docs.go

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

‎coderd/apidoc/swagger.json

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

‎coderd/coderd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import (
3838
"tailscale.com/util/singleflight"
3939

4040
"cdr.dev/slog"
41+
"github.com/coder/coder/v2/codersdk/drpcsdk"
4142
"github.com/coder/quartz"
4243
"github.com/coder/serpent"
4344

@@ -84,7 +85,6 @@ import (
8485
"github.com/coder/coder/v2/coderd/workspaceapps"
8586
"github.com/coder/coder/v2/coderd/workspacestats"
8687
"github.com/coder/coder/v2/codersdk"
87-
"github.com/coder/coder/v2/codersdk/drpcsdk"
8888
"github.com/coder/coder/v2/codersdk/healthsdk"
8989
"github.com/coder/coder/v2/provisionerd/proto"
9090
"github.com/coder/coder/v2/provisionersdk"
@@ -1803,6 +1803,7 @@ func (api *API) CreateInMemoryTaggedProvisionerDaemon(dialCtx context.Context, n
18031803
}
18041804
server:=drpcserver.NewWithOptions(&tracing.DRPCHandler{Handler:mux},
18051805
drpcserver.Options{
1806+
Manager:drpcsdk.DefaultDRPCOptions(nil),
18061807
Log:func(errerror) {
18071808
ifxerrors.Is(err,io.EOF) {
18081809
return

‎coderd/database/dbgen/dbgen.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ func WorkspaceAgentPortShare(t testing.TB, db database.Store, orig database.Work
181181
funcWorkspaceAgent(t testing.TB,db database.Store,orig database.WorkspaceAgent) database.WorkspaceAgent {
182182
agt,err:=db.InsertWorkspaceAgent(genCtx, database.InsertWorkspaceAgentParams{
183183
ID:takeFirst(orig.ID,uuid.New()),
184+
ParentID:takeFirst(orig.ParentID, uuid.NullUUID{}),
184185
CreatedAt:takeFirst(orig.CreatedAt,dbtime.Now()),
185186
UpdatedAt:takeFirst(orig.UpdatedAt,dbtime.Now()),
186187
Name:takeFirst(orig.Name,testutil.GetRandomName(t)),

‎coderd/database/dbmem/dbmem.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,12 @@ func (q *FakeQuerier) getProvisionerJobsByIDsWithQueuePositionLockedGlobalQueue(
13801380
returnjobs,nil
13811381
}
13821382

1383+
// isDeprecated returns true if the template is deprecated.
1384+
// A template is considered deprecated when it has a deprecation message.
1385+
funcisDeprecated(template database.Template)bool {
1386+
returntemplate.Deprecated!=""
1387+
}
1388+
13831389
func (*FakeQuerier)AcquireLock(_ context.Context,_int64)error {
13841390
returnxerrors.New("AcquireLock must only be called within a transaction")
13851391
}
@@ -9570,6 +9576,7 @@ func (q *FakeQuerier) InsertWorkspaceAgent(_ context.Context, arg database.Inser
95709576

95719577
agent:= database.WorkspaceAgent{
95729578
ID:arg.ID,
9579+
ParentID:arg.ParentID,
95739580
CreatedAt:arg.CreatedAt,
95749581
UpdatedAt:arg.UpdatedAt,
95759582
ResourceID:arg.ResourceID,
@@ -13022,7 +13029,17 @@ func (q *FakeQuerier) GetAuthorizedTemplates(ctx context.Context, arg database.G
1302213029
ifarg.ExactName!=""&&!strings.EqualFold(template.Name,arg.ExactName) {
1302313030
continue
1302413031
}
13025-
ifarg.Deprecated.Valid&&arg.Deprecated.Bool== (template.Deprecated!="") {
13032+
// Filters templates based on the search query filter 'Deprecated' status
13033+
// Matching SQL logic:
13034+
// -- Filter by deprecated
13035+
// AND CASE
13036+
// WHEN :deprecated IS NOT NULL THEN
13037+
// CASE
13038+
// WHEN :deprecated THEN deprecated != ''
13039+
// ELSE deprecated = ''
13040+
// END
13041+
// ELSE true
13042+
ifarg.Deprecated.Valid&&arg.Deprecated.Bool!=isDeprecated(template) {
1302613043
continue
1302713044
}
1302813045
ifarg.FuzzyName!="" {

‎coderd/database/dump.sql

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

‎coderd/database/foreign_key_constraint.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTERTABLE workspace_agents
2+
DROP COLUMN IF EXISTS parent_id;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTERTABLE workspace_agents
2+
ADD COLUMN parent_id UUIDREFERENCES workspace_agents (id)ON DELETE CASCADE;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
UPDATE notification_templates
2+
SET name='Test Notification'
3+
WHERE id='c425f63e-716a-4bf4-ae24-78348f706c3f';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
UPDATE notification_templates
2+
SET name='Troubleshooting Notification'
3+
WHERE id='c425f63e-716a-4bf4-ae24-78348f706c3f';

‎coderd/database/models.go

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp