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

Lookout v2 API - state counts as group aggregate #2605

Merged

Conversation

carlocamurri
Copy link
Contributor

@carlocamurri carlocamurri commented Jun 23, 2023

Enables providing state as an aggregate to the jobGroups endpoint, which will return a mapping from state -> count of jobs in that state for each group returned.

Key changes:

  • Have abstracted code that generates SQL aggregate expression in aggregates.go
  • Aggregated fields can now result in multiple aggregates (for states, we will get a different aggregated column for each required state)
  • Parsing group SQL is abstracted in fieldparser.go, instead of relying on higher order functions

@codecov
Copy link

codecov bot commented Jun 23, 2023

Codecov Report

Patch coverage: 79.74% and project coverage change: +1.47 🎉

Comparison is base (d59732a) 58.65% compared to head (830942a) 60.12%.

❗ Current head 830942a differs from pull request most recent head 072c85b. Consider uploading reports for the commit 072c85b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2605      +/-   ##
==========================================
+ Coverage   58.65%   60.12%   +1.47%     
==========================================
  Files         236      240       +4     
  Lines       30458    31914    +1456     
==========================================
+ Hits        17865    19189    +1324     
- Misses      11221    11327     +106     
- Partials     1372     1398      +26     
Flag Coverage Δ
armada-server 60.12% <79.74%> (+1.47%) ⬆️

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

Impacted Files Coverage Δ
internal/lookoutv2/repository/querybuilder.go 64.13% <62.50%> (ø)
internal/lookoutv2/repository/aggregates.go 74.39% <74.39%> (ø)
internal/lookoutv2/repository/groupjobs.go 69.15% <79.48%> (-1.26%) ⬇️
internal/lookoutv2/repository/fieldparser.go 81.81% <81.81%> (ø)
internal/lookoutv2/repository/util.go 71.35% <93.18%> (+4.74%) ⬆️
internal/lookoutv2/repository/tables.go 89.38% <100.00%> (+0.09%) ⬆️

... and 28 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@carlocamurri carlocamurri enabled auto-merge (squash) June 23, 2023 16:18
@carlocamurri carlocamurri merged commit 5bf48cb into master Jun 23, 2023
35 checks passed
@carlocamurri carlocamurri deleted the carlocamurri/lookoutv2-api-group-by-state-aggregates branch June 23, 2023 16:31
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.

2 participants