Add job tagging to API#2774
Conversation
Signed-off-by: sharpd <davidsharp7@gmail.com>
✅ Deploy Preview for peppy-sprite-186812 canceled.
|
Signed-off-by: sharpd <davidsharp7@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2774 +/- ##
============================================
+ Coverage 84.47% 84.57% +0.09%
- Complexity 1430 1441 +11
============================================
Files 251 251
Lines 6462 6503 +41
Branches 299 302 +3
============================================
+ Hits 5459 5500 +41
Misses 850 850
Partials 153 153 ☔ View full report in Codecov by Sentry. |
Signed-off-by: sharpd <davidsharp7@gmail.com>
Signed-off-by: sharpd <davidsharp7@gmail.com>
| NOW(), | ||
| NOW(), | ||
| :tagName, | ||
| 'No Description' |
There was a problem hiding this comment.
Is there a reason we would want to hardcode this in the SQL, instead of in our application code to be a bit more flexible?
There was a problem hiding this comment.
description is a nullable column from what I can see, I'm not sure we need to default it at all?
There was a problem hiding this comment.
Yeah I can leave as null - was just being explicit more than anything but it is inconsistent with dataset/dataset field tagging so makes sense to set to null.
| Job job = | ||
| jobService | ||
| .findJobByName(namespaceName.getValue(), jobName.getValue()) | ||
| .orElseThrow(() -> new JobNotFoundException(jobName)); |
There was a problem hiding this comment.
I guess this should be quite unlikely given updateJobTags would presumably throw if the job didn't exist? A case of, we get an optional back so we should do something beyond an unqualified get() on it?
There was a problem hiding this comment.
Yeah understand what you mean -it will fall over before it gets to this point so why bother? Mainly as that seems to be the de-facto pattern for a lot of the code i.e
execute something -> retrieve object (job, dataset etc) else throw an error.
There was a problem hiding this comment.
Thanks for following our code style!
| @Getter private final JobType type; | ||
| @Getter private final Set<DatasetId> inputs; | ||
| @Getter private final Set<DatasetId> outputs; | ||
| @Getter @NonNull private final Set<String> tags; |
There was a problem hiding this comment.
Disparity between @NonNull here and @Nullable in the constructor. The builder also doesn't specify - I think nullable makes sense though? For backwards-compatibility, especially.
| @Getter private final ImmutableMap<String, Object> facets; | ||
| @Nullable private UUID currentVersion; | ||
| @Getter @Nullable private ImmutableList<String> labels; | ||
| @Getter private final ImmutableSet<TagName> tags; |
There was a problem hiding this comment.
Should we mark this @Nullable here? Would be consistent with other fields.
| @Nullable private final Run latestRun; | ||
| @Getter private final Map<String, Object> facets; | ||
| @Nullable private final UUID currentVersion; | ||
| @Getter @NonNull private final Set<String> tags; |
There was a problem hiding this comment.
This class extends JobMeta which already defines tags as a field - I don't think we need to define it again here, but rather pass it through into the super ctor?
Signed-off-by: sharpd <davidsharp7@gmail.com>
Signed-off-by: sharpd <davidsharp7@gmail.com>
Signed-off-by: sharpd <davidsharp7@gmail.com>
Signed-off-by: sharpd <davidsharp7@gmail.com>
davidjgoss
left a comment
There was a problem hiding this comment.
LGTM. Not sure why webpack build is failing, as it runs okay for me locally. Could be it's maxing out resources?
|
It's a 137 exit code which is OOM so yes you out of resource. Did this a couple of weeks ago and then came right. |
Signed-off-by: sharpd <davidsharp7@gmail.com>
| Job job = | ||
| jobService | ||
| .findJobByName(namespaceName.getValue(), jobName.getValue()) | ||
| .orElseThrow(() -> new JobNotFoundException(jobName)); |
There was a problem hiding this comment.
Thanks for following our code style!
Signed-off-by: sharpd <davidsharp7@gmail.com>
Signed-off-by: sharpd <davidsharp7@gmail.com>
wslulciuc
left a comment
There was a problem hiding this comment.
Excited to see tagging support for jobs! (And soon in the Web UI 🚀 )
* add job tagging to API Signed-off-by: sharpd <davidsharp7@gmail.com> * fix various tests that were failing Signed-off-by: sharpd <davidsharp7@gmail.com> * fix merge commit Signed-off-by: sharpd <davidsharp7@gmail.com> * fix liniting Signed-off-by: sharpd <davidsharp7@gmail.com> * update based on pr feedback Signed-off-by: sharpd <davidsharp7@gmail.com> * lint tag test code Signed-off-by: sharpd <davidsharp7@gmail.com> * lint tag code Signed-off-by: sharpd <davidsharp7@gmail.com> * fix log typo Signed-off-by: sharpd <davidsharp7@gmail.com> * fix logging Signed-off-by: sharpd <davidsharp7@gmail.com> * update based on PR feedback. Signed-off-by: sharpd <davidsharp7@gmail.com> * correct db field error Signed-off-by: sharpd <davidsharp7@gmail.com> --------- Signed-off-by: sharpd <davidsharp7@gmail.com> Co-authored-by: Willy Lulciuc <willy@datakin.com>
Problem
Currently we have no tag support for jobs.
Closes: #2756
Solution
Add job tagging to API
Checklist
CHANGELOG.md(Depending on the change, this may not be necessary)..sqldatabase schema migration according to Flyway's naming convention (if relevant)