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

This plugin breaks Danger when running locally #3

Open
maxcodes opened this issue May 14, 2018 · 2 comments
Open

This plugin breaks Danger when running locally #3

maxcodes opened this issue May 14, 2018 · 2 comments

Comments

@maxcodes
Copy link

When trying to run bundle exec danger pr, The command gets hung for a looong time and eventually times out. The problem disappears if I remove danger-eslint from Gemfile and Dangerfile (just removing from Dangerfile doesn't seem to fix it).

I Interrupted the command, and this is the stacktrace:

Command run:

$ DANGER_GITHUB_API_TOKEN=xxxx bundle exec danger pr https:/www.github.com/maxcodes/redacted/pull/1878

Output

Running your Dangerfile against this PR - https://github.com/maxcodes/redacted/pull/1878
Turning on --verbose

[!] The exception involves the following plugins:
 -  danger-eslint

/Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-eslint-0.1.1/lib/eslint/plugin.rb:82:in ``': Interrupt
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-eslint-0.1.1/lib/eslint/plugin.rb:82:in `run_lint'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-eslint-0.1.1/lib/eslint/plugin.rb:51:in `lint'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/danger_core/dangerfile.rb:133:in `block (2 levels) in method_values_for_plugin_hashes'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/danger_core/dangerfile.rb:121:in `map'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/danger_core/dangerfile.rb:121:in `block in method_values_for_plugin_hashes'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/danger_core/dangerfile.rb:117:in `each'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/danger_core/dangerfile.rb:117:in `flat_map'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/danger_core/dangerfile.rb:117:in `method_values_for_plugin_hashes'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/danger_core/dangerfile.rb:150:in `print_known_info'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/danger_core/dangerfile.rb:174:in `parse'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/danger_core/dangerfile.rb:274:in `run'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/commands/pr.rb:61:in `block in run'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/commands/local_helpers/local_setup.rb:38:in `setup'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/lib/danger/commands/pr.rb:60:in `run'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/danger-5.5.11/bin/danger:5:in `<top (required)>'
        from /Users/max/.rbenv/versions/2.3.4/bin/danger:22:in `load'
        from /Users/max/.rbenv/versions/2.3.4/bin/danger:22:in `<top (required)>'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `load'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `kernel_load'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:28:in `run'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli.rb:424:in `exec'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli.rb:27:in `dispatch'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/cli.rb:18:in `start'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/exe/bundle:30:in `block in <top (required)>'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/friendly_errors.rb:122:in `with_friendly_errors'
        from /Users/max/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/exe/bundle:22:in `<top (required)>'
        from /Users/max/.rbenv/versions/2.3.4/bin/bundle:22:in `load'
        from /Users/max/.rbenv/versions/2.3.4/bin/bundle:22:in `<main>'
@leonhartX
Copy link
Owner

Thanks for the report, but I'm afraid recently I don't have enough time to work on this project.
Any PullRequest is appreciated if you can dig this.

@benzimmer
Copy link

The problem stems from this issue in danger itself: danger/danger#1041

TL;DR: Danger tries to gather info on the plugins and calls every method in the plugin that has no parameters, which in danger-eslint's case also includes #lint which is called without any options, which leads to it going through (at least in our case) much bigger pile of files than it would be with options.

Easy fix would be to add a bogus parameter to the plugins #lint method. I can provide a PR if @leonhartX is on board with that solution.

Repository owner deleted a comment Feb 2, 2024
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

3 participants