Skip to content

Log scopeQuery as it will be sent to Sourcegraph

Warren Gifford requested to merge log-scope-query into master

Created by: mrnugget

This should help with the problem encountered in #125 (closed) by making it easier to debug the scopeQuery.

The change here adds another logline to src actions scope-query when the -v flag is given and changes the existing log in src actions exec to show the scope query as it will be sent over the wire.

Example

unescaped.action.json:

{
  "scopeQuery": "repo:github\.com\/sourcegraph\/sourcegraph$|basic-code-intel$ repohasfile:yarn.lock file:^package.json$ rxjs"
}
$ src -v action scope-query -f unescaped.action.json                                                                                                                -130-
# scopeQuery in action definition: repo:githubcom/sourcegraph/sourcegraph$|basic-code-intel$ repohasfile:yarn.lock file:^package.json$ rxjs
# 1 repositories match.
github.com/sourcegraph/sourcegraph-basic-code-intel

escaped.action.json:

{
  "scopeQuery": "repo:github\\.com\\/sourcegraph\\/sourcegraph$|basic-code-intel$ repohasfile:yarn.lock file:^package.json$ rxjs"
}
$ src -v action scope-query -f escaped.action.json
# scopeQuery in action definition: repo:github\.com\/sourcegraph\/sourcegraph$|basic-code-intel$ repohasfile:yarn.lock file:^package.json$ rxjs
# 2 repositories match.
github.com/sourcegraph/sourcegraph-basic-code-intel
github.com/sourcegraph/sourcegraph

Merge request reports

Loading