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

feat: add 'hidden' option to 'coder_app' to hide app from UI#14570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DanielleMaywood merged 10 commits intomainfromdm-allow-hide-coder_app-button
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
758 changes: 384 additions & 374 deletionsagent/proto/agent.pb.go
View file
Open in desktop

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletionsagent/proto/agent.proto
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -41,6 +41,7 @@ message WorkspaceApp {
UNHEALTHY = 4;
}
Health health = 12;
bool hidden = 13;
}

message WorkspaceAgentScript {
Expand Down
1 change: 1 addition & 0 deletionscoderd/agentapi/manifest.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -229,5 +229,6 @@ func dbAppToProto(dbApp database.WorkspaceApp, agent database.WorkspaceAgent, ow
Threshold: dbApp.HealthcheckThreshold,
},
Health: agentproto.WorkspaceApp_Health(healthRaw),
Hidden: dbApp.Hidden,
}, nil
}
5 changes: 5 additions & 0 deletionscoderd/agentapi/manifest_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -87,6 +87,7 @@ func TestGetManifest(t *testing.T) {
Subdomain: false,
SharingLevel: database.AppSharingLevelPublic,
Health: database.WorkspaceAppHealthDisabled,
Hidden: false,
},
{
ID: uuid.New(),
Expand All@@ -102,6 +103,7 @@ func TestGetManifest(t *testing.T) {
HealthcheckUrl: "http://localhost:4321/health",
HealthcheckInterval: 20,
HealthcheckThreshold: 5,
Hidden: true,
},
}
scripts = []database.WorkspaceAgentScript{
Expand DownExpand Up@@ -182,6 +184,7 @@ func TestGetManifest(t *testing.T) {
Threshold: apps[0].HealthcheckThreshold,
},
Health: agentproto.WorkspaceApp_HEALTHY,
Hidden: false,
},
{
Id: apps[1].ID[:],
Expand All@@ -200,6 +203,7 @@ func TestGetManifest(t *testing.T) {
Threshold: 0,
},
Health: agentproto.WorkspaceApp_DISABLED,
Hidden: false,
},
{
Id: apps[2].ID[:],
Expand All@@ -218,6 +222,7 @@ func TestGetManifest(t *testing.T) {
Threshold: apps[2].HealthcheckThreshold,
},
Health: agentproto.WorkspaceApp_UNHEALTHY,
Hidden: true,
},
}
protoScripts = []*agentproto.WorkspaceAgentScript{
Expand Down
3 changes: 3 additions & 0 deletionscoderd/apidoc/docs.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

3 changes: 3 additions & 0 deletionscoderd/apidoc/swagger.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

1 change: 1 addition & 0 deletionscoderd/database/db2sdk/db2sdk.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -517,6 +517,7 @@ func Apps(dbApps []database.WorkspaceApp, agent database.WorkspaceAgent, ownerNa
Threshold: dbApp.HealthcheckThreshold,
},
Health: codersdk.WorkspaceAppHealth(dbApp.Health),
Hidden: dbApp.Hidden,
})
}
return apps
Expand Down
1 change: 1 addition & 0 deletionscoderd/database/dbgen/dbgen.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -547,6 +547,7 @@ func WorkspaceApp(t testing.TB, db database.Store, orig database.WorkspaceApp) d
HealthcheckThreshold: takeFirst(orig.HealthcheckThreshold, 60),
Health: takeFirst(orig.Health, database.WorkspaceAppHealthHealthy),
DisplayOrder: takeFirst(orig.DisplayOrder, 1),
Hidden: orig.Hidden,
})
require.NoError(t, err, "insert app")
return resource
Expand Down
1 change: 1 addition & 0 deletionscoderd/database/dbmem/dbmem.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7291,6 +7291,7 @@ func (q *FakeQuerier) InsertWorkspaceApp(_ context.Context, arg database.InsertW
HealthcheckInterval: arg.HealthcheckInterval,
HealthcheckThreshold: arg.HealthcheckThreshold,
Health: arg.Health,
Hidden: arg.Hidden,
DisplayOrder: arg.DisplayOrder,
}
q.workspaceApps = append(q.workspaceApps, workspaceApp)
Expand Down
5 changes: 4 additions & 1 deletioncoderd/database/dump.sql
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
ALTER TABLE workspace_apps DROP COLUMN hidden;
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
ALTER TABLE workspace_apps ADD COLUMN hidden boolean NOT NULL DEFAULT false;

COMMENT ON COLUMN workspace_apps.hidden
IS 'Determines if the app is not shown in user interfaces.'
2 changes: 2 additions & 0 deletionscoderd/database/models.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

20 changes: 14 additions & 6 deletionscoderd/database/queries.sql.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

5 changes: 3 additions & 2 deletionscoderd/database/queries/workspaceapps.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,10 +28,11 @@ INSERT INTO
healthcheck_interval,
healthcheck_threshold,
health,
display_order
display_order,
hidden
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) RETURNING *;
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17) RETURNING *;

-- name: UpdateWorkspaceAppHealthByID :exec
UPDATE
Expand Down
1 change: 1 addition & 0 deletionscoderd/provisionerdserver/provisionerdserver.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1918,6 +1918,7 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.
HealthcheckThreshold: app.Healthcheck.Threshold,
Health: health,
DisplayOrder: int32(app.Order),
Hidden: app.Hidden,
})
if err != nil {
return xerrors.Errorf("insert app: %w", err)
Expand Down
2 changes: 2 additions & 0 deletionscodersdk/agentsdk/convert.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -245,6 +245,7 @@ func AppFromProto(protoApp *proto.WorkspaceApp) (codersdk.WorkspaceApp, error) {
Threshold: protoApp.Healthcheck.Threshold,
},
Health: health,
Hidden: protoApp.Hidden,
}, nil
}

Expand DownExpand Up@@ -274,6 +275,7 @@ func ProtoFromApp(a codersdk.WorkspaceApp) (*proto.WorkspaceApp, error) {
Threshold: a.Healthcheck.Threshold,
},
Health: proto.WorkspaceApp_Health(health),
Hidden: a.Hidden,
}, nil
}

Expand Down
2 changes: 2 additions & 0 deletionscodersdk/agentsdk/convert_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,6 +44,7 @@ func TestManifest(t *testing.T) {
Threshold: 55555666,
},
Health: codersdk.WorkspaceAppHealthHealthy,
Hidden: false,
},
{
ID: uuid.New(),
Expand All@@ -62,6 +63,7 @@ func TestManifest(t *testing.T) {
Threshold: 22555666,
},
Health: codersdk.WorkspaceAppHealthInitializing,
Hidden: true,
},
},
DERPMap: &tailcfg.DERPMap{
Expand Down
1 change: 1 addition & 0 deletionscodersdk/workspaceapps.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,7 @@ type WorkspaceApp struct {
// Healthcheck specifies the configuration for checking app health.
Healthcheck Healthcheck `json:"healthcheck"`
Health WorkspaceAppHealth `json:"health"`
Hidden bool `json:"hidden"`
}

type Healthcheck struct {
Expand Down
1 change: 1 addition & 0 deletionsdocs/reference/api/agents.md
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

8 changes: 8 additions & 0 deletionsdocs/reference/api/builds.md
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp