-
Notifications
You must be signed in to change notification settings - Fork 7
Do not update to latest version if it is prerelase #11
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
Do not update to latest version if it is prerelase #11
Conversation
I'm not sure how to check that my changes are actually working correctly. Also, the CI is failing for some reason. |
I also formatted the code using |
@mhmdanas I'll have some time to come back to this tomorrow for a proper review. In the meantime, would you mind not formatting with Purty? It's much easier to review if I can see just what's changed (vs. the whole file being changed). Any formatting should ideally happen in a separate PR. That said, due to some formatting issues with Purty I'm not quite ready to switch to it across these projects. I hope to someday, but if you could try and keep the formatting roughly the same as what exists already I would really appreciate that. |
I have no problem with that. Will try to revert the formatting as much as possible. |
I reverted all the formatting of the already existing code. I should probably ask if I can format the code before I actually do it. I'll investigate why the CI is failing. |
I dug a bit into the generated JS, using good ol'
|
It seems I fixed the problem. I was already suspicious that the slash before the question mark was the cause. Is this the new "I forgot to add a semicolon" but reversed? Edit: seems like there's a version that doesn't comply with SemVer. What should I do? |
We should only update to the latest version if it is a) a SemVer version and b) not a pre-release version.
No need! It's failing because of an issue with the FFI in the actions toolkit bindings, and that's fixed and released. I'll update this repository to use that release. |
How do we know if it's actually a version, even if it's not SemVer? It could be a non-SemVer version, or it might not even be a version. Should I not care about this and just ignore any invalid versions? |
Yea, anything invalid should be ignored. We only want the latest valid SemVer, non-prerelease version. In fact, I saw in purescript-contrib/governance#25 that draft releases are also included in the GitHub response, so we'll want to filter those out too. Jordan wrote some similar code in that PR to what you're writing here, which may be helpful! |
I see. Should I log a warning about invalid versions? For the PR you linked to, Jordan's code does look similar to mine. I'll look in it if I need anything. Also, for the default number of entries per page, I used 10, but I think 5 might be enough. Should I keep it as it is or change it? Edit: also, what are draft releases exactly? First time I heard of them. |
I think that would be a nice addition! In the github-actions-toolkit bindings there's a function for producing warnings (I believe it's actually called
I think 10 entries is fine. We could even pull the maximum, which I believe is 30. It's better to bring in the larger response so that we have to make fewer requests in the worst case. I think the difference between pulling 5 and 30 results will be negligible.
When you publish a new release on GitHub -- not a tag, but the release itself -- you can choose to make it a "draft" to indicate it is not actually published yet. A draft release won't be listed as the "latest" release. It may not even be visible in the UI except to project collaborators, I'm not sure. In any case we definitely don't want to pull in draft releases and set that in CI! |
By the way, as of #13 the CI should be fixed. You can merge that into this branch to get builds working again. |
Thanks! I'll try using that.
The maximum is actually 100. I asked if I should make it 5 because currently the tools mostly don't use pre-releases. But you're right in that the difference is negligible. I personally think we should keep it at 10, but if you think otherwise I'm fine with it.
I'll see how I can get that from the JSON response. |
Actually, as you can see in one of my comments, I had an extraneous slash which caused GitHub to return a "Not Found" error. So it's also on me! |
Fine by me!
You can see a JSON codec that Jordan implemented in his PR that I linked. It includes that field. |
This reverts commit d2ad9a7.
Thanks! |
Fixes #10.