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

Support latest version #267

Closed
wants to merge 5 commits into from
Closed

Conversation

Schultzer
Copy link
Contributor

Description

This PR adds support for the latest version; I'm not super familiar with the codebase, so it's not the prettiest, and the tests are doomed to break when there is a new release.

@paulo-ferraz-oliveira Please let me know if this is the right direction.

Closes #266

@paulo-ferraz-oliveira
Copy link
Collaborator

If we want to support this we need to do it for all dependencies we maintain (includes Gleam, rebar3, etc.), for feature parity.

@paulo-ferraz-oliveira
Copy link
Collaborator

the tests are doomed to break when there is a new release.

We're usually up-to-date with newer releases, and update the action to test those, where appropriate.

Comment on lines 253 to 257
async function getLatestOTPVersions() {
const response = await fetch("https://api.github.com/repos/erlang/otp/releases/latest")
const json = await response.json();
return json.tag_name
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would look much better as a single function that took "org/repo" as input.

@paulo-ferraz-oliveira
Copy link
Collaborator

I have read and understood the contributing guidelines

This states "Execute npm run build-dist and fix any issues arising from that". I can't understand what failed that it didn't generate any artifacts that you'd need to push, for which CI complained later, for example here.

@Schultzer Schultzer force-pushed the support-latest-version branch 5 times, most recently from 80d2b03 to 65f2ded Compare May 6, 2024 18:21
@Schultzer
Copy link
Contributor Author

Thanks, @paulo-ferraz-oliveira I've cleaned this up.

@Schultzer Schultzer marked this pull request as ready for review May 6, 2024 18:24
@ericmj
Copy link
Collaborator

ericmj commented May 6, 2024

Should it be the latest stable version or include pre-releases?

You need to fetch the latest version from the same source we get the other versions, otherwise the task will fail when there is a new release as it's tagged before the builds are available (at least for elixir and erlang).

@Schultzer Schultzer force-pushed the support-latest-version branch from 65f2ded to bec0e22 Compare May 7, 2024 13:03
@Schultzer
Copy link
Contributor Author

Should it be the latest stable version or include pre-releases?

You need to fetch the latest version from the same source we get the other versions, otherwise the task will fail when there is a new release as it's tagged before the builds are available (at least for elixir and erlang).

Do you have an example of this, and how long would it take to create a release before the builds are available?

https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release

The latest release is the most recent non-prerelease, non-draft release, sorted by the created_at attribute. The created_at attribute is the date of the commit used for the release, and not the date when the release was drafted or published.

The latest release does not include pre-releases.

@Schultzer Schultzer force-pushed the support-latest-version branch 2 times, most recently from 34fe792 to faa1a92 Compare May 7, 2024 13:15
@Schultzer Schultzer force-pushed the support-latest-version branch from faa1a92 to 187c797 Compare May 7, 2024 13:35
@ericmj
Copy link
Collaborator

ericmj commented May 7, 2024

Do you have an example of this

You can check the builds.txt files we fetch to get the list of versions.

and how long would it take to create a release before the builds are available?

It depends on a lot of factors but normally 10-30min. Sometimes a build fails which requires manual fixing which can take hours to days.

@Schultzer
Copy link
Contributor Author

You can check the builds.txt files we fetch to get the list of versions.

I've refactored to get the latest semver version from the build.text, which should solve the issue with builds not being available and the test suite passing locally for me.

@paulo-ferraz-oliveira
Copy link
Collaborator

Let's say erlang/otp releases 24.2.5, but 24.2.4 is the one set to "latest". Shall a rule in setup-beam override that? Or where will the semantics reside?

@Schultzer
Copy link
Contributor Author

Schultzer commented May 8, 2024

Let's say erlang/otp releases 24.2.5, but 24.2.4 is the one set to "latest". Shall a rule in setup-beam override that? Or where will the semantics reside?

I realized I had a few bugs, so now I use Semver to resolve the latest Elixir and OTP builds. Furthermore, a bug in Semver prevented prereleases from being parsed, so I've updated the package.

We can leverage Semver to parse that with its right-hand rule to parse OTP release by looking if a tag has otp in it.

I tested this locally by changing the platform clauses from Linux to Darwin and Win32 to Darwin. I'm confident about the changes I committed.

@ericmj
Copy link
Collaborator

ericmj commented May 8, 2024

How does the semver library handle OTP versions that does not follow the semver specification, such as OTP-25.3.2.12?

@Schultzer Schultzer mentioned this pull request May 12, 2024
2 tasks
@Schultzer
Copy link
Contributor Author

I got lost in this codebase and the review comments; I've opened #269, which is way simpler than I tried to do here.

@Schultzer Schultzer closed this May 12, 2024
@Schultzer Schultzer deleted the support-latest-version branch July 13, 2024 16:54
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.

Support latest version tag
3 participants