Skip to content

Commit 19e8411

Browse files
authored
Merge pull request #263 from greatestview/fix/milestone-id
fix: Make milestone id assignment bulletproof
2 parents 9f9ae6c + ea6f8a6 commit 19e8411

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,9 @@ async function transferMilestones(usePlaceholders: boolean) {
321321
let milestones: (GitLabMilestone | MilestoneImport)[] =
322322
await gitlabApi.ProjectMilestones.all(settings.gitlab.projectId);
323323

324-
// sort milestones in ascending order of when they were created (by id)
325-
milestones = milestones.sort((a, b) => a.id - b.id);
324+
// sort milestones in ascending order of their project-scoped id (iid),
325+
// since the placeholder logic relies on iid ordering
326+
milestones = milestones.sort((a, b) => a.iid - b.iid);
326327

327328
// get a list of the current milestones in the new GitHub repo (likely to be empty)
328329
const githubMilestones = await githubHelper.getAllGithubMilestones();

0 commit comments

Comments
 (0)