craft icon indicating copy to clipboard operation
craft copied to clipboard

fix(github): Fix making github releases latest or not

Open mydea opened this issue 1 year ago • 8 comments

I have no idea why the check for latest failed here: https://github.com/getsentry/publish/actions/runs/9111373580/job/25048351278#step:11:2317

So adding some more logging here is not unreasonable I guess!

mydea avatar May 16 '24 11:05 mydea

can you describe the issue? it's unclear what you're trying to solve for (additionally this PR makes changes beyond logging)

asottile-sentry avatar May 16 '24 11:05 asottile-sentry

can you describe the issue? it's unclear what you're trying to solve for (additionally this PR makes changes beyond logging)

The problem is that it does not seem to be working, it is still marking the stuff as latest. But I can't see anything wrong, and the existing logs make it impossible to know where this failed (e.g. could it not find the previous release? is the version from there picked up incorrectly? ...)

mydea avatar May 16 '24 12:05 mydea

probably don't need the logging -- the problem is that the draft was created correctly (non-latest) but then converted to latest when moved out of draft because this defaults to make_latest: true: https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#update-a-release

asottile-sentry avatar May 16 '24 12:05 asottile-sentry

I think the additional logging makes sense but it's better not to change other stuff.

BYK avatar May 16 '24 12:05 BYK

probably don't need the logging -- the problem is that the draft was created correctly (non-latest) but then converted to latest when moved out of draft because this defaults to make_latest: true: https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#update-a-release

Ahh, great catch. I'll update this accordingly! I think I'll leave the logging in, it can still be helpful I'd say? At least the log for what the previous release was!

mydea avatar May 16 '24 12:05 mydea

probably don't need the logging -- the problem is that the draft was created correctly (non-latest) but then converted to latest when moved out of draft because this defaults to make_latest: true: https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#update-a-release

Ahh, great catch. I'll update this accordingly! I think I'll leave the logging in, it can still be helpful I'd say? At least the log for what the previous release was!

🤷 personally I'd rather not just because it's even more output clutter -- and it wouldn't have helped us find the answer here

asottile-sentry avatar May 16 '24 12:05 asottile-sentry

So I updated this to ensure we set make_latest in publishRelease as well, which meant that I extracted this out to only call this once!

mydea avatar May 16 '24 12:05 mydea

as I requested above, and as I've done in many of your PRs: please limit the change to just the functional change instead of coupling it with unrelated (and imo undesirable) changes. this makes it easier to review, easier to reason about, easier to rollback, and generally is how one should approach development

asottile-sentry avatar May 23 '24 12:05 asottile-sentry

I updated this to only include minimal changes necessary to make this work. The core change is that we ensure to also set make_latest when we call updateRelease now. I also included the fix from https://github.com/getsentry/craft/pull/567 as this is moved around here.

mydea avatar Jan 10 '25 09:01 mydea