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

chore: implement oom/ood processing component#16436

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 44 commits intomainfromdm-internal-248
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
44 commits
Select commitHold shift + click to select a range
6c6240b
chore: add workspace reached resource threshold notification
DanielleMaywoodJan 24, 2025
b3081de
chore: split out into two notifications
DanielleMaywoodJan 30, 2025
a9c8676
chore: update golden files
DanielleMaywoodJan 30, 2025
1a84f96
chore: begin impl of processing logic for oom/ood
DanielleMaywoodJan 29, 2025
78ede46
chore: appease the linter for now
DanielleMaywoodJan 29, 2025
0d2b970
chore: use latest changes to #247, start debounce logic
DanielleMaywoodJan 30, 2025
0df2fd5
chore: add more tests
DanielleMaywoodJan 30, 2025
854d81a
chore: remove mock db for workspace monitor agentapi test
DanielleMaywoodJan 30, 2025
9d9d7b4
chore: remove todo comment
DanielleMaywoodJan 30, 2025
4c21ce7
Merge branch 'main' into dm-internal-247
DanielleMaywoodFeb 4, 2025
944fdb5
chore: rewrite ood notification
DanielleMaywoodFeb 4, 2025
6444176
chore: updaten golden file
DanielleMaywoodFeb 4, 2025
bc87268
chore: silly me
DanielleMaywoodFeb 4, 2025
d2265f6
chore: rename test
DanielleMaywoodFeb 4, 2025
82a9852
Merge branch 'dm-internal-247' into dm-internal-248
DanielleMaywoodFeb 4, 2025
62621d4
chore: add more tests, fix broken sql query
DanielleMaywoodFeb 4, 2025
81f43d3
Merge branch 'main' into dm-internal-248
DanielleMaywoodFeb 4, 2025
7522b37
chore: update to match main
DanielleMaywoodFeb 4, 2025
69c4f42
chore: run 'make gen'
DanielleMaywoodFeb 4, 2025
44ebf65
chore: run 'make fmt'
DanielleMaywoodFeb 5, 2025
714e743
chore: remove cruft
DanielleMaywoodFeb 5, 2025
7cf5212
chore: align interface
DanielleMaywoodFeb 5, 2025
d08e713
chore: add another test
DanielleMaywoodFeb 6, 2025
ed42eae
chore: improve volume monitor test
DanielleMaywoodFeb 6, 2025
1b0d0d2
chore: rename fields
DanielleMaywoodFeb 11, 2025
51b16c6
Merge branch 'main' into dm-internal-248
DanielleMaywoodFeb 11, 2025
4e43bab
chore: align with other branch
DanielleMaywoodFeb 11, 2025
4e144ae
Merge branch 'main' into dm-internal-248
DanielleMaywoodFeb 12, 2025
da25ecc
chore: bump migration number
DanielleMaywoodFeb 12, 2025
fe1e805
chore: add test and align better
DanielleMaywoodFeb 12, 2025
abbd522
chore: appease linter
DanielleMaywoodFeb 12, 2025
456989e
Merge branch 'main' into dm-internal-248
DanielleMaywoodFeb 14, 2025
1550cc6
chore: update rbac
DanielleMaywoodFeb 14, 2025
7998f89
chore: handle missing datapoints
DanielleMaywoodFeb 14, 2025
bda8f29
chore: add tests for unknown state on memory monitor
DanielleMaywoodFeb 14, 2025
9d662a3
chore: add tests for missing datapoints in volume monitors
DanielleMaywoodFeb 14, 2025
bff48dc
chore: add default debounce of 5 minutes
DanielleMaywoodFeb 14, 2025
c343a70
chore: implement feedback
DanielleMaywoodFeb 14, 2025
babc48f
chore: feedback
DanielleMaywoodFeb 17, 2025
01ca549
chore: feedback
DanielleMaywoodFeb 17, 2025
a975810
chore: forgot to run the linter
DanielleMaywoodFeb 17, 2025
ee35d85
chore: use percentages for alert config
DanielleMaywoodFeb 17, 2025
d2fa8df
Merge branch 'main' into dm-internal-248
DanielleMaywoodFeb 17, 2025
27d78d1
chore: fmt and bump migration number
DanielleMaywoodFeb 17, 2025
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
PrevPrevious commit
NextNext commit
chore: update rbac
  • Loading branch information
@DanielleMaywood
DanielleMaywood committedFeb 14, 2025
commit1550cc67322cd6521f957c2b0b798417e7b923a0
4 changes: 2 additions & 2 deletionscoderd/agentapi/resources_monitoring.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -136,7 +136,7 @@
debouncedUntil = a.Clock.Now().Add(a.Debounce)
}

err = a.Database.UpdateMemoryResourceMonitor(ctx, database.UpdateMemoryResourceMonitorParams{
err = a.Database.UpdateMemoryResourceMonitor(dbauthz.AsResourceMonitor(ctx), database.UpdateMemoryResourceMonitorParams{

Check failure on line 139 in coderd/agentapi/resources_monitoring.go

View workflow job for this annotation

GitHub Actions/ lint

ruleguard: Using 'AsResourceMonitor' is dangerous and should be accompanied by a comment explaining why it's ok and a nolint. (gocritic)
AgentID: a.AgentID,
State: newState,
UpdatedAt: dbtime.Time(a.Clock.Now()),
Expand DownExpand Up@@ -217,7 +217,7 @@
})
}

if err := a.Database.UpdateVolumeResourceMonitor(ctx, database.UpdateVolumeResourceMonitorParams{
if err := a.Database.UpdateVolumeResourceMonitor(dbauthz.AsResourceMonitor(ctx), database.UpdateVolumeResourceMonitorParams{

Check failure on line 220 in coderd/agentapi/resources_monitoring.go

View workflow job for this annotation

GitHub Actions/ lint

ruleguard: Using 'AsResourceMonitor' is dangerous and should be accompanied by a comment explaining why it's ok and a nolint. (gocritic)
AgentID: a.AgentID,
Path: monitor.Path,
State: newState,
Expand Down
24 changes: 24 additions & 0 deletionscoderd/database/dbauthz/dbauthz.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -289,6 +289,24 @@ var (
Scope: rbac.ScopeAll,
}.WithCachedASTValue()

subjectResourceMonitor = rbac.Subject{
FriendlyName: "Resource Monitor",
ID: uuid.Nil.String(),
Roles: rbac.Roles([]rbac.Role{
{
Identifier: rbac.RoleIdentifier{Name: "resourcemonitor"},
DisplayName: "Resource Monitor",
Site: rbac.Permissions(map[string][]policy.Action{
// The workspace monitor needs to be able to update monitors
rbac.ResourceWorkspaceAgentResourceMonitor.Type: {policy.ActionUpdate},
}),
Org: map[string][]rbac.Permission{},
User: []rbac.Permission{},
},
}),
Scope: rbac.ScopeAll,
}.WithCachedASTValue()

subjectSystemRestricted = rbac.Subject{
FriendlyName: "System",
ID: uuid.Nil.String(),
Expand DownExpand Up@@ -376,6 +394,12 @@ func AsNotifier(ctx context.Context) context.Context {
return context.WithValue(ctx, authContextKey{}, subjectNotifier)
}

// AsResourceMonitor returns a context with an actor that has permissions required for
// updating resource monitors.
func AsResourceMonitor(ctx context.Context) context.Context {
return context.WithValue(ctx, authContextKey{}, subjectResourceMonitor)
}

// AsSystemRestricted returns a context with an actor that has permissions
// required for various system operations (login, logout, metrics cache).
func AsSystemRestricted(ctx context.Context) context.Context {
Expand Down
1 change: 1 addition & 0 deletionscoderd/rbac/object_gen.go
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/rbac/policy/policy.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -306,6 +306,7 @@ var RBACPermissions = map[string]PermissionDefinition{
Actions: map[Action]ActionDefinition{
ActionRead: actDef("read workspace agent resource monitor"),
ActionCreate: actDef("create workspace agent resource monitor"),
ActionUpdate: actDef("update workspace agent resource monitor"),
},
},
}
2 changes: 1 addition & 1 deletioncoderd/rbac/roles_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -779,7 +779,7 @@ func TestRolePermissions(t *testing.T) {
},
{
Name: "ResourceMonitor",
Actions: []policy.Action{policy.ActionRead, policy.ActionCreate},
Actions: []policy.Action{policy.ActionRead, policy.ActionCreate, policy.ActionUpdate},
Resource: rbac.ResourceWorkspaceAgentResourceMonitor,
AuthorizeMap: map[bool][]hasAuthSubjects{
true: {owner},
Expand Down
2 changes: 1 addition & 1 deletioncodersdk/rbacresources_gen.go
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 deletionssite/src/api/rbacresourcesGenerated.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -171,6 +171,7 @@ export const RBACResourceActions: Partial<
workspace_agent_resource_monitor: {
create: "create workspace agent resource monitor",
read: "read workspace agent resource monitor",
update: "update workspace agent resource monitor",
},
workspace_dormant: {
application_connect: "connect to workspace apps via browser",
Expand Down
Loading

[8]ページ先頭

©2009-2026 Movatter.jp