-
I have this go function: func (s *Server) ListTriggers(ctx context.Context, q *notification.TriggersListRequest) (*notification.TriggerList, error) {
[...]
} You can find it here: https://github.com/argoproj/argo-cd/blob/v2.13.3/server/notification/notification.go#L25 I want to add the extensions:
- addsTo:
pack: codeql/go-all
extensible: sourceModel
data:
- ["github.com/argoproj/argo-cd/v2/server/notification", "", True, "ListTriggers", "", "", "Argument[1]", "remote", "manual" ]
- addsTo:
pack: codeql/go-all
extensible: sinkModel
data: []
- addsTo:
pack: codeql/go-all
extensible: summaryModel
data: []
I'm running the following query to check if I have additional entries in the output with the model: import semmle.go.security.FlowSources
from RemoteFlowSource::Range source
where not source.getFile().getRelativePath().matches("%/test/%")
select source, "" But I get the same number of result with and without my model pack. So is my model pack correct ? How can I test if it's really adding sources ? Here is my command line: $ codeql database analyze /../argo-cd-v2.13.3 --format=sarif-latest --output=/../sarif-remote-flow-sources.sarif --additional-packs /.../argocd-cd-ext/ --additional-packs /../argocd-cd/ --model-packs synacktiv/argocd-cd-ext synacktiv/argocd-cd:query.ql --rerun |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 23 replies
-
Thank you for your detailed question. Looking at your Go model, it is missing the receiver type in the Type column. Try this instead.
If that does not work then it may be a model pack issue. |
Beta Was this translation helpful? Give feedback.
-
Hi @owen-mc I have an additional issue with the model pack. I've applied your patch and I'm trying to use my model pack with the
But If I copy the same query in my custom pack I got some results:
What's the difference ? I've also tried to use the syntax |
Beta Was this translation helpful? Give feedback.
-
I defer to @hvitved as I am not very familiar with model packs. |
Beta Was this translation helpful? Give feedback.
Thanks for explaining your use case. This does indeed seem to be what "Parameter", which @hvitved mentioned earlier, does. I haven't used it before, and it isn't currently in use in the Go library, but it is possible that it currrently works, or that minimal changes are needed to make it work. I will look into it. In the meantime, have you tried the following model?