Skip to content

Commit 8a94b72

Browse files
feat: Allow hide resources (#3977)
1 parent f6aa025 commit 8a94b72

Some content is hidden

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

44 files changed

+458
-335
lines changed

coderd/database/databasefake/databasefake.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,7 @@ func (q *fakeQuerier) InsertWorkspaceResource(_ context.Context, arg database.In
17671767
Transition: arg.Transition,
17681768
Type: arg.Type,
17691769
Name: arg.Name,
1770+
Hide: arg.Hide,
17701771
}
17711772
q.provisionerJobResources = append(q.provisionerJobResources, resource)
17721773
return resource, nil

coderd/database/dump.sql

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing 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+
ALTER TABLE workspace_resources
2+
DROP COLUMN hide;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE workspace_resources
2+
ADD COLUMN hide boolean DEFAULT false NOT NULL;

coderd/database/models.go

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

coderd/database/queries.sql.go

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/workspaceresources.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ SELECT * FROM workspace_resources WHERE created_at > $1;
1919

2020
-- name: InsertWorkspaceResource :one
2121
INSERT INTO
22-
workspace_resources (id, created_at, job_id, transition, type, name)
22+
workspace_resources (id, created_at, job_id, transition, type, name, hide)
2323
VALUES
24-
($1, $2, $3, $4, $5, $6) RETURNING *;
24+
($1, $2, $3, $4, $5, $6, $7) RETURNING *;
2525

2626
-- name: GetWorkspaceResourceMetadataByResourceID :many
2727
SELECT

coderd/provisionerdaemons.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ func insertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.
752752
Transition: transition,
753753
Type: protoResource.Type,
754754
Name: protoResource.Name,
755+
Hide: protoResource.Hide,
755756
})
756757
if err != nil {
757758
return xerrors.Errorf("insert provisioner job resource %q: %w", protoResource.Name, err)

coderd/workspacebuilds.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ func convertWorkspaceResource(resource database.WorkspaceResource, agents []code
698698
Transition: codersdk.WorkspaceTransition(resource.Transition),
699699
Type: resource.Type,
700700
Name: resource.Name,
701+
Hide: resource.Hide,
701702
Agents: agents,
702703
Metadata: convertedMetadata,
703704
}

codersdk/workspaceresources.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type WorkspaceResource struct {
2525
Transition WorkspaceTransition `json:"workspace_transition"`
2626
Type string `json:"type"`
2727
Name string `json:"name"`
28+
Hide bool `json:"hide"`
2829
Agents []WorkspaceAgent `json:"agents,omitempty"`
2930
Metadata []WorkspaceResourceMetadata `json:"metadata,omitempty"`
3031
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy