Skip to content
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

Gracefully handle creating milestone with existing name #4655

Conversation

misiekhardcore
Copy link
Contributor

@misiekhardcore misiekhardcore commented Nov 1, 2024

related to #https://github.com/bpmn-io/internal-docs/issues/1052

Proposed Changes

Check if milestone exists before trying to create it to prevent the action from exiting with an error when trying to create a milestone which already exists (e.g. https://github.com/camunda/camunda-modeler/actions/runs/11625285084/job/32375114566)

Previous approach (done in #4639 ) turned out to not work as expected in GHA environment

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Nov 1, 2024
Copy link

github-actions bot commented Nov 1, 2024

This Pull Request targets develop branch, but contains fix commits.

Consider targeting main instead.

TITLE: ${{github.event.milestone.title}}
run: |
MILESTONE_NUMBER=${TITLE:1}
INCREMENTED_NUMBER=$((MILESTONE_NUMBER + 1))
echo "MILESTONE_NAME=M$INCREMENTED_NUMBER" >> $GITHUB_OUTPUT
- name: Check if Milestone already exists
id: checkIfMilestoneExists
Copy link
Member

Choose a reason for hiding this comment

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

Consider our discussions on steps naming in #4650 adjust your changes accordingly.

@nikku
Copy link
Member

nikku commented Nov 1, 2024

Fun fact: I thought about this approach as I reviewed your previous contribution. I ended up ditching it, as both have their merits. I do think this is cleaner and more robust though, so great to see we're taking this route now.

Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

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

Let's test this in real life to verify it works.

@nikku nikku force-pushed the 1052-gracefully-handle-new-release-milestone-already-existing branch from 5a0d5ca to bf14341 Compare November 1, 2024 10:52
@misiekhardcore misiekhardcore force-pushed the 1052-gracefully-handle-new-release-milestone-already-existing branch from bf14341 to d2a3444 Compare November 1, 2024 11:28
@misiekhardcore
Copy link
Contributor Author

I updated the naming according to our new convention and I am merging it as soon as CI passes

@misiekhardcore misiekhardcore merged commit e6cef09 into develop Nov 1, 2024
12 checks passed
@misiekhardcore misiekhardcore deleted the 1052-gracefully-handle-new-release-milestone-already-existing branch November 1, 2024 11:37
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Nov 1, 2024
@github-actions github-actions bot added this to the M83 milestone Nov 1, 2024
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