-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add ability to have search depth in query known #1692
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, small lint issue.
I do think we may want to figure out a better method to display the information more cohesively. Like how OSV scanner outputs some of its data.
cmd/guacone/cmd/known.go
Outdated
@@ -87,10 +90,11 @@ var queryKnownCmd = &cobra.Command{ | |||
<subject> is in the form of "<purl>" for package, "<vcs_tool>+<transport>" for source, or "<algorithm>:<digest>" for artiact.`, | |||
Run: func(cmd *cobra.Command, args []string) { | |||
ctx := logging.WithLogger(context.Background()) | |||
logger := logging.FromContext(ctx) | |||
//logger := logging.FromContext(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
wasn't used in top level since most of the code abstracted out to the helper function where logger is obtained directly.
44f54be
to
8f10238
Compare
8f10238
to
b102faf
Compare
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
b102faf
to
85caccf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just need to move the arg location. Looks like all the query commands use this now, so can be on the "query" command itself and all these will inherit it.
@@ -30,7 +30,7 @@ import ( | |||
func init() { | |||
cobra.OnInitialize(cli.InitConfig) | |||
|
|||
set, err := cli.BuildFlags([]string{"gql-addr", "csub-addr", "csub-tls", "csub-tls-skip-verify"}) | |||
set, err := cli.BuildFlags([]string{"gql-addr", "csub-addr", "csub-tls", "csub-tls-skip-verify", "search-depth"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this as a flag on just the query known command
This pull request has been automatically marked as stale because it has not had recent activity (60 days of inactivity). |
ping @lumjjb to remove stale flag |
Description of the PR
Add
--search-depth
parameter to allow recursive search for query known, will default to 0 which will recursively query max depth. In addition, addedSUBJECT
to output tables which says which subject the predicate is referring to within the tree of metadata returned.Before (without recursion):
With recursive:
This change will require doc change
PR Checklist
-s
flag togit commit
.make generate
has been runcollectsub
protobuf has been changed,make proto
has been run