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

Commitb80f149

Browse files
DanielleMaywoodEmyrk
authored andcommitted
feat: add 'hidden' option to 'coder_app' to hide app from UI (#14570)
Add 'hidden' property to 'coder_app' resource to allow hiding apps from the UI.
1 parent0dd2c9d commitb80f149

36 files changed

+846
-694
lines changed

‎agent/proto/agent.pb.go

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

‎agent/proto/agent.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ message WorkspaceApp {
4141
UNHEALTHY=4;
4242
}
4343
Healthhealth=12;
44+
boolhidden=13;
4445
}
4546

4647
messageWorkspaceAgentScript {

‎coderd/agentapi/manifest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,6 @@ func dbAppToProto(dbApp database.WorkspaceApp, agent database.WorkspaceAgent, ow
229229
Threshold:dbApp.HealthcheckThreshold,
230230
},
231231
Health:agentproto.WorkspaceApp_Health(healthRaw),
232+
Hidden:dbApp.Hidden,
232233
},nil
233234
}

‎coderd/agentapi/manifest_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ func TestGetManifest(t *testing.T) {
8787
Subdomain:false,
8888
SharingLevel:database.AppSharingLevelPublic,
8989
Health:database.WorkspaceAppHealthDisabled,
90+
Hidden:false,
9091
},
9192
{
9293
ID:uuid.New(),
@@ -102,6 +103,7 @@ func TestGetManifest(t *testing.T) {
102103
HealthcheckUrl:"http://localhost:4321/health",
103104
HealthcheckInterval:20,
104105
HealthcheckThreshold:5,
106+
Hidden:true,
105107
},
106108
}
107109
scripts= []database.WorkspaceAgentScript{
@@ -182,6 +184,7 @@ func TestGetManifest(t *testing.T) {
182184
Threshold:apps[0].HealthcheckThreshold,
183185
},
184186
Health:agentproto.WorkspaceApp_HEALTHY,
187+
Hidden:false,
185188
},
186189
{
187190
Id:apps[1].ID[:],
@@ -200,6 +203,7 @@ func TestGetManifest(t *testing.T) {
200203
Threshold:0,
201204
},
202205
Health:agentproto.WorkspaceApp_DISABLED,
206+
Hidden:false,
203207
},
204208
{
205209
Id:apps[2].ID[:],
@@ -218,6 +222,7 @@ func TestGetManifest(t *testing.T) {
218222
Threshold:apps[2].HealthcheckThreshold,
219223
},
220224
Health:agentproto.WorkspaceApp_UNHEALTHY,
225+
Hidden:true,
221226
},
222227
}
223228
protoScripts= []*agentproto.WorkspaceAgentScript{

‎coderd/apidoc/docs.go

Lines changed: 3 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: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/db2sdk/db2sdk.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ func Apps(dbApps []database.WorkspaceApp, agent database.WorkspaceAgent, ownerNa
517517
Threshold:dbApp.HealthcheckThreshold,
518518
},
519519
Health:codersdk.WorkspaceAppHealth(dbApp.Health),
520+
Hidden:dbApp.Hidden,
520521
})
521522
}
522523
returnapps

‎coderd/database/dbgen/dbgen.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ func WorkspaceApp(t testing.TB, db database.Store, orig database.WorkspaceApp) d
547547
HealthcheckThreshold:takeFirst(orig.HealthcheckThreshold,60),
548548
Health:takeFirst(orig.Health,database.WorkspaceAppHealthHealthy),
549549
DisplayOrder:takeFirst(orig.DisplayOrder,1),
550+
Hidden:orig.Hidden,
550551
})
551552
require.NoError(t,err,"insert app")
552553
returnresource

‎coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7313,6 +7313,7 @@ func (q *FakeQuerier) InsertWorkspaceApp(_ context.Context, arg database.InsertW
73137313
HealthcheckInterval:arg.HealthcheckInterval,
73147314
HealthcheckThreshold:arg.HealthcheckThreshold,
73157315
Health:arg.Health,
7316+
Hidden:arg.Hidden,
73167317
DisplayOrder:arg.DisplayOrder,
73177318
}
73187319
q.workspaceApps=append(q.workspaceApps,workspaceApp)

‎coderd/database/dump.sql

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTERTABLE workspace_apps DROP COLUMN hidden;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ALTERTABLE workspace_apps ADD COLUMN hiddenbooleanNOT NULL DEFAULT false;
2+
3+
COMMENTON COLUMNworkspace_apps.hidden
4+
IS'Determines if the app is not shown in user interfaces.'

‎coderd/database/models.go

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

‎coderd/database/queries.sql.go

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

‎coderd/database/queries/workspaceapps.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ INSERT INTO
2828
healthcheck_interval,
2929
healthcheck_threshold,
3030
health,
31-
display_order
31+
display_order,
32+
hidden
3233
)
3334
VALUES
34-
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) RETURNING*;
35+
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17) RETURNING*;
3536

3637
-- name: UpdateWorkspaceAppHealthByID :exec
3738
UPDATE

‎coderd/provisionerdserver/provisionerdserver.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,6 +1918,7 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.
19181918
HealthcheckThreshold:app.Healthcheck.Threshold,
19191919
Health:health,
19201920
DisplayOrder:int32(app.Order),
1921+
Hidden:app.Hidden,
19211922
})
19221923
iferr!=nil {
19231924
returnxerrors.Errorf("insert app: %w",err)

‎codersdk/agentsdk/convert.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ func AppFromProto(protoApp *proto.WorkspaceApp) (codersdk.WorkspaceApp, error) {
245245
Threshold:protoApp.Healthcheck.Threshold,
246246
},
247247
Health:health,
248+
Hidden:protoApp.Hidden,
248249
},nil
249250
}
250251

@@ -274,6 +275,7 @@ func ProtoFromApp(a codersdk.WorkspaceApp) (*proto.WorkspaceApp, error) {
274275
Threshold:a.Healthcheck.Threshold,
275276
},
276277
Health:proto.WorkspaceApp_Health(health),
278+
Hidden:a.Hidden,
277279
},nil
278280
}
279281

‎codersdk/agentsdk/convert_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func TestManifest(t *testing.T) {
4444
Threshold:55555666,
4545
},
4646
Health:codersdk.WorkspaceAppHealthHealthy,
47+
Hidden:false,
4748
},
4849
{
4950
ID:uuid.New(),
@@ -62,6 +63,7 @@ func TestManifest(t *testing.T) {
6263
Threshold:22555666,
6364
},
6465
Health:codersdk.WorkspaceAppHealthInitializing,
66+
Hidden:true,
6567
},
6668
},
6769
DERPMap:&tailcfg.DERPMap{

‎codersdk/workspaceapps.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ type WorkspaceApp struct {
6161
// Healthcheck specifies the configuration for checking app health.
6262
HealthcheckHealthcheck`json:"healthcheck"`
6363
HealthWorkspaceAppHealth`json:"health"`
64+
Hiddenbool`json:"hidden"`
6465
}
6566

6667
typeHealthcheckstruct {

‎docs/reference/api/agents.md

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

‎docs/reference/api/builds.md

Lines changed: 8 additions & 0 deletions
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