ENG-11061: Adding implementation corresponding to tags config service apis#48
Conversation
Codecov Report
@@ Coverage Diff @@
## main #48 +/- ##
============================================
+ Coverage 90.80% 91.71% +0.91%
- Complexity 111 130 +19
============================================
Files 14 16 +2
Lines 424 519 +95
Branches 19 19
============================================
+ Hits 385 476 +91
- Misses 32 36 +4
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| RequestContext requestContext = RequestContext.CURRENT.get(); | ||
| Tag updatedTagInReq = request.getTag(); | ||
| configServiceCoordinator.getTag(requestContext, updatedTagInReq.getId()); | ||
| Tag updatedTagInRes = configServiceCoordinator.upsertTag(requestContext, request.getTag()); |
There was a problem hiding this comment.
use updatedTagInReq instead of request.getTag()
| import org.hypertrace.tag.config.service.v1.UpdateTagResponse; | ||
|
|
||
| @Slf4j | ||
| public class TagConfigServiceImpl extends TagConfigServiceGrpc.TagConfigServiceImplBase { |
| try { | ||
| RequestContext requestContext = RequestContext.CURRENT.get(); | ||
| String tagId = request.getId(); | ||
| configServiceCoordinator.getTag(requestContext, tagId); |
There was a problem hiding this comment.
I am curious about this one. Do we truly need to check if tag exists before delete it? This operations don't seem to happen transactionally so after you get a tag and before you delete it, tag might be gone already. If delete is idempotent (which I believe it should), then I would just attempt to delete.
There was a problem hiding this comment.
@kamaleshnneerasa mentioned that there was a NPE when you attempt to delete a non-existent tag-id. You are right that we should fix it appropriately in root config service such that all config services are benefitted by this change.
No description provided.