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

lib: fix module linter issues by setting root #400

Closed
wants to merge 1 commit into from

Conversation

gibfahn
Copy link
Member

@gibfahn gibfahn commented Apr 25, 2017

Eslint searches parent directories looking for config files until it
finds one with "root: true" in it. This sets "root: true" in CitGM's
tmpDir to avoid that.

Fixes: #399

Checklist
  • npm test passes
  • tests are included
  • contribution guidelines followed here

To test:

mkdir /path/to/node/citgm_tmp
node /path/to/citgm.js --tmpDir /path/to/node/citgm_tmp --v silly gulp

@gdams
Copy link
Member

gdams commented Apr 25, 2017

@nodejs-github-bot run ci

@gdams gdams closed this Apr 25, 2017
@nodejs-github-bot
Copy link
Collaborator

@gdams gdams reopened this Apr 25, 2017
@gibfahn
Copy link
Member Author

gibfahn commented Apr 25, 2017

I've run this manually and it seems to resolve the issue (citgm gulp fails without this, passes with it).

Needs a test.

richardlau

This comment was marked as off-topic.

@gibfahn
Copy link
Member Author

gibfahn commented Apr 25, 2017

@nodejs-github-bot run CI

EDIT: CI was green

@nodejs-github-bot
Copy link
Collaborator

Eslint searches parent directories looking for config files until it
finds one with "root: true" in it. This sets "root: true" in CitGM's
tmpDir to avoid that.

Fixes: nodejs#399
@gibfahn
Copy link
Member Author

gibfahn commented Apr 25, 2017

@nodejs-github-bot run CI

@nodejs-github-bot
Copy link
Collaborator

gdams

This comment was marked as off-topic.

gdams

This comment was marked as off-topic.

@MylesBorins
Copy link
Contributor

MylesBorins commented Apr 25, 2017 via email

@Trott
Copy link
Member

Trott commented Apr 25, 2017

Why did this change? Is it an upstream change? Is it due to the use of
yaml? Is it something that can be fixed upstream? Seems to me that this
would be a big that would affect other projects potentially.

  • I don't think anything changed on the ESLint side with the way cascading config files work, but /cc @not-an-aardvark just in case I'm wrong about that.

  • The directory structure in CITGM didn't change for CI runs, did it? Because it seems like it has to be that or else the bullet point above....

@not-an-aardvark
Copy link

I don't think anything changed on the ESLint side with the way cascading config files work, but /cc @not-an-aardvark just in case I'm wrong about that.

No, I don't think anything changed about that recently.

@MylesBorins
Copy link
Contributor

So it seems to me like this could be solved in CI by simply not making the temp directory inside of the smoker directory where node is cloned. I'm still very weirded out by things suddenly braking though, and I'm going to see if I can chase it down to a specific change in eslint

@gibfahn
Copy link
Member Author

gibfahn commented Apr 25, 2017

@not-an-aardvark is there a reason for a module not to set root: true in their eslint config? I'm not sure why that isn't the default in eslint.

We should definitely clone node into $WORKSPACE/node though, that's probably a more sensible thing to do anyway.

@not-an-aardvark
Copy link

not-an-aardvark commented Apr 25, 2017

For a config file at a project root, setting root: true is a good idea. However, for a config file in a subfolder (e.g. our test/eslintrc.yaml file), setting root: true would not be a good idea because that config is intended to inherit from the config in the root directory.

It's possible that root: true would be a better default (I wasn't working on the project when that decision was made) but for now all I can say is that the default behavior is probably not going to change to root: true in the near future because that would cause a lot of breakage.

@gibfahn
Copy link
Member Author

gibfahn commented Apr 25, 2017

@not-an-aardvark yeah, that's what I thought, thanks. Agreed that there's no point changing the default now, I was just checking that I wasn't missing some obvious reason for a module like gulp not to set that option before I PR its addition...

So PRs to the relevant modules to add this would make sense? I can do that.

@MylesBorins
Copy link
Contributor

So the problem repos are extending https://github.com/gulpjs/eslint-config-gulp

perhaps that should get a root: true?

This seems really fragile to me. I'm so bewildered about how this is just popping up. Nothing in any of these packages seems to have changed any time recently

MylesBorins

This comment was marked as off-topic.

@MylesBorins
Copy link
Contributor

As much as it bothers me I think we should just land this and cut a release so we can finish the tests

@gibfahn
Copy link
Member Author

gibfahn commented Apr 27, 2017

@MylesBorins it shouldn't be too difficult to just add in the option to the git plugin to clone node into node/ (famous last words)...

Update: I've made the changes to citgm-smoker, it seems to work, but there is an issue where any machine that has the old workspace fails the git clone step (can't create folder node/ because there's already a node symlink in the workspace root). The fix is to clean that workspace and try again.

This is a pain, the good thing is that this only has to be done once per machine, and that it fails immediately, so you can just check after 10s and then rerun. I've run it a bunch of times and I hope that I've cleaned them all up, but I'm not sure there's a good way to check.

To fix:

  1. Click on the failing test:

image

  1. Remove the build number from the URL:
    https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/739/nodes=ubuntu1204-64/ ->
    https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/nodes=ubuntu1204-64/

  2. Click Workspace

  3. Click Wipe Out Current Workspace

  4. Abort the run and rebuild.

@MylesBorins
Copy link
Contributor

@gibfahn would you be able to go in and fix the abi smoker too?

@gibfahn
Copy link
Member Author

gibfahn commented May 1, 2017

@gibfahn would you be able to go in and fix the abi smoker too?

I think it's fixed now, I set the npm_config_nodedir environment variable to work around #401. We should take a look at the failures in the latest run and see whether anything looks like a script issue.

@gibfahn
Copy link
Member Author

gibfahn commented May 1, 2017

Closing in favour of gulpjs/eslint-config-gulp#12 and the Jenkins script fixes.

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.

7 participants