Skip to content
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

[bugfix] Fix missing query route and DB path parsing in goQuery API #341

Conversation

fako1024
Copy link
Collaborator

See comments in PR code for details.

Closes #340

@fako1024 fako1024 added the bug Something isn't working label Aug 14, 2024
@fako1024 fako1024 requested a review from els0r August 14, 2024 06:49
@fako1024 fako1024 self-assigned this Aug 14, 2024
// New creates a new goprobe API server
func New(addr string, captureManager *capture.Manager, configMonitor *config.Monitor, opts ...server.Option) *Server {
func New(addr, dbPath string, captureManager *capture.Manager, configMonitor *config.Monitor, opts ...server.Option) *Server {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the path a required argument for the API as it is not optional and cannot be guessed properly (just because we fall back here to the default doesn't mean this has been done elsewhere in the same way).

@@ -14,6 +14,19 @@ var queryTags = []string{"Query"}

// RegisterQueryAPI registers all query related endpoints
func RegisterQueryAPI(a huma.API, caller string, querier query.Runner, middlewares huma.Middlewares) {
// query running
huma.Register(a,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section exists below for the distributed query, but seems to have been forgotten here...

@@ -14,7 +14,3 @@ go.work.sum
.db/
tmp/
bin/
goProbe
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were triggering on the cmd/XXX subfolders, ignoring changes under them.

Copy link
Owner

@els0r els0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally dropped the ball on this one.

Thanks for the fix!

@fako1024 fako1024 merged commit 20ebb1a into main Aug 22, 2024
5 checks passed
@fako1024 fako1024 deleted the 340-goprobe-query-api-missing-_query-endpoint-broken-config-file-handling branch August 22, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

goProbe query API missing "/_query" endpoint & broken config file handling
2 participants