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

feat: Introduce ecosystem tests for popular plugins #127

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

JoshuaKGoldberg
Copy link
Contributor

Summary

Adding an CI job to the eslint/eslint repo that checks changes against a small selection of third-party plugins.

Related Issues

eslint/eslint#19139

@fasttime fasttime added the Initial Commenting This RFC is in the initial feedback stage label Nov 26, 2024
@voxpelli
Copy link

That none of the eslint-community plugins are included feels a bit odd? Since it's somewhat operated under the same umbrella as ESLint itself?

At least one of eg eslint-plugin-n, eslint-plugin-promise or eslint-plugin-security would be good to include?

I also note that the selection criteria is similar to those outlined in the suggested eslint-community governance, and which have gotten feedback / objections / concerns there: eslint-community/governance#1 (comment)

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

My apologies, I started a review last week, left a bunch of comments, and then forgot to hit "Submit Review".

I think this outlines a good infrastructure, just looking for some clarifications.

Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

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

Looks great to me! This is an excellent starting point. We can proceed to run it and see how it performs. 🚀🚀🚀

2. On the `main` branch only
3. On all PRs targeting the `main` branch, alongside existing CI jobs

Starting with a job separately from `main` ensures that unexpectedly high frequencies of breakages are caught early, without blocking `main` branch builds.
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit confused by this process. Is the intent that we end up with all three at the end? Or just number 3?

And I'm unclear on the value of number 2. Presumably, this is meant to run only after a PR is merged, but how will we be notified if the job fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

intent

My intent was that each step would replace the previous. As in, at the end, we end up with just 3, which is a superset of 2.

how will be notified

I was thinking the ❌ failing commit on the main branch.

I clarified the intent in c767f0f. Does that make sense?

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking the ❌ failing commit on the main branch.

The problem with this is that it's passive -- it requires someone looking at the GitHub repo Code tab. (And then it requires that someone care enough to click on it to see what's going on.) I feel like this will be easy to miss. Is there some way to have a notification of some sort?

Copy link
Member

Choose a reason for hiding this comment

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

GitHub user that merged the PR gets a notification if CI checks failed on the main branch, so perhaps that user could take further steps and/or notify the rest of the team in the team channel.

Copy link
Member

Choose a reason for hiding this comment

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

I don't get GitHub emails so I'd never know. 😄 I think we need an automated solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about sending a Discord message to the #contributors channel? Something like https://github.com/Ilshidur/action-discord could automate it.

My only concern there would be spamming the channel if multiple successive builds fail. Folks might be merging PRs without keeping them up-to-date with main. We can always add logic to only run the message if the current commit build failed and the previous commit build succeeded.

nzakas
nzakas previously approved these changes Feb 6, 2025
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

I think the direction of this makes sense now. Nice work.

The new CI job will, for each plugin:

1. Clone the plugin into a directory named `test/ecosystem/${plugin}`
2. Run the plugin's package installation and build commands with [ni](https://github.com/antfu-collective/ni)
Copy link
Member

Choose a reason for hiding this comment

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

How will ni be installed? And will ni automatically install npm (or another package manager) if it's not found locally, and does this also work in a CI environment?

Copy link
Contributor Author

@JoshuaKGoldberg JoshuaKGoldberg Mar 3, 2025

Choose a reason for hiding this comment

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

installed

npm i -g ni,

automatically install

The nci command will.

I'll make those two points explicit.

Aside: I filed antfu-collective/ni#263 as a docs issue on ni to support this.

2. Run the plugin's package installation and build commands with [ni](https://github.com/antfu-collective/ni)
3. Link the plugin to the current eslint installation
- This will have to be done manually, as ni does not support linking ([ni#85](https://github.com/antfu-collective/ni/issues/85 "ni issue 85: Maybe xxx link can join ni project"))
4. Run the plugin's `test:eslint-compat` script with [ni](https://github.com/antfu-collective/ni)
Copy link
Member

Choose a reason for hiding this comment

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

Does ni also install Node.js in the correct version for the package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but last I checked, these packages are all fine with running on approximately the same Node.js versions as ESLint's CI. As in, they might specify preferred packageManager / .nvmrc versions, but they should pass CI.


See [Plugin Selection](#plugin-selection) below for specifics on which plugins will be included.

> ⚠️ Plugins are currently being asked for feedback on the `test:eslint-compat` script.
Copy link
Member

Choose a reason for hiding this comment

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

That's good. If there are any questions I think we can also discuss them in this RFC.

@mdjermanovic
Copy link
Member

@JoshuaKGoldberg just a reminder there are a few questions left.

@JoshuaKGoldberg
Copy link
Contributor Author

👍 I'd been hoping for an answer on the Discord messaging, #127 (comment). I just went ahead now and pushed it as part of the RFC for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Initial Commenting This RFC is in the initial feedback stage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants