-
Notifications
You must be signed in to change notification settings - Fork 354
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
feat: query API for job configurations with errors [DHIS2-15276] #15636
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #15636 +/- ##
=============================================
+ Coverage 49.39% 66.27% +16.88%
- Complexity 23283 31327 +8044
=============================================
Files 3483 3484 +1
Lines 129911 129986 +75
Branches 15182 15192 +10
=============================================
+ Hits 64166 86154 +21988
+ Misses 59684 36744 -22940
- Partials 6061 7088 +1027
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1222 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
...dhis-service-core/src/main/java/org/hisp/dhis/scheduling/DefaultJobConfigurationService.java
Fixed
Show fixed
Hide fixed
private UID user; | ||
|
||
/** The earliest date the job ran that should be included */ | ||
@CheckForNull private Date from; |
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.
Can we use LocalDate
or LocalDateTime
for new models seeing as we want to move to use these eventually? Or is there something restricting us from doing this?
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.
I think I should try at least, just did this out of a (bad) habit
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.
We don't have setup a flexible parsing for LocalDate
in the same way we have for Date
so for now I keep it Date
. At some point we should make an attempt to switch dates in APIs over while supporting the parsing flexibility.
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.
adding a new API without tests?! If something breaks in the most simple use case, how will we know about it?
You got me :) Have to add some |
Kudos, SonarCloud Quality Gate passed! |
Summary
Adds an API endpoints to search and view error recordings attached to a
JobConfiguration
.New APIs
/api/jobConfigurations/progress/errors
: only the errors of theprogress
JSON object flattened to an array of objects/api/jobConfigurations/{uid}/errors
: errors of a specific job configuration as job run errors/api/jobConfigurations/errors
: search API to list jobs with errors that give job run error entriesA entry of a job run errors has this structure:
Manual Testing
/api/jobConfigurations/gist?filter=jobType:eq:METADATA_IMPORT&order=created:desc
/api/jobConfigurations/errors
/api/jobConfigurations/hg6LR5ls42g/errors
(replace UID in path)http://localhost:8080/api/jobConfigurations/hg6LR5ls42g/progress/errors
(replace UID in path)