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

Community maintenance of actions/setup-node? #462

Open
dominykas opened this issue Apr 25, 2021 · 22 comments
Open

Community maintenance of actions/setup-node? #462

dominykas opened this issue Apr 25, 2021 · 22 comments

Comments

@dominykas
Copy link
Member

dominykas commented Apr 25, 2021

It doesn't seem like actions/setup-node#26 will get resolved any time soon. There are other features requested (incl. PRs open) that don't seem to be getting the attention they deserve.

Should Node.js have an official action of its own?

This way we could implement the keywords support, and possibly we could recommend a different default matrix to the users.

The default matrix does have a tradeoff - right now,
a maintainer has to add new versions each time, if we recommended, say [ lts-1, lts, latest ] as the default, then the tested versions would drop off without notice, but I figure that testing in latest versions is more valuable than testing in unsupported versions, even if breaking that support means the need to bump semver major.

Related: #416

@ljharb
Copy link
Member

ljharb commented Apr 25, 2021

I've got the node/matrix and node/install actions under https://github.com/ljharb/actions, the latter of which uses nvm. It currently doesn't support windows but only because i haven't gotten around to it. I use it on all 2-300 of my projects. nvm supports lts/*, lts/argon etc, and lts/-1 etc.

In other words, even if folks wanted to use setup-node, they could still use my matrix action to automatically support whatever versions they like. Here's an example: https://github.com/ljharb/unbox-primitive/blob/main/.github/workflows/node-4%2B.yml#L6-L23

@dominykas
Copy link
Member Author

Without the shareable workflows that's a lot of boilerplate to copy/paste... And shareable workflows got bumped to Q3.

Not saying we shouldn't recommend it, just that the matrix is still a burden... Any chance you managed to get around to automating the maintenance of distributing the boilerplate?

Also it's not that you're a some random dude online, but part of the reason why I raised this is to see if it would be useful to make it "official"?

@ljharb
Copy link
Member

ljharb commented Apr 25, 2021

No, I still haven't solved that, unfortunately.

tbh I think that once there's shareable workflows, there's a lot less value in having an official one.

@dominykas
Copy link
Member Author

Well, once there's shareable workflows, there's still the benefit of having this moved out into a community... If we can form a community around it specifically.

That said, I wouldn't hold my breath waiting for the shareable workflows...

@mhdawson mhdawson added the package-maintenance-agenda Agenda items for package-maintenance team label May 3, 2021
@dominykas dominykas changed the title Let's fork actions/setup-node? Community maintenance of actions/setup-node? Jun 28, 2021
@mhdawson mhdawson removed the package-maintenance-agenda Agenda items for package-maintenance team label Jul 15, 2021
@bnb
Copy link
Contributor

bnb commented Sep 7, 2021

FWIW it seems like the root point in this issue (actions/setup-node#26) was addressed: actions/setup-node#26 (comment)

@ljharb
Copy link
Member

ljharb commented Sep 7, 2021

True enough, but that it took so long to do something so basic suggests that indeed we need something owned by the community.

@bnb
Copy link
Contributor

bnb commented Sep 7, 2021

True enough, but that it took so long to do something so basic suggests that indeed we need something owned by the community.

Sure, fair enough. It's also probably indicative of community need (or lack thereof) that a solution didn't gain traction over actions/setup-node despite it taking 2 years to actually ship that feature.

@ljharb
Copy link
Member

ljharb commented Sep 7, 2021

Very true. I think that it wasn't until travis changed their pricing - last November - that Actions really became the solution of choice, and in the intervening time, I created my own solution for my hundreds of packages, and I think others just manually made a matrix.

In other words, I think there's community need, but it's very difficult for anything non "standard" to gain traction.

@bnb
Copy link
Contributor

bnb commented Sep 7, 2021

I think others just manually made a matrix.

yeah, this is basically the solution I used for everything. I'll slowly update my files to not be like this anymore. It worked but had a maintenance burden, which the new update relatively solves.

In other words, I think there's community need, but it's very difficult for anything non "standard" to gain traction.

If that's the case, do you think it's a worthwhile investment of our time to work on this? I am perpetually concerned about spreading ourselves over many projects and having a mediocre execution vs. focusing on a few projects and doing them well.

@ljharb
Copy link
Member

ljharb commented Sep 7, 2021

Note that I did create an action that automatically makes a matrix :-) but nobody besides me has adopted it.

Yes, I do think it's worthwhile, but I can't speak to prioritization.

@dominykas
Copy link
Member Author

dominykas commented Sep 26, 2021

Well, I did add a repo for pkgjs/action - I just haven't had a chance to start any discussions there, but I would hope that as a wrapper layer around actions/setup-node we'd be able to solve at least some problems, as opposed to straight out fork, esp. given the concerns that the official action is a part of a broader commercial offering and it is after all "official", so indeed overcoming that inertia would be really tricky.

Either way, it also seems that actions/setup-node does have some renewed activity, so maybe this particular issue is best closed and offloaded to pkgjs/action.

Note that I did create an action that automatically makes a matrix :-) but nobody besides me has adopted it.

That's because the ergonomics of achieving that are really not pretty... :( I can't advocate for it in good conscience :D And then you still have to maintain the yaml boilerplate (it will have to evolve over time, won't it?). Maaaybe packaging that up as an npm package to simplify the distribution is an option? github/roadmap#98 was originally scheduled for Q2, then rescheduled for Q3, but it's really hard to guess if it's any closer...

But even without the reusable workflows - having an explicit option in the workflows API to just load the matrix variables from an external URL would solve 99% of the problem... But I have no idea how to reach the people who can influence an implementation of such a thing.

@ljharb
Copy link
Member

ljharb commented Sep 26, 2021

No, the boilerplate and action need no further changes forever. I agree it’s not super ergonomic, but I’m hoping that can change as GHA adds reuse features.

@dominykas
Copy link
Member Author

At the risk of veering just slightly off topic - spotted this on one of the GHA issues: actions/runner#834 (comment) - basically, it's a suggestion to work around the lack of if inside composite actions by generating the action and executing it (effectively an eval) - I wonder if that could work to also do the matrix?

@bnb
Copy link
Contributor

bnb commented Sep 27, 2021

honestly, if we were to approach this I'd really recommend that we take the approach that Twitter Together takes where the action you add is actually a meta action that manages your other actions.

the DX of this is rather nice, and allows you to centrally manage updates a bit more effectively.

@ljharb
Copy link
Member

ljharb commented Sep 27, 2021

I'm not sure if it would work, since i think the matrix config needs to be statically available to GHA.

@bnb
Copy link
Contributor

bnb commented Sep 27, 2021

@ljharb what about an action committing a static action wouldn't work?

@bnb
Copy link
Contributor

bnb commented Sep 27, 2021

basically:

  • Add Controller action
    • Controller action commits CI action to the repo
    • CI action runs as CI

When you want to update the CI action, you update the configuration the Controller action commits, and either have it on a cron or manually runnable to update the committed CI action.

@ljharb
Copy link
Member

ljharb commented Sep 27, 2021

@bnb oh sorry, i was replying to #462 (comment)

What you're saying would work, but it'd create a ton of extra commit noise, and you wouldn't be able to test the action changes against the repo before committing them (when making changes to the controller)

@bnb
Copy link
Contributor

bnb commented Sep 27, 2021

have the controller PR rather than directly commit :P

@ljharb
Copy link
Member

ljharb commented Sep 27, 2021

Maybe I'm misunderstanding, but that would be multiple steps:

  1. update the controller
  2. the controller sends a PR, where tests are run.

You wouldn't be able to test step 1 until after it was completed.

@bnb
Copy link
Contributor

bnb commented Sep 27, 2021

what do you need to test in step 1?

@ljharb
Copy link
Member

ljharb commented Sep 27, 2021

I'd be using this controller on 300 projects. I'd want to make sure that I wasn't about to create 300 failing PRs.

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

No branches or pull requests

4 participants