Skip to content

Add log query endpoint #103

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

Merged
merged 1 commit into from
Jul 22, 2022
Merged

Add log query endpoint #103

merged 1 commit into from
Jul 22, 2022

Conversation

mahmednabil109
Copy link
Contributor

  • add GET log endpoint to query logs
  • support text search, date and log level filtering
  • add integ test for the log query endpoint

Signed-off-by: Mohamed Abokammer [email protected]

@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2022

Codecov Report

Merging #103 (d295941) into main (875560c) will decrease coverage by 0.19%.
The diff coverage is 6.59%.

❗ Current head d295941 differs from pull request most recent head af40ce6. Consider uploading reports for the commit af40ce6 to get more accurate results

@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
- Coverage   65.38%   65.19%   -0.20%     
==========================================
  Files         160      161       +1     
  Lines       10018    10072      +54     
==========================================
+ Hits         6550     6566      +16     
- Misses       2786     2803      +17     
- Partials      682      703      +21     
Flag Coverage Δ
e2e 52.38% <100.00%> (+0.04%) ⬆️
integration 56.44% <6.59%> (-0.22%) ⬇️
unittests 49.08% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmds/admin_server/server/server.go 0.00% <0.00%> (ø)
cmds/admin_server/storage/mongo/mongo.go 8.96% <5.63%> (+7.61%) ⬆️
pkg/runner/job_runner.go 80.84% <100.00%> (+0.10%) ⬆️
pkg/xcontext/context.go 67.30% <0.00%> (-3.37%) ⬇️
pkg/runner/test_runner.go 88.20% <0.00%> (-0.71%) ⬇️
plugins/teststeps/waitport/waitport.go 68.93% <0.00%> (ø)
pkg/jobmanager/jobmanager.go 78.02% <0.00%> (+1.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5baa17...af40ce6. Read the comment docs.

Copy link
Member

@mimir-d mimir-d left a comment

Choose a reason for hiding this comment

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

changes requested

count, err := s.collection.CountDocuments(ctx, q)
if err != nil {
fmt.Fprintf(os.Stderr, "Error while performing count query: %v", err)
return nil, storage.ErrQuery
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to add original err

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's not the concern of the frontend to know the details of the err. And I am logging it already in the server for debugging.

Copy link
Contributor

@rihter007 rihter007 left a comment

Choose a reason for hiding this comment

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

All in all looks good, but there are small things that can make code a bit better

@mahmednabil109 mahmednabil109 force-pushed the main branch 2 times, most recently from 596cfa8 to 0fa2563 Compare July 21, 2022 11:03
@mimir-d
Copy link
Member

mimir-d commented Jul 21, 2022

there's still a couple of comments above to address; either as a reply or in code changes

@mahmednabil109 mahmednabil109 force-pushed the main branch 5 times, most recently from b18a900 to ead33a6 Compare July 22, 2022 14:24
- add GET `log` endpoint to query logs
- support text search, date and log level filtering
- add integ test for the log query endpoint

Signed-off-by: Mohamed Abokammer <[email protected]>
@mimir-d mimir-d dismissed rihter007’s stale review July 22, 2022 14:42

merging today

@mimir-d
Copy link
Member

mimir-d commented Jul 22, 2022

@rihter007 the issues you posted were either resolved or deferred thru issues

@mimir-d mimir-d merged commit aad19c8 into linuxboot:main Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants