Skip to content

Do not create milestone events for nonexistent milestones

What does this MR do and why?

This prevents milestone events from being created on projects imported from GitHub when the milestone was deleted in GitHub. GitHub treats its timelines as immutable, so events remain in an issue/pull request timeline even if the associated milestone is deleted. GitLab however, deletes associated events when a milestone is deleted. To prevent odd behavior in the UI, skip creating milestone events when there is no associated milestone in GitLab.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
image image
"changed milestone to 4 days ago" doesn't make sense Now there's simply no event for a deleted milestone

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Create or find a repository on GitHub that has issues and pull requests that have had deleted milestones tied to them. (You can do this yourself by making a milestone, associating it to an issue, then deleting the milestone).
  2. Import the repository into GitLab.
  3. See that the issues and merge requests associated to deleted milestone events in the imported repo have milestone events that look something like "changed milestone to 4 days ago."

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #429482 (closed)

Edited by Sam Word

Merge request reports