Skip to content

drop node 12 / matrix against current, and latest 3 LTS node versions #369

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

Closed
wants to merge 7 commits into from

Conversation

theinterned
Copy link
Contributor

@theinterned theinterned commented Dec 28, 2022

I noticed in this PR that tests are failing in node 12 but running successfully in node 14, 16, and 18.

Given that node 12 is End-of-Life while 18 is LTS, I think we should just drop testing again 12.

I also changed the matrix to dynamically test against: latest current† (v19), lts/* (v18 is current LTS), lts/-1 (v16), and lts/-2 (v14). See node release schedule. This way these will update as node versions roll along.

There was concern that the dynamic nature would cause confusion when node versions rolled over. To counter-act this, @smockle had the great idea to create an issue when tests start failing on current. So I've set that up:

When tests fail on current, we continue-on-error (meaning the job stays green). Instead we create an issue. Here's an example of that: #378

† Note: I was originally using latest but switched to current. These are aliases, but I switched to current as that's the word used in the node release schedule.

theinterned and others added 2 commits December 29, 2022 12:06
Co-authored-by: Nick Schonning <nschonni@gmail.com>
@theinterned theinterned changed the title drop node 12 / add node 18 to test matrix drop node 12 / matrix against latest, and latest 3 LTS node versions Dec 29, 2022
@@ -12,7 +12,11 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version:
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we'll get confused / have some unexpected behavior when these things turn over.

Like, the day that a new version gets added, what if CI starts failing? That would be annoying to fix without a hardcoded list. WDYT?

Copy link
Contributor

@smockle smockle Jan 4, 2023

Choose a reason for hiding this comment

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

unexpected behavior when these things turn over

Because the matrix includes latest, when lts/* begins pointing to a new version, no failures should occur, because that new version would have already been tested, back when it was latest. So floating version (viz. lts/-2, lts/-1, lts/*) values ought to be safe.

That said, when latest itself begins pointing to a new version, failures might occur. But if we remove latest, then lts/* loses the safety described above.

Copy link
Contributor

@smockle smockle Jan 4, 2023

Choose a reason for hiding this comment

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

when latest itself begins pointing to a new version, failures might occur

Here’s one workaround: For latest (and only latest), if any step of the job fails (failure()), open an issue, then exit 0, so the overall workflow run is still green.

So, we’d still be notified of failures, but they wouldn’t block PRs (unless another version is also failing), etc.

Copy link
Contributor Author

@theinterned theinterned Jan 10, 2023

Choose a reason for hiding this comment

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

Okay! cool. I got this working!

Here's a sample failed run: https://github.com/github/eslint-plugin-github/actions/runs/3884555154, and the issue it created: #378

To test this I created a failing test 20e83a5 which I will now delete.

@theinterned theinterned force-pushed the theinterned/drop-node-12-from-test-matrix branch from ad3520f to 22e58b4 Compare January 9, 2023 23:02
@nschonni
Copy link
Contributor

You seem to be going to a lot of effort just to avoid using the version numbers in the matrix. Those changes happen infrequentely and are also a good time to evaluated if major versions of things like ESLint need to change. They usually have a major bump when version support changes

@theinterned theinterned changed the title drop node 12 / matrix against latest, and latest 3 LTS node versions drop node 12 / matrix against current, and latest 3 LTS node versions Jan 10, 2023
@theinterned theinterned requested review from nschonni, srt32, smockle and jfuchs and removed request for nschonni January 10, 2023 15:17
@theinterned theinterned force-pushed the theinterned/drop-node-12-from-test-matrix branch from 8b73ee5 to 4f9be41 Compare January 10, 2023 15:21
@nschonni
Copy link
Contributor

I'd suggest taking a look at what some of the community supported extensions do like https://github.com/eslint-community/eslint-plugin-promise/blob/main/.github/workflows/CI.yml
The CI matches the supported versions of ESLint, including some older ones that wont be dropped till a semver major release of ESLint. They also have cross version testing of the last major version of ESLint.
Since this is an internal plug-in, you've got more flexibility on choosing what you want to support though.

@theinterned
Copy link
Contributor Author

theinterned commented Jan 10, 2023

You seem to be going to a lot of effort just to avoid using the version numbers in the matrix

Yeah maybe but it was a fun to work on little challenge and I learned some stuff 🤷

Those changes happen infrequentely and are also a good time to evaluated if major versions of things like ESLint need to change. They usually have a major bump when version support changes

Note that current doesn't fail CI — but this kind of signal could alert us that there's work to do to support the next version.

@nschonni
Copy link
Contributor

Note that current doesn't fail CI — but this kind of signal could alert us that there's work to do to support the next version.

Yeah, but that support likely needs to come from ESLint first. Their matrix is also explicit, and is used to test their supported versions https://github.com/eslint/eslint/blob/2952d6ed95811ce0971b6855d66fb7a9767a7b72/package.json#L168-L170

@nschonni
Copy link
Contributor

Anyway, I'm going to unsubscribe from this as I think we're bikeshedding at this point, and it's not worth either of our time

Copy link
Contributor

@jfuchs jfuchs left a comment

Choose a reason for hiding this comment

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

Question not blocking.

run: npm test
continue-on-error: ${{ matrix.node-version == 'current' }}
- name: Create Issue on Fail
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this going to create a new issue on every failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it will. Can you think of a way to improve that?

@theinterned
Copy link
Contributor Author

Maybe this is all too much. Dropping this dynamic approach in favour of #380

It was still a fun little project.

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.

5 participants