erlef / setup-beam

Set up your BEAM-based GitHub Actions workflow (Erlang, Elixir, Gleam, ...)
MIT License
378 stars 51 forks source link

Potentially fix timeouts/retries when fetching from remote #304

Closed btkostner closed 1 month ago

btkostner commented 1 month ago

Description

This action uses node 20, which now has the built in fetch implementation. We can use that instead of the @action/http-client package. This allows us to do our own retry implementation to fix the long standing issue #260.

Closes issue: #260

paulo-ferraz-oliveira commented 1 month ago

👋 Is there a mechanism (even if very dumb/simple) to try and test this?

btkostner commented 1 month ago

@paulo-ferraz-oliveira Looks like GH can just pull directly from the branch and everything should work. So try instead of using erlef/setup-beam, do btkostner/setup-beam@retry and see if that works.

paulo-ferraz-oliveira commented 1 month ago

It'll work if CI passes, I'm not worried about that bit. I was thinking of what we could do to have reliable repeatable tests.

btkostner commented 1 month ago

@paulo-ferraz-oliveira Added a test using the built in node server. Verified it is working as intended locally. I added a 10 second timeout to fetch calls, though the original code had a 3 minute socket timeout by default which seems very long.

https://github.com/actions/toolkit/blob/6dd369c0e648ed58d0ead326cf2426906ea86401/packages/http-client/src/index.ts#L531

paulo-ferraz-oliveira commented 1 month ago

D'you wanna be a pal and remove the failing test from CI? It happens because we're targetting OTP 24 and rebar3 3.24 doesn't support it.

And would you also update test/.tool-versions to more recent versions?

If not, I can do both, but you'd have to rebase later... 👍

btkostner commented 1 month ago

Looks like something is installing rebar3 and the action does not like that. I'd say it's another issue that should be addressed in another PR. Probably something about force overwriting files when installing.

wojtekmach commented 1 month ago

Thank you!

I'll fix the test failure on main. We have this line for rebar:

fs.mkdirSync(bindir)

and we're doing it twice on CI, once for npm test step and once for .tool-versions test step. I'll change it to:

fs.mkdirSync(bindir, { recursive: true })
paulo-ferraz-oliveira commented 1 month ago

Released in v1, v1.18 and v1.18.2. Thanks.