Skip to content

Commit 7f3602e

Browse files
committed
Merge branch 'main' into edit-and-delete-orgs
2 parents 4ee37e2 + f23d480 commit 7f3602e

File tree

90 files changed

+2640
-427
lines changed

Some content is hidden

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

90 files changed

+2640
-427
lines changed

.github/actions/setup-tf/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ runs:
77
- name: Install Terraform
88
uses: hashicorp/setup-terraform@v3
99
with:
10-
terraform_version: 1.6.6
10+
terraform_version: 1.7.5
1111
terraform_wrapper: false

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@ coderd/database/querier.go: coderd/database/sqlc.yaml coderd/database/dump.sql $
558558
coderd/database/dbmock/dbmock.go: coderd/database/db.go coderd/database/querier.go
559559
go generate ./coderd/database/dbmock/
560560

561+
coderd/database/pubsub/psmock/psmock.go: coderd/database/pubsub/pubsub.go
562+
go generate ./coderd/database/pubsub/psmock
563+
561564
tailnet/tailnettest/coordinatormock.go tailnet/tailnettest/multiagentmock.go tailnet/tailnettest/coordinateemock.go: tailnet/coordinator.go tailnet/multiagent.go
562565
go generate ./tailnet/tailnettest/
563566

@@ -794,8 +797,11 @@ test-postgres: test-postgres-docker
794797
test-migrations: test-postgres-docker
795798
echo "--- test migrations"
796799
set -euo pipefail
797-
COMMIT_FROM=$(shell git rev-parse --short HEAD)
798-
COMMIT_TO=$(shell git rev-parse --short main)
800+
COMMIT_FROM=$(shell git log -1 --format='%h' HEAD)
801+
echo "COMMIT_FROM=$${COMMIT_FROM}"
802+
COMMIT_TO=$(shell git log -1 --format='%h' origin/main)
803+
echo "COMMIT_TO=$${COMMIT_TO}"
804+
if [[ "$${COMMIT_FROM}" == "$${COMMIT_TO}" ]]; then echo "Nothing to do!"; exit 0; fi
799805
echo "DROP DATABASE IF EXISTS migrate_test_$${COMMIT_FROM}; CREATE DATABASE migrate_test_$${COMMIT_FROM};" | psql 'postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable'
800806
go run ./scripts/migrate-test/main.go --from="$$COMMIT_FROM" --to="$$COMMIT_TO" --postgres-url="postgresql://postgres:postgres@localhost:5432/migrate_test_$${COMMIT_FROM}?sslmode=disable"
801807

coderd/apidoc/docs.go

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

coderd/apidoc/swagger.json

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

coderd/audit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ func (api *API) convertAuditLog(ctx context.Context, dblog database.GetAuditLogs
196196
CreatedAt: dblog.UserCreatedAt.Time,
197197
Status: codersdk.UserStatus(dblog.UserStatus.UserStatus),
198198
},
199-
Roles: []codersdk.Role{},
199+
Roles: []codersdk.SlimRole{},
200200
}
201201

202202
for _, roleName := range dblog.UserRoles {
203203
rbacRole, _ := rbac.RoleByName(roleName)
204-
user.Roles = append(user.Roles, db2sdk.Role(rbacRole))
204+
user.Roles = append(user.Roles, db2sdk.SlimRole(rbacRole))
205205
}
206206
}
207207

coderd/coderd.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import (
6161
"github.com/coder/coder/v2/coderd/provisionerdserver"
6262
"github.com/coder/coder/v2/coderd/rbac"
6363
"github.com/coder/coder/v2/coderd/rbac/policy"
64+
"github.com/coder/coder/v2/coderd/rbac/rolestore"
6465
"github.com/coder/coder/v2/coderd/schedule"
6566
"github.com/coder/coder/v2/coderd/telemetry"
6667
"github.com/coder/coder/v2/coderd/tracing"
@@ -631,6 +632,7 @@ func New(options *Options) *API {
631632
httpmw.AttachRequestID,
632633
httpmw.ExtractRealIP(api.RealIPConfig),
633634
httpmw.Logger(api.Logger),
635+
rolestore.CustomRoleMW,
634636
prometheusMW,
635637
// Build-Version is helpful for debugging.
636638
func(next http.Handler) http.Handler {
@@ -917,7 +919,7 @@ func New(options *Options) *API {
917919
r.Post("/logout", api.postLogout)
918920
// These routes query information about site wide roles.
919921
r.Route("/roles", func(r chi.Router) {
920-
r.Get("/", api.assignableSiteRoles)
922+
r.Get("/", api.AssignableSiteRoles)
921923
})
922924
r.Route("/{user}", func(r chi.Router) {
923925
r.Use(httpmw.ExtractUserParam(options.Database))

0 commit comments

Comments
 (0)