Skip to content

Commit c5bacc6

Browse files
committed
Merge remote-tracking branch 'origin/main' into stevenmasley/select_agent
2 parents 712906e + 6e49607 commit c5bacc6

37 files changed

+1011
-654
lines changed

.github/workflows/coder.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,14 @@ jobs:
661661
DEBUG: pw:api
662662
working-directory: site
663663

664+
- name: Upload Playwright Failed Tests
665+
if: always() && github.actor != 'dependabot[bot]' && runner.os == 'Linux' && !github.event.pull_request.head.repo.fork
666+
uses: actions/upload-artifact@v3
667+
with:
668+
name: failed-test-videos
669+
path: ./site/test-results/**/*.webm
670+
retention:days: 7
671+
664672
- name: Upload DataDog Trace
665673
if: always() && github.actor != 'dependabot[bot]' && runner.os == 'Linux' && !github.event.pull_request.head.repo.fork
666674
env:

.github/workflows/stale.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,5 @@ jobs:
3131
isn't more activity.
3232
# Upped from 30 since we have a big tracker and was hitting the limit.
3333
operations-per-run: 60
34-
close-issue-reason: not_planned
3534
# Start with the oldest issues, always.
3635
ascending: true

cli/list.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ func workspaceListRowFromWorkspace(now time.Time, usersByID map[uuid.UUID]coders
5757
}
5858

5959
func list() *cobra.Command {
60-
var columns []string
60+
var (
61+
columns []string
62+
searchQuery string
63+
me bool
64+
)
6165
cmd := &cobra.Command{
6266
Annotations: workspaceCommand,
6367
Use: "list",
@@ -69,7 +73,17 @@ func list() *cobra.Command {
6973
if err != nil {
7074
return err
7175
}
72-
workspaces, err := client.Workspaces(cmd.Context(), codersdk.WorkspaceFilter{})
76+
filter := codersdk.WorkspaceFilter{
77+
FilterQuery: searchQuery,
78+
}
79+
if me {
80+
myUser, err := client.User(cmd.Context(), codersdk.Me)
81+
if err != nil {
82+
return err
83+
}
84+
filter.Owner = myUser.Username
85+
}
86+
workspaces, err := client.Workspaces(cmd.Context(), filter)
7387
if err != nil {
7488
return err
7589
}
@@ -106,5 +120,7 @@ func list() *cobra.Command {
106120
}
107121
cmd.Flags().StringArrayVarP(&columns, "column", "c", nil,
108122
"Specify a column to filter in the table.")
123+
cmd.Flags().StringVar(&searchQuery, "search", "", "Search for a workspace with a query.")
124+
cmd.Flags().BoolVar(&me, "me", false, "Only show workspaces owned by the current user.")
109125
return cmd
110126
}

coderd/authorize.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import (
1010
"github.com/coder/coder/coderd/rbac"
1111
)
1212

13-
func AuthorizeFilter[O rbac.Objecter](api *API, r *http.Request, action rbac.Action, objects []O) ([]O, error) {
13+
func AuthorizeFilter[O rbac.Objecter](h *HTTPAuthorizer, r *http.Request, action rbac.Action, objects []O) ([]O, error) {
1414
roles := httpmw.AuthorizationUserRoles(r)
15-
objects, err := rbac.Filter(r.Context(), api.Authorizer, roles.ID.String(), roles.Roles, action, objects)
15+
objects, err := rbac.Filter(r.Context(), h.Authorizer, roles.ID.String(), roles.Roles, action, objects)
1616
if err != nil {
1717
// Log the error as Filter should not be erroring.
18-
api.Logger.Error(r.Context(), "filter failed",
18+
h.Logger.Error(r.Context(), "filter failed",
1919
slog.Error(err),
2020
slog.F("user_id", roles.ID),
2121
slog.F("username", roles.Username),

0 commit comments

Comments
 (0)