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

New: implement eslint/rfcs#63 #13713

Closed

Conversation

billiegoose
Copy link
Contributor

@billiegoose billiegoose commented Sep 23, 2020

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[x] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

This is heavily based on #11487 but as per the RFC the names of the options have been changed.

I also rebased it and tried to get all the tests passing. There's still one failing locally. Not sure what that's about yet.
image

Is there anything you'd like reviewers to focus on?

My original PR was a one-liner. And now my PR is largely someone elses code 😬 so aaaaany help would be appreciated. I don't care about credit, I just want this feature shipped so my team stops burning through CircleCI minutes waiting to lint files that don't need to be linted.

background

Currently CI users resort to hacks such as manually modifying the mtime of all their files:
https://github.com/salto-io/salto/pull/395/files#diff-5d8151d7fb61e762279563e3d38abd41R1-R17

Previous attempts to address this:

@jsf-clabot
Copy link

jsf-clabot commented Sep 23, 2020

CLA assistant check
All committers have signed the CLA.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Sep 23, 2020
@nzakas
Copy link
Member

nzakas commented Sep 24, 2020

Thanks for attempting this. I’m not comfortable with reading an environment variable for this purpose — that’s just one assumption too many when determining how ESLint should behave.

We did recently merge this RFC that covers this use case: eslint/rfcs#63

@billiegoose
Copy link
Contributor Author

Oh that's fantastic! That's great. Is there already an implementation of RFC 63? If not, I can pivot to implementing it.

@billiegoose
Copy link
Contributor Author

@c-home anything I can do to help?

@nzakas
Copy link
Member

nzakas commented Sep 24, 2020

I don't believe implementation has started yet, so you can feel free!

@eslint-deprecated
Copy link

Hi @wmhilton!, thanks for the Pull Request

The first commit message isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag must be one of the following:

    The Tag is one of the following:

    • Fix - for a bug fix.
    • Update - either for a backwards-compatible enhancement or for a rule change that adds reported problems.
    • New - implements a new feature.
    • Breaking - for a backwards-incompatible enhancement or feature.
    • Docs - changes to documentation only.
    • Build - changes to build process only.
    • Upgrade - for a dependency upgrade.
    • Chore - for anything that isn't user-facing (for example, refactoring, adding tests, etc.).

    You can use the labels of the issue you are working on to determine the best tag.

Read more about contributing to ESLint here

@billiegoose billiegoose changed the title Fix: --cache ignores file mtime in CI environments Feat: implementation of eslint/rfcs#63 Sep 25, 2020
@eslint-deprecated
Copy link

Hi @wmhilton!, thanks for the Pull Request

The first commit message isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag must be one of the following:

    The Tag is one of the following:

    • Fix - for a bug fix.
    • Update - either for a backwards-compatible enhancement or for a rule change that adds reported problems.
    • New - implements a new feature.
    • Breaking - for a backwards-incompatible enhancement or feature.
    • Docs - changes to documentation only.
    • Build - changes to build process only.
    • Upgrade - for a dependency upgrade.
    • Chore - for anything that isn't user-facing (for example, refactoring, adding tests, etc.).

    You can use the labels of the issue you are working on to determine the best tag.

Read more about contributing to ESLint here

1 similar comment
@eslint-deprecated
Copy link

Hi @wmhilton!, thanks for the Pull Request

The first commit message isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag must be one of the following:

    The Tag is one of the following:

    • Fix - for a bug fix.
    • Update - either for a backwards-compatible enhancement or for a rule change that adds reported problems.
    • New - implements a new feature.
    • Breaking - for a backwards-incompatible enhancement or feature.
    • Docs - changes to documentation only.
    • Build - changes to build process only.
    • Upgrade - for a dependency upgrade.
    • Chore - for anything that isn't user-facing (for example, refactoring, adding tests, etc.).

    You can use the labels of the issue you are working on to determine the best tag.

Read more about contributing to ESLint here

@c-home
Copy link

c-home commented Sep 25, 2020

@c-home anything I can do to help?

Hi, I started implementing the RFC but haven't gotten a chance to add testing yet (which is really the most of it).
If you would like to implement it that is great :)

@nzakas nzakas changed the title Feat: implementation of eslint/rfcs#63 New: implement eslint/rfcs#63 Oct 7, 2020
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.

Sorry for the delay in reviewing, this looks really good. Just a few small things to clean up and I'd like to get a few other sets of eyes on this, too.

docs/user-guide/command-line-interface.md Outdated Show resolved Hide resolved
lib/eslint/eslint.js Show resolved Hide resolved
lib/options.js Outdated Show resolved Hide resolved
@nzakas
Copy link
Member

nzakas commented Oct 7, 2020

@c-home if you have the time to take a look at this implementation, we'd appreciate your feedback.

@c-home
Copy link

c-home commented Oct 8, 2020

@c-home if you have the time to take a look at this implementation, we'd appreciate your feedback.

Had a quick look and it looks great. Will have a closer look soon. Thank you for implementing this wmhilton.

@mdjermanovic mdjermanovic added accepted There is consensus among the team that this change meets the criteria for inclusion core Relates to ESLint's core APIs and features feature This change adds a new feature to ESLint and removed triage An ESLint team member will look at this issue soon labels Oct 8, 2020
Comment on lines +120 to +122
const changed =
fileDescriptor.changed ||
fileDescriptor.meta.hashOfConfig !== hashOfConfig;
Copy link

Choose a reason for hiding this comment

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

Will changed be true if the cacheStrategy changes? Related to this issue raised in the rfc.

@c-home
Copy link

c-home commented Oct 11, 2020

For users of eslint cache, this is something to consider - eslint/rfcs#68.

@eslint-deprecated
Copy link

Hi @wmhilton!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.

  • The issue reference must be formatted as follows:

    If the pull request addresses an issue, then the issue number should be mentioned at the end. If the commit doesn't completely fix the issue, then use (refs #1234) instead of (fixes #1234).

    Here are some good commit message summary examples:

    Build: Update Travis to only test Node 0.10 (refs #734)
    Fix: Semi rule incorrectly flagging extra semicolon (fixes #840)
    Upgrade: Esprima to 1.2, switch to using comment attachment (fixes #730)
    

Read more about contributing to ESLint here

@billiegoose
Copy link
Contributor Author

Ugh. As pointed out in this comment some very notable rulesets such as @typescript-eslint are incompatible with --cache by design. That really puts a damper on my enthusiasm for this, since anything less than 100% reproducible isn't good for our CI use case at Stoplight. :-(

@nzakas
Copy link
Member

nzakas commented Oct 29, 2020

It seems like you are pretty close to finishing this, and this is something we plan on doing regardless. Do you want to finish it up so we can merge it?

We do still need to solve for the case where plugins are doing unexpected things, but there are plenty of folks who would benefit from this PR in the meantime.

@royriojas
Copy link
Contributor

hi @nzakas @wmhilton I've published a new version of file-entry-cache. Version 6.0.0. This version has no new functionality but updates the dependencies to latest to remove security warnings.

It is a major upgrade to avoid any potential issues since I've aligned the supported node versions with the ones eslint is currently using.

@nzakas
Copy link
Member

nzakas commented Nov 11, 2020

@royriojas thanks for the heads up. Can you open an issue so that info doesn’t get lost here?

@vaniyokk
Copy link

vaniyokk commented Feb 7, 2021

Any update on this? Really annoying to wait minutes on CI....(

@nzakas
Copy link
Member

nzakas commented Feb 9, 2021

@vaniyokk it appears this has been abandoned. Do you want to take it up?

@kirill-konshin
Copy link

@vaniyokk it appears this has been abandoned. Do you want to take it up?

This is quite sad. In our case on CI with repo having around 10K modules ESLint takes waaaay too much time, since the cache is not used at all between pushes (due to timestamps inconsistency, Git does not maintain them, and GitLab does not have workspaces so far).

@royriojas
Copy link
Contributor

The merge request seems to be almost ready, isn't it? @nzakas. I think it is only a matter of fix the tests

@snitin315
Copy link
Contributor

Can I work on this and finish the PR ???

@nzakas
Copy link
Member

nzakas commented Feb 9, 2021

@royriojas yes, it looks basically done at this point.

@snitin315 yes, you can definitely take it over. You should be able to pull the branch from where this PR was created and then create a new PR with that code. When you do, just comment here with the new PR number so we can close this and move our focus over to the new PR. Thanks!

@mdjermanovic
Copy link
Member

Closing as there's a new PR #14119

@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Aug 18, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Aug 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features feature This change adds a new feature to ESLint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants