Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

mschoettle
Copy link
Contributor

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).

@mschoettle mschoettle changed the title Add information about assignees and reviewers to body Add information about assignees, reviewers, and approvers to body May 20, 2025
this.gitlabHelper
);

if (add_issue_information) {
Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think so

Copy link
Member

@spruce spruce left a 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. 👍

},
);
console.log(approvals);
console.log(approvals.rules[0]);
Copy link
Member

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?

Copy link
Contributor Author

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.

Comment on lines 1437 to 1453
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(', ');
}
}
Copy link
Member

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

Copy link
Contributor Author

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,
Copy link
Member

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?

Copy link
Contributor Author

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.

this.gitlabHelper
);

if (add_issue_information) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think so

@mschoettle mschoettle force-pushed the add-issue-information branch from 0790a07 to 83a7567 Compare May 26, 2025 18:52
@mschoettle mschoettle requested a review from spruce May 26, 2025 18:53
@spruce spruce merged commit 9eca5c0 into piceaTech:master May 27, 2025
@spruce
Copy link
Member

spruce commented May 27, 2025

Thanks for the work 👍

@mschoettle mschoettle deleted the add-issue-information branch May 27, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants