Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions integration_tests/activitylog_filter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ Test.gql("Query activitylog list", function(t)
resourceType
resourceName
}
facets {
resourceTypes {
resourceType
count
}
}
}
}
}
Expand Down Expand Up @@ -129,6 +135,12 @@ Test.gql("Query activitylog list", function(t)
resourceName = "app",
},
},
facets = {
resourceTypes = {
{ resourceType = "APP", count = 1 },
{ resourceType = "VALKEY", count = 1 },
},
},
},
},
},
Expand Down
16 changes: 16 additions & 0 deletions integration_tests/reconcilers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ Test.gql("list reconcilers after modifications", function(t)
}
}
}
facets {
resourceTypes {
resourceType
count
}
}
}
name
enabled
Expand Down Expand Up @@ -315,6 +321,11 @@ Test.gql("list reconcilers after modifications", function(t)
},
},
},
facets = {
resourceTypes = {
{ resourceType = "RECONCILER", count = 3 },
},
},
},
name = "reconciler-1",
enabled = true,
Expand All @@ -324,6 +335,11 @@ Test.gql("list reconcilers after modifications", function(t)
nodes = {
{ message = "Disable reconciler" },
},
facets = {
resourceTypes = {
{ resourceType = "RECONCILER", count = 1 },
},
},
},
name = "reconciler-2",
enabled = false,
Expand Down
14 changes: 14 additions & 0 deletions integration_tests/serviceaccount_activitylog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ Test.gql("Team-scoped account only sees its own entries", function(t)
pageInfo {
totalCount
}
facets {
resourceTypes {
resourceType
count
}
}
}
}
}
Expand All @@ -150,6 +156,14 @@ Test.gql("Team-scoped account only sees its own entries", function(t)
pageInfo = {
totalCount = 2,
},
facets = {
resourceTypes = {
{
resourceType = "SERVICE_ACCOUNT",
count = 2,
},
},
},
},
},
},
Expand Down
94 changes: 93 additions & 1 deletion integration_tests/tenant_activitylog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,85 @@ Test.gql("Create repository event for team two", function(t)
}
end)

Helper.SQLExec([[
INSERT INTO activity_log_entries (actor, action, resource_type, resource_name, team_slug, environment, data)
VALUES ('deployer', 'DEPLOYMENT', 'APP', 'deployed-app', 'slug-1', 'dev', '{}')
]])

Test.gql("Tenant activity log includes deployments", function(t)
t.addHeader("x-user-email", admin:email())

t.query [[
query {
activityLog(first: 10, filter: { activityTypes: [DEPLOYMENT] }) {
nodes {
resourceName
}
pageInfo {
totalCount
}
facets {
activityTypes {
activityType
count
}
resourceTypes {
resourceType
count
}
environments {
value
count
}
}
}
}
]]

t.check {
data = {
activityLog = {
nodes = {
{
resourceName = "deployed-app",
},
},
pageInfo = {
totalCount = 1,
},
facets = {
activityTypes = {
{
activityType = "DEPLOYMENT",
count = 1,
},
{
activityType = "REPOSITORY_ADDED",
count = 0,
},
},
resourceTypes = {
{
resourceType = "APP",
count = 1,
},
{
resourceType = "REPOSITORY",
count = 0,
},
},
environments = {
{
value = "dev",
count = 1,
},
},
},
},
},
}
end)

Test.gql("Tenant activity log returns facets and pagination metadata", function(t)
t.addHeader("x-user-email", admin:email())

Expand Down Expand Up @@ -102,18 +181,31 @@ Test.gql("Tenant activity log returns facets and pagination metadata", function(
},
facets = {
activityTypes = {
{
activityType = "DEPLOYMENT",
count = 0,
},
{
activityType = "REPOSITORY_ADDED",
count = 2,
},
},
resourceTypes = {
{
resourceType = "APP",
count = 0,
},
{
resourceType = "REPOSITORY",
count = 2,
},
},
environments = {},
environments = {
{
value = "dev",
count = 0,
},
},
},
},
},
Expand Down
56 changes: 56 additions & 0 deletions integration_tests/valkey_crud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,62 @@ Test.gql("List valkeys for team", function(t)
}
end)

Test.gql("List activity log facets for valkey", function(t)
t.addHeader("x-user-email", user:email())

t.query [[
{
team(slug: "someteamname") {
environment(name: "dev") {
valkey(name: "foobar") {
activityLog {
facets {
activityTypes {
activityType
count
}
resourceTypes {
resourceType
count
}
environments {
value
count
}
}
}
}
}
}
}
]]

t.check {
data = {
team = {
environment = {
valkey = {
activityLog = {
facets = {
activityTypes = {
{ activityType = "VALKEY_CREATED", count = 1 },
{ activityType = "VALKEY_UPDATED", count = 1 },
},
resourceTypes = {
{ resourceType = "VALKEY", count = 2 },
},
environments = {
{ value = "dev", count = 2 },
},
},
},
},
},
},
},
}
end)

Test.gql("Update Valkey with tier and memory equivalent to hobbyist plan", function(t)
t.addHeader("x-user-email", user:email())
t.query [[
Expand Down
Loading