handle approve/reject states and rejection comments#2
Open
handle approve/reject states and rejection comments#2
Conversation
hanibhat
reviewed
May 17, 2022
hanibhat
left a comment
There was a problem hiding this comment.
I had a look and added some comments. Maybe someone else can also look at this, because I'm not super experienced in Java.
|
|
||
| throw new TranslationException("This function is not implemented", | ||
| TranslationException.ErrorCode.SERVICE_NOT_IMPLEMENTED); | ||
| Comment comment) throws TranslationException { |
| log.trace("BootstrapTranslationServiceImpl.addTranslationObjectComment"); | ||
| String annotation = comment.getAnnotationData(); | ||
| String author = comment.getAuthorName(); | ||
| String fileName = String.format("%s_%s.txt"); |
There was a problem hiding this comment.
The specifiers are missing. Did you mean to pass annotation and author?
|
|
||
| @Override | ||
| public CommentCollection<Comment> getTranslationJobCommentCollection(String strTranslationJobID) { | ||
| log.trace("BootstrapTranslationServiceImpl.getTranslationJobCommentCollection"); |
| rejected++; | ||
| } | ||
| if (file.labels.contains("approval=COMPLETE")) { | ||
| rejected++; |
| return TranslationStatus.APPROVED; | ||
| } | ||
| if (hasImported && hasTranslated && translated > rejected) { | ||
| log.warn("lilt: status for {} is APPROVED", objectPath); |
There was a problem hiding this comment.
Shouldn't the log message say "... TRANSLATED"?
Also, what's the difference between this check and the one few lines below: if (hasImported && hasTranslated)?
| return TranslationStatus.APPROVED; | ||
| } | ||
| if (hasImported && hasTranslated && hasRejected) { | ||
| log.info("lilt: job status for {} is TRANSLATION_IN_PROGRESS", strTranslationJobID); |
There was a problem hiding this comment.
Did you mean to warn here instead of info?
You should probably log REJECTED status instead of TRANSLATION_IN_PROGRESS and return that too.
|
|
||
| @Override | ||
| public TranslationStatus updateTranslationObjectState(String strTranslationJobID, | ||
| TranslationObject translationObject, TranslationState state) throws TranslationException { |
| return TranslationStatus.TRANSLATED; | ||
| } | ||
| if (hasImported) { | ||
| log.warn("lilt: status for {} is TRANSLATION_IN_PROGRESS", objectPath); |
There was a problem hiding this comment.
Shouldn't these types of log messages be info?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.