-
Notifications
You must be signed in to change notification settings - Fork 318
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
Add job tagging to API #2774
Add job tagging to API #2774
Conversation
Signed-off-by: sharpd <[email protected]>
✅ Deploy Preview for peppy-sprite-186812 canceled.
|
Signed-off-by: sharpd <[email protected]>
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 <[email protected]>
Signed-off-by: sharpd <[email protected]>
NOW(), | ||
NOW(), | ||
:tagName, | ||
'No Description' |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for following our code style!
@@ -22,6 +22,7 @@ public class JobMeta { | |||
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -43,6 +45,7 @@ public final class Job { | |||
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mark this @Nullable
here? Would be consistent with other fields.
@@ -33,6 +34,7 @@ public final class Job extends JobMeta { | |||
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
…quez into api/add_job_tags
Signed-off-by: sharpd <[email protected]>
Signed-off-by: sharpd <[email protected]>
Signed-off-by: sharpd <[email protected]>
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.
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. |
Job job = | ||
jobService | ||
.findJobByName(namespaceName.getValue(), jobName.getValue()) | ||
.orElseThrow(() -> new JobNotFoundException(jobName)); |
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.
Thanks for following our code style!
api/src/main/resources/marquez/db/migration/V68__add_jobs_tag_mapping.sql
Outdated
Show resolved
Hide resolved
Signed-off-by: sharpd <[email protected]>
Signed-off-by: sharpd <[email protected]>
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.
Excited to see tagging support for jobs! (And soon in the Web UI 🚀 )
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)..sql
database schema migration according to Flyway's naming convention (if relevant)