Skip to content

Commit

Permalink
adding more logging to make sure things are passed through
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn-hurley committed Nov 15, 2024
1 parent a4a8f6f commit f786d66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,15 @@ func (r *ruleEngine) RunRulesScoped(ctx context.Context, ruleSets []RuleSet, sco
Template: make(map[string]ChainTemplate),
}
if scopes != nil {
r.logger.Info("using scopes", "scope", scopes.Name())
err := scopes.AddToContext(&conditionContext)
if err != nil {
r.logger.Error(err, "unable to apply scopes to ruleContext")
// Call this, even though it is not used, to make sure that
// we don't leak anything.
return []konveyor.RuleSet{}
}
r.logger.Info("added scopes to condition context", "scopes", scopes, "conditionContext", conditionContext)
}
ctx, cancelFunc := context.WithCancel(ctx)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ func (p *javaServiceClient) GetAllSymbols(ctx context.Context, c javaCondition,
argumentsMap["annotationQuery"] = c.Referenced.Annotated
}

p.log.Info("arg map", "argMap", argumentsMap, "condCTX", condCTX)

if len(p.includedPaths) > 0 {
argumentsMap[provider.IncludedPathsConfigKey] = p.includedPaths
p.log.V(5).Info("setting search scope by filepaths", "paths", p.includedPaths)
p.log.Info("setting search scope by filepaths", "paths", p.includedPaths)
} else if ok, paths := condCTX.GetScopedFilepaths(); ok {
argumentsMap[provider.IncludedPathsConfigKey] = paths
p.log.V(5).Info("setting search scope by filepaths", "paths", p.includedPaths)
p.log.Info("setting search scope by filepaths", "paths", p.includedPaths, "argumentMap", argumentsMap)
}

argumentsBytes, _ := json.Marshal(argumentsMap)
Expand Down

0 comments on commit f786d66

Please sign in to comment.