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.
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 a command to edit existing worklogs #46
add a command to edit existing worklogs #46
Changes from all commits
c7429e8
8f942d5
c5c6751
27aacbb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 should be rather something like
${appName} e 123456 -i abc-123
as in other examples.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 would add more examples (with remaining flags).
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.
What do you think about printing also
worklog id
here? (this value may have been changed which is not obvious)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.
Indeed it should, it seems like I forgot to add it.
Would the message be as in the addWorklog method, to include how to delete the, possibly changed, worklog?
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.
Yes.
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.
worklogIdInput
should be the part ofUpdateWorklogInput
type.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.
First, you should call
await checkToken()
to check if token is properly set. See the other methods in this scope.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.
input.when ? input.when : currentWorklog.startDate
can be replaced with
input.when ?? currentWorklog.startDate
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 need to declare variable as undefined explicitly.
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.
As above, I would use
??
here.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.
IMO
issueKey
should be namedissueKeyOrAlias
, andissue
should be namedissueKey
.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.
As above (using
??
)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.
Why we don't use
remaining estimate
from current worklog?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.
Setting the remaining estimate seems to be optional, which would mean not setting it results in it not being changed.
But it could be done explicitly to make it clearer, i'll see how it behaves now.
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.
But technically if the
issueKey
was changed, we will create a completely new worklog, so we have to move all things from the old to the new one, including optional parameters.Correct me if I am wrong.
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 is not transactional. What if a worklog removal was done successfully but adding a new worklog failed (for example a new issue key is not found)? Then we just have removed worklog, not updated.
I am curious how it's implemented in Jira UI 🤔
Maybe it would be safer to firstly add a new worklog and make deletion after successful adding? I am not sure, think about it, current behavior isn't acceptable unfortunately IMO.
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.
You are right.
If we add the new worklog first and there is an error, this should cancel, i'll check how this behaves by default.
If after adding the new worklog the deletion fails for some reason, it shouldn't matter too much, just need to inform the user.