Project Management Automation: Tolerate duplicate milestone #20011
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.
Related (possibly blocks): #20009
This pull request seeks to resolve an issue where the milestone assignment automation will fail to assign the milestone to a pull request when attempting to create the milestone would result in a duplicate milestone error. Prior to #17080, a duplicate milestone was considered tolerable. If the milestone already exists, it simply proceeds to assign the milestone. However, since this milestone creation would throw an error in the new JavaScript implementation, there was no chance for the task to recover to proceed to assigning the milestone.
With these changes, a thrown error is tolerated within the task, as long as it represents an error from a duplicate milestone.
Note: A possible future refactoring to this task could try to fetch the milestone first, and only if determined to not exist, proceed to create the milestone.
Testing Instructions:
This can only be tested once merged, confirming that a milestone is assigned.