Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Apr 10, 2025

Summary

This PR updates the prerelease deleting job after merges to main to attempt to delete all prereleases with a matching branch name for recent releases.

Fixes an issue where multiple prereleases for the same PR might've been created if changes are made across a stable tag:

Preview

The following job deleted a prerelease for the "mbrooks-slackcontext-tabletestcommand" branch of #20:

https://github.com/slackapi/slack-cli/actions/runs/14363050122/job/40269188613#step:2:36

Successfully deleted v3.0.4-mbrooks-slackcontext-tabletestcommand

But a prerelease still exists for now of a version prior:

https://github.com/slackapi/slack-cli/releases/tag/v3.0.3-mbrooks-slackcontext-tabletestcommand

Which seems to've been created with the first commit of #20 happening before v3.0.4 while the PR was updated afterward.

Notes

  • A similar change was made in ci(fix): delete branch prereleases started in prior versions on merge to main #15 but didn't account for multiple prereleases. AFAICT that guarded against merges made after a release and without additional changes since that release. This PR handles more cases!
  • I plan to delete merged prereleases if the changes of this PR are alright and it merges. Keeping this list sharp seems useful for later references 📚

Requirements

@zimeg zimeg added semver:patch Use on pull requests to describe the release version increment build M-T: Changes to compilation and CI processes labels Apr 10, 2025
@zimeg zimeg added this to the Next Release milestone Apr 10, 2025
@zimeg zimeg self-assigned this Apr 10, 2025
@zimeg zimeg requested a review from a team as a code owner April 10, 2025 23:53
Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

📝 Leaving wording on a perhaps unexpected change within for the kind reviewers!

else
echo "Failed to find $TAG_NAME, trying next..."
fi
sleep 1
Copy link
Member Author

Choose a reason for hiding this comment

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

😴 Rest is so important and I hope this helps us avoid rate limits of rapid loops!
https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#about-secondary-rate-limits

@codecov
Copy link

codecov bot commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.94%. Comparing base (cf5fcb1) to head (0d6687e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
+ Coverage   62.91%   62.94%   +0.02%     
==========================================
  Files         210      210              
  Lines       22127    22127              
==========================================
+ Hits        13922    13928       +6     
+ Misses       7117     7115       -2     
+ Partials     1088     1084       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zimeg zimeg changed the title ci: continue attempts to delete prereleases from prior versions on merge ci: attempt deletion of branch prereleases from prior versions on merge Apr 10, 2025
Copy link
Contributor

@hello-ashleyintech hello-ashleyintech left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

✅ LGTM!

👏🏻 This is super clever @zimeg! I hope this helps to keep our pre-releases and tags more tidy 🤞🏻

@zimeg
Copy link
Member Author

zimeg commented Apr 11, 2025

@hello-ashleyintech @mwbrooks Thank you both for the reviews!

These will be interesting logs to inspect on merges - I'll follow up with logs of this PR as possible - and I'm too hoping we'll keep a nice list of stable versions 🙏 ✨

@zimeg zimeg merged commit b76e933 into main Apr 11, 2025
6 checks passed
@zimeg zimeg deleted the zimeg-ci-delete-prior-prereleases branch April 11, 2025 18:15
@zimeg
Copy link
Member Author

zimeg commented Apr 11, 2025

😌 We're looping as expected it seems:

https://github.com/slackapi/slack-cli/actions/runs/14409471076/job/40413804506#step:2:26

Identified pre-release tagname to 🔪: v3.0.4-zimeg-ci-delete-prior-prereleases
...
Successfully deleted v3.0.4-zimeg-ci-delete-prior-prereleases
Identified pre-release tagname to 🔪: v3.0.3-zimeg-ci-delete-prior-prereleases
...
release not found
Failed to find v3.0.3-zimeg-ci-delete-prior-prereleases, trying next...
...

release not found
Failed to find v3.0.2-zimeg-ci-delete-prior-prereleases, trying next...
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build M-T: Changes to compilation and CI processes semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants