-
Notifications
You must be signed in to change notification settings - Fork 146
Add information about assignees, reviewers, and approvers to body #232
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
Conversation
src/githubHelper.ts
Outdated
this.gitlabHelper | ||
); | ||
|
||
if (add_issue_information) { |
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.
Would it be better to put this behind a setting?
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 think so
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.
Looks nice. But would be nicer with the changes. 👍
src/gitlabHelper.ts
Outdated
}, | ||
); | ||
console.log(approvals); | ||
console.log(approvals.rules[0]); |
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.
Are these logging statements left from development or do they server a purpose?
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.
My bad, leftovers from development.
src/githubHelper.ts
Outdated
let mrAssignees = issue.assignees.map(a => a.username); | ||
if (settings.usermap) { | ||
let assignees = []; | ||
for (let assignee of mrAssignees) { | ||
let githubUser = settings.usermap[assignee as string]; | ||
if (githubUser) { | ||
githubUser = '@' + githubUser; | ||
} else { | ||
githubUser = assignee as string; | ||
} | ||
assignees.push(githubUser); | ||
} | ||
|
||
if (assignees.length > 0) { | ||
bodyConverted += '\n\n**Assignees:** ' + assignees.join(', '); | ||
} | ||
} |
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.
Could you refactor this into a function which gets called with assignees, reviewers and approvals as it seems they are nearly the same
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.
Good point! Moved it into a util function. If you have an idea for a better name for the function, let me know.
item: GitLabIssue | GitLabMergeRequest | GitLabNote | MilestoneImport, | ||
add_line: boolean = true | ||
add_line: boolean = true, | ||
add_line_ref: boolean = true, |
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 isn't used in this PR, no?
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.
My bad, I accidentally copied this change over from my own branch that contains all improvements in one. It belongs to #210. Now that that one is merged and this one up to date it is fixed.
src/githubHelper.ts
Outdated
this.gitlabHelper | ||
); | ||
|
||
if (add_issue_information) { |
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 think so
0790a07
to
83a7567
Compare
Thanks for the work 👍 |
Information about assignees and reviewers (and whether they approved) can get lost when migrating, especially if the users don't exist on GitHub, or are not part of the same organization (anymore).
This PR adds assignees (issue and MR), reviewers (MR only), and approvals (MR only) to the end of the body of a migrated merge request (just above the "Migrated from ..." line).