Fix post opt. tests

This commit is contained in:
Tomaž Jerman
2024-02-06 13:39:22 +01:00
parent 41e86f2c16
commit 2637334460
18 changed files with 202 additions and 152 deletions
+6
View File
@@ -1256,6 +1256,12 @@
# Default: <no value>
# WORKFLOW_STACK_TRACE_ENABLED=<no value>
###############################################################################
# Forces the stack trace to record all steps
# Type: bool
# Default: <no value>
# WORKFLOW_STACK_TRACE_FULL=<no value>
###############################################################################
###############################################################################
# Discovery
+5
View File
@@ -26,6 +26,11 @@ workflow: schema.#optionsGroup & {
defaultGoExpr: "true"
description: "Enables execution stack trace construction"
}
stack_trace_full: {
type: "bool"
defaultGoExpr: "true"
description: "Forces the stack trace to record all steps"
}
}
title: "Workflow"
}
+13 -11
View File
@@ -871,13 +871,14 @@ func unmarshalRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet, err e
// Example:
//
// modules:
// module1:
// name: "module 1"
// fields: ...
// allow:
// role1:
// - read
// - delete
//
// module1:
// name: "module 1"
// fields: ...
// allow:
// role1:
// - read
// - delete
func unmarshalNestedRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet, err error) {
return out, y7s.EachMap(n, func(role, op *yaml.Node) error {
out = append(out, &envoyx.Node{
@@ -903,10 +904,11 @@ func unmarshalNestedRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet,
// Example:
//
// allow:
// role1:
// corteza::system/:
// - users.search
// - users.create
//
// role1:
// corteza::system/:
// - users.search
// - users.create
func unmarshalFlatRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet, err error) {
// Handles role
return out, y7s.EachMap(n, func(role, perm *yaml.Node) error {
+4
View File
@@ -325,6 +325,10 @@ func (svc *session) spawn(g *wfexec.Graph, workflowID uint64, trace bool, callSt
ses.DisableStacktrace()
}
if svc.opt.StackTraceFull {
ses.FullStacktrace()
}
svc.mux.Lock()
svc.pool[ses.ID] = ses
svc.mux.Unlock()
+25 -6
View File
@@ -19,6 +19,7 @@ import (
type (
runtimeOptions struct {
disableStacktrace bool
fullStacktrace bool
}
// Instance of single workflow execution
@@ -131,6 +132,10 @@ func (s *Session) DisableStacktrace() {
s.runtimeOpts.disableStacktrace = true
}
func (s *Session) FullStacktrace() {
s.runtimeOpts.fullStacktrace = true
}
func (s *Session) Exec(ctx context.Context, step wfexec.Step, input *expr.Vars) error {
return s.session.Exec(ctx, step, input)
}
@@ -190,12 +195,6 @@ func (s *Session) Apply(ssp SessionStartParams) {
}
}
// AppendRuntimeStacktrace adds a new frame to the runtime stacktrace
//
// This does have some smartness
// If the workflow uses longer iterators, the memory pressure got too high.
// To counter this, only the frames of the last iteration are preserved to
// better match what programming languages do.
func (s *Session) AppendRuntimeStacktrace(frame *wfexec.Frame) {
if s.runtimeOpts.disableStacktrace {
return
@@ -204,6 +203,20 @@ func (s *Session) AppendRuntimeStacktrace(frame *wfexec.Frame) {
s.l.RLock()
defer s.l.RUnlock()
if !s.runtimeOpts.fullStacktrace {
s.appendTruncatedRuntimeStacktrace(frame)
} else {
s.appendFullRuntimeStacktrace(frame)
}
}
// appendTruncatedRuntimeStacktrace adds a new frame to the runtime stacktrace
//
// This does have some smartness
// If the workflow uses longer iterators, the memory pressure got too high.
// To counter this, only the frames of the last iteration are preserved to
// better match what programming languages do.
func (s *Session) appendTruncatedRuntimeStacktrace(frame *wfexec.Frame) {
// The only way to get to the same stepID is when we're in a loop
// Find where the first frame of the iterator is and slice the stack.
if frame.Action != "iterator initialized" && s.hasDuplicate(frame.StepID) {
@@ -225,6 +238,12 @@ func (s *Session) AppendRuntimeStacktrace(frame *wfexec.Frame) {
s.RuntimeStacktrace = append(s.RuntimeStacktrace, frame)
}
// appendFullRuntimeStacktrace is primarily meant for testing so we can inspect
// the entire execution and and state values
func (s *Session) appendFullRuntimeStacktrace(frame *wfexec.Frame) {
s.RuntimeStacktrace = append(s.RuntimeStacktrace, frame)
}
// @todo potentially optimize this; it'll probably be fine for now but
// might degrade performance for larger workflows.
// To investigate and potentially optimize it.
+13 -11
View File
@@ -2405,13 +2405,14 @@ func unmarshalRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet, err e
// Example:
//
// modules:
// module1:
// name: "module 1"
// fields: ...
// allow:
// role1:
// - read
// - delete
//
// module1:
// name: "module 1"
// fields: ...
// allow:
// role1:
// - read
// - delete
func unmarshalNestedRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet, err error) {
return out, y7s.EachMap(n, func(role, op *yaml.Node) error {
out = append(out, &envoyx.Node{
@@ -2437,10 +2438,11 @@ func unmarshalNestedRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet,
// Example:
//
// allow:
// role1:
// corteza::system/:
// - users.search
// - users.create
//
// role1:
// corteza::system/:
// - users.search
// - users.create
func unmarshalFlatRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet, err error) {
// Handles role
return out, y7s.EachMap(n, func(role, perm *yaml.Node) error {
+2 -3
View File
@@ -1,11 +1,10 @@
package service
import (
"context"
"github.com/cortezaproject/corteza/server/pkg/cli"
"github.com/cortezaproject/corteza/server/pkg/id"
)
func init() {
id.Init(context.Background())
id.Init(cli.Context())
}
+9 -2
View File
@@ -38,8 +38,11 @@ const (
var (
initialized bool
idQueue = make(chan uint64, 512)
makerCount = 20
idQueue = make(chan uint64, 8000)
// Keep this to 1 for now as we need to enforce that any later ID is larger
// than any previous one.
// If we use different deviceIDs for routines, this isn't guaranteed to hold.
makerCount = 1
)
func Init(ctx context.Context) {
@@ -56,6 +59,10 @@ func Init(ctx context.Context) {
}
wg.Wait()
// Give it some time to warm up with some ids
// Arbitrarily picked a good timeout based on benchmark runs
time.Sleep(time.Second * 1)
}
func makeIDer(ctx context.Context, wg *sync.WaitGroup, qq chan uint64, thr uint64) {
+5
View File
@@ -6,10 +6,15 @@ import (
"github.com/cortezaproject/corteza/server/pkg/cli"
)
// goos: darwin
// goarch: arm64
// pkg: github.com/cortezaproject/corteza/server/pkg/id
// BenchmarkGenerator-12 162234 39011 ns/op 0 B/op 0 allocs/op
func BenchmarkGenerator(b *testing.B) {
ctx := cli.Context()
Init(ctx)
b.ResetTimer()
for n := 0; n < b.N; n++ {
Next()
}
+2
View File
@@ -252,6 +252,7 @@ type (
ExecDebug bool `env:"WORKFLOW_EXEC_DEBUG"`
CallStackSize int `env:"WORKFLOW_CALL_STACK_SIZE"`
StackTraceEnabled bool `env:"WORKFLOW_STACK_TRACE_ENABLED"`
StackTraceFull bool `env:"WORKFLOW_STACK_TRACE_FULL"`
}
DiscoveryOpt struct {
@@ -1024,6 +1025,7 @@ func Workflow() (o *WorkflowOpt) {
Register: true,
CallStackSize: 16,
StackTraceEnabled: true,
StackTraceFull: true,
}
// Custom defaults
+2 -3
View File
@@ -1,11 +1,10 @@
package wfexec
import (
"context"
"github.com/cortezaproject/corteza/server/pkg/cli"
"github.com/cortezaproject/corteza/server/pkg/id"
)
func init() {
id.Init(context.Background())
id.Init(cli.Context())
}
-2
View File
@@ -63,8 +63,6 @@ type (
// This keeps track of workflow calls
callStack []uint64
Statko chan SessionStatus
}
StateChangeHandler func(SessionStatus, *State, *Session)
+96 -96
View File
@@ -580,13 +580,13 @@ func (s *Store) SearchApigwFilters(ctx context.Context, f systemType.ApigwFilter
// fetchFullPageOfApigwFilters collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfApigwFilters(
@@ -1178,13 +1178,13 @@ func (s *Store) SearchApigwRoutes(ctx context.Context, f systemType.ApigwRouteFi
// fetchFullPageOfApigwRoutes collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfApigwRoutes(
@@ -1780,13 +1780,13 @@ func (s *Store) SearchApplications(ctx context.Context, f systemType.Application
// fetchFullPageOfApplications collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfApplications(
@@ -2337,13 +2337,13 @@ func (s *Store) SearchAttachments(ctx context.Context, f systemType.AttachmentFi
// fetchFullPageOfAttachments collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfAttachments(
@@ -2889,13 +2889,13 @@ func (s *Store) SearchAuthClients(ctx context.Context, f systemType.AuthClientFi
// fetchFullPageOfAuthClients collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfAuthClients(
@@ -4628,13 +4628,13 @@ func (s *Store) SearchAutomationSessions(ctx context.Context, f automationType.S
// fetchFullPageOfAutomationSessions collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfAutomationSessions(
@@ -5195,13 +5195,13 @@ func (s *Store) SearchAutomationTriggers(ctx context.Context, f automationType.T
// fetchFullPageOfAutomationTriggers collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfAutomationTriggers(
@@ -5758,13 +5758,13 @@ func (s *Store) SearchAutomationWorkflows(ctx context.Context, f automationType.
// fetchFullPageOfAutomationWorkflows collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfAutomationWorkflows(
@@ -6383,13 +6383,13 @@ func (s *Store) SearchComposeAttachments(ctx context.Context, f composeType.Atta
// fetchFullPageOfComposeAttachments collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfComposeAttachments(
@@ -6939,13 +6939,13 @@ func (s *Store) SearchComposeCharts(ctx context.Context, f composeType.ChartFilt
// fetchFullPageOfComposeCharts collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfComposeCharts(
@@ -7536,13 +7536,13 @@ func (s *Store) SearchComposeModules(ctx context.Context, f composeType.ModuleFi
// fetchFullPageOfComposeModules collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfComposeModules(
@@ -8622,13 +8622,13 @@ func (s *Store) SearchComposeNamespaces(ctx context.Context, f composeType.Names
// fetchFullPageOfComposeNamespaces collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfComposeNamespaces(
@@ -9244,13 +9244,13 @@ func (s *Store) SearchComposePages(ctx context.Context, f composeType.PageFilter
// fetchFullPageOfComposePages collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfComposePages(
@@ -9890,13 +9890,13 @@ func (s *Store) SearchComposePageLayouts(ctx context.Context, f composeType.Page
// fetchFullPageOfComposePageLayouts collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfComposePageLayouts(
@@ -10877,13 +10877,13 @@ func (s *Store) SearchDalConnections(ctx context.Context, f systemType.DalConnec
// fetchFullPageOfDalConnections collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfDalConnections(
@@ -11502,13 +11502,13 @@ func (s *Store) SearchDalSchemaAlterations(ctx context.Context, f systemType.Dal
// fetchFullPageOfDalSchemaAlterations collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfDalSchemaAlterations(
@@ -12045,13 +12045,13 @@ func (s *Store) SearchDalSensitivityLevels(ctx context.Context, f systemType.Dal
// fetchFullPageOfDalSensitivityLevels collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfDalSensitivityLevels(
@@ -12600,13 +12600,13 @@ func (s *Store) SearchDataPrivacyRequests(ctx context.Context, f systemType.Data
// fetchFullPageOfDataPrivacyRequests collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfDataPrivacyRequests(
@@ -13162,13 +13162,13 @@ func (s *Store) SearchDataPrivacyRequestComments(ctx context.Context, f systemTy
// fetchFullPageOfDataPrivacyRequestComments collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfDataPrivacyRequestComments(
@@ -13668,13 +13668,13 @@ func (s *Store) SearchFederationExposedModules(ctx context.Context, f federation
// fetchFullPageOfFederationExposedModules collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfFederationExposedModules(
@@ -14218,13 +14218,13 @@ func (s *Store) SearchFederationModuleMappings(ctx context.Context, f federation
// fetchFullPageOfFederationModuleMappings collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfFederationModuleMappings(
@@ -14806,13 +14806,13 @@ func (s *Store) SearchFederationNodes(ctx context.Context, f federationType.Node
// fetchFullPageOfFederationNodes collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfFederationNodes(
@@ -15452,13 +15452,13 @@ func (s *Store) SearchFederationNodeSyncs(ctx context.Context, f federationType.
// fetchFullPageOfFederationNodeSyncs collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfFederationNodeSyncs(
@@ -16050,13 +16050,13 @@ func (s *Store) SearchFederationSharedModules(ctx context.Context, f federationT
// fetchFullPageOfFederationSharedModules collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfFederationSharedModules(
@@ -17300,13 +17300,13 @@ func (s *Store) SearchQueues(ctx context.Context, f systemType.QueueFilter) (set
// fetchFullPageOfQueues collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfQueues(
@@ -17892,13 +17892,13 @@ func (s *Store) SearchQueueMessages(ctx context.Context, f systemType.QueueMessa
// fetchFullPageOfQueueMessages collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfQueueMessages(
@@ -18679,13 +18679,13 @@ func (s *Store) SearchReminders(ctx context.Context, f systemType.ReminderFilter
// fetchFullPageOfReminders collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfReminders(
@@ -19240,13 +19240,13 @@ func (s *Store) SearchReports(ctx context.Context, f systemType.ReportFilter) (s
// fetchFullPageOfReports collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfReports(
@@ -20142,13 +20142,13 @@ func (s *Store) SearchResourceTranslations(ctx context.Context, f systemType.Res
// fetchFullPageOfResourceTranslations collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfResourceTranslations(
@@ -20677,13 +20677,13 @@ func (s *Store) SearchRoles(ctx context.Context, f systemType.RoleFilter) (set s
// fetchFullPageOfRoles collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfRoles(
@@ -21996,13 +21996,13 @@ func (s *Store) SearchTemplates(ctx context.Context, f systemType.TemplateFilter
// fetchFullPageOfTemplates collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfTemplates(
@@ -22631,13 +22631,13 @@ func (s *Store) SearchUsers(ctx context.Context, f systemType.UserFilter) (set s
// fetchFullPageOfUsers collects all requested results.
//
// Function applies:
// - cursor conditions (where ...)
// - limit
// - cursor conditions (where ...)
// - limit
//
// Main responsibility of this function is to perform additional sequential queries in case when not enough results
// are collected due to failed check on a specific row (by check fn).
//
// Function then moves cursor to the last item fetched
// # Function then moves cursor to the last item fetched
//
// This function is auto-generated
func (s *Store) fetchFullPageOfUsers(
+3 -3
View File
@@ -243,12 +243,12 @@ func (v *RenderedDocument) Clone() (expr.TypedValue, error) {
func (v *Role) Clone() (expr.TypedValue, error) {
aux := v.value.Clone()
return NewRole(&aux)
return NewRole(aux)
}
func (v *Template) Clone() (expr.TypedValue, error) {
aux := v.value.Clone()
return NewTemplate(&aux)
return NewTemplate(aux)
}
func (v *TemplateMeta) Clone() (expr.TypedValue, error) {
@@ -257,5 +257,5 @@ func (v *TemplateMeta) Clone() (expr.TypedValue, error) {
func (v *User) Clone() (expr.TypedValue, error) {
aux := v.value.Clone()
return NewUser(&aux)
return NewUser(aux)
}
+13 -11
View File
@@ -3594,13 +3594,14 @@ func unmarshalRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet, err e
// Example:
//
// modules:
// module1:
// name: "module 1"
// fields: ...
// allow:
// role1:
// - read
// - delete
//
// module1:
// name: "module 1"
// fields: ...
// allow:
// role1:
// - read
// - delete
func unmarshalNestedRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet, err error) {
return out, y7s.EachMap(n, func(role, op *yaml.Node) error {
out = append(out, &envoyx.Node{
@@ -3626,10 +3627,11 @@ func unmarshalNestedRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet,
// Example:
//
// allow:
// role1:
// corteza::system/:
// - users.search
// - users.create
//
// role1:
// corteza::system/:
// - users.search
// - users.create
func unmarshalFlatRBACNode(n *yaml.Node, acc rbac.Access) (out envoyx.NodeSet, err error) {
// Handles role
return out, y7s.EachMap(n, func(role, perm *yaml.Node) error {
+2 -3
View File
@@ -1,11 +1,10 @@
package service
import (
"context"
"github.com/cortezaproject/corteza/server/pkg/cli"
"github.com/cortezaproject/corteza/server/pkg/id"
)
func init() {
id.Init(context.Background())
id.Init(cli.Context())
}
+1
View File
@@ -30,6 +30,7 @@ var (
func init() {
helpers.RecursiveDotEnvLoad()
id.Init(cli.Context())
}
func TestMain(m *testing.M) {
@@ -50,7 +50,7 @@ func Test0008_iterator_role_members(t *testing.T) {
req.NoError(err)
req.Equal(ctr, i.Get().(int64))
usr, err := automation.NewRole(frame.Results.GetValue()["u"])
usr, err := automation.NewUser(frame.Results.GetValue()["u"])
req.NoError(err)
req.Equal(fmt.Sprintf("u%d", ctr+1), usr.GetValue().Handle)
}