Skip to content

Conversation

@paulo-ferraz-oliveira
Copy link
Collaborator

@paulo-ferraz-oliveira paulo-ferraz-oliveira commented Jul 3, 2025

Description

This'll address two issues:

  1. obtaining known-branch versions (like main/maint)
  2. obtaining non-specific version nightly

I'll start by pushing tests that show the issue and then a fix that shouldn't affect any other tests.

Issue 1: https://github.com/erlef/setup-beam/actions/runs/16057710018/job/45316130218#step:5:54
Issue 2: https://github.com/erlef/setup-beam/actions/runs/16057710018/job/45316130218#step:5:67

Closes #356.
Closes #358.

⚠️ of note: stuff like 26 (if strict) was getting calculated as maint-26. It's no longer the case, but I think we can live with that (?)

1. stop trying to "coerce" versions on input
2. handle `OTP-` in one more place
3. handle `nightly`
Comment on lines -46 to -51
- otp-version: '27'
os: 'macos-15'
version-type: 'strict'
- otp-version: '26'
os: 'macos-15'
version-type: 'strict'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This shoulda been failing but wasn't. Guess it wasn't as strict as we intended...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, it was getting calculated as maint-<otp-version>.

@paulo-ferraz-oliveira paulo-ferraz-oliveira force-pushed the fix/more-versioning branch 2 times, most recently from 23af438 to 127dcbd Compare July 3, 2025 18:56
it('is Ok for known linux version', async () => {
before = simulateInput('version-type', 'strict')
spec = '26'
spec = 'maint-26'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This made no sense, but now we see it. Why would we want 26 to strict to be maint-26? These days this is opt-in, so I think some sanity was restored.

There is no strict 27 for macos-15, for example
Comment on lines 561 to 566
spec = 'main-otp-28'
otpVersion = 'maint-28'
expected = 'main-otp-28'
await setupBeam.installOTP(otpVersion)
got = await setupBeam.getElixirVersion(spec, otpVersion)
assert.deepStrictEqual(got, expected)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here's the test for #358.

Comment on lines +627 to +631
spec = 'nightly'
otpVersion = '28'
expected = 'nightly'
got = await setupBeam.getGleamVersion(spec, otpVersion)
assert.deepStrictEqual(got, expected)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here's the test for #356.

@paulo-ferraz-oliveira
Copy link
Collaborator Author

@lpil (the strict I told you about, before, is not required - and most likely for your use case wouldn't make sense), @SteffenDE, feel free to review.

@paulo-ferraz-oliveira paulo-ferraz-oliveira marked this pull request as ready for review July 3, 2025 19:04
@wojtekmach
Copy link
Collaborator

wojtekmach commented Jul 4, 2025

of note: stuff like 26 (if strict) was getting calculated as maint-26. It's no longer the case, but I think we can live with that (?)

definitely, I would considered that a bug that version-type: strict, otp-version: 26 pointed to maint-26, an unreleased version. It couldn't work on Windows since there are no windows builds for maint*. What does it point to now or does it error?

@paulo-ferraz-oliveira
Copy link
Collaborator Author

of note: stuff like 26 (if strict) was getting calculated as maint-26. It's no longer the case, but I think we can live with that (?)

definitely, I would considered that a bug that version-type: strict, otp-version: 26 pointed to maint-26, an unreleased version. It couldn't work on Windows since there are no windows builds for maint*. What does it point to now or does it error?

We're not testing it on Windows, I believe. I'll see about adding a test to verify the new behavior.

@wojtekmach
Copy link
Collaborator

wojtekmach commented Jul 4, 2025

Using this PR,

          - elixir-version: "1.18.4"
            otp-version: "26"
            version-type: 'strict'

resolves to:

Elixir:
Erlang/OTP 26 [erts-14.2.5.10] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]

Elixir 1.18.4 (compiled with Erlang/OTP 26)
OTP:
26.2.5.13

(https://github.com/wojtekmach/setup_beam_bug/actions/runs/16078422072/job/45378645101)

Is that expected?

@paulo-ferraz-oliveira
Copy link
Collaborator Author

I think the strict should resolve exactly to input (give or take a v and OTP- prefix), so if 26 is 26.2.5.13 it's wrong.

We'll test once per platform in similar conditions
@wojtekmach
Copy link
Collaborator

Agreed

@paulo-ferraz-oliveira paulo-ferraz-oliveira force-pushed the fix/more-versioning branch 5 times, most recently from 9b94d01 to b44ebc6 Compare July 4, 2025 17:49
@paulo-ferraz-oliveira
Copy link
Collaborator Author

paulo-ferraz-oliveira commented Jul 4, 2025

Is it possible you forgot version-type? https://github.com/wojtekmach/setup_beam_bug/actions/runs/16078422072/job/45378645101#step:2:9 (I'm seeing loose there)

Edit: even if you didn't and I'm not seeing something, I'm pushing code so that we have a validation that strict is strict (alongside an exception for the case you mentioned - which unfortunately, at least at the moment, we can't be too strict on, until we wanna parse the error message).

@wojtekmach
Copy link
Collaborator

Yes that's what happened, my workflow file was wrong, apologies for any confusion. https://github.com/wojtekmach/setup_beam_bug/actions/runs/16078422072/workflow

@paulo-ferraz-oliveira
Copy link
Collaborator Author

No prob. As stated, if we have tests for specific situations we have less doubts.

.forEach((line) => {
const otpMatch = line
.match(/^([^ ]+)?( .+)/)[1]
.match(/^([^-]+-)?(.+)$/)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one goes away.

@paulo-ferraz-oliveira
Copy link
Collaborator Author

I'm merging, for release, in the hopes:

  1. this makes for better results
  2. this includes enough tests around the changes
  3. this marginally simplifies the implementation

@paulo-ferraz-oliveira paulo-ferraz-oliveira merged commit fceaea9 into main Jul 10, 2025
74 checks passed
@paulo-ferraz-oliveira paulo-ferraz-oliveira deleted the fix/more-versioning branch July 10, 2025 15:20
@paulo-ferraz-oliveira
Copy link
Collaborator Author

This was released in v1.20.4.

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.

OTP maint-28 is not found any more No longer able to install nightly Gleam version

3 participants