Coder Social home page Coder Social logo

danger-mention's Issues

Invalid `Dangerfile` file: 401 Unauthorized

Got the following error when I tried running mention.run or even mention.run(2, [], []) as well.

My service account that is associated with the access token has Reporter rights (tried as Developer, but same results). I am also running on a private GitLab instance. Before adding mention, danger was working fine, but I am a bit left in the dark here.

Any tips on how to debug this further?

I could read the following on the Reference page:

Note: This plugin uses the web-scraping of GitHub.com and GitLab to detect the authors to find potential reviewers. This might cause the plugin to break if either of those pages introduce design changes.

Could that be it?

Here's the raw output:

/usr/local/lib/ruby/2.3.0/open-uri.rb:359:in `open_http':  (Danger::DSLError)
[!] Invalid `Dangerfile` file: 401 Unauthorized
 #  from Dangerfile:2
 #  -------------------------------------------
 #  # Find some reviewers for this MR
 >  mention.run
 #  
 #  -------------------------------------------
	from /usr/local/lib/ruby/2.3.0/open-uri.rb:737:in `buffer_open'
	from /usr/local/lib/ruby/2.3.0/open-uri.rb:212:in `block in open_loop'
	from /usr/local/lib/ruby/2.3.0/open-uri.rb:210:in `catch'
	from /usr/local/lib/ruby/2.3.0/open-uri.rb:210:in `open_loop'
	from /usr/local/lib/ruby/2.3.0/open-uri.rb:151:in `open_uri'
	from /usr/local/lib/ruby/2.3.0/open-uri.rb:717:in `open'
	from /usr/local/lib/ruby/2.3.0/open-uri.rb:35:in `open'
	from /usr/local/bundle/gems/danger-mention-0.6.1/lib/danger_plugin.rb:101:in `parse_blame'
	from /usr/local/bundle/gems/danger-mention-0.6.1/lib/danger_plugin.rb:46:in `block in run'
	from /usr/local/bundle/gems/danger-mention-0.6.1/lib/danger_plugin.rb:45:in `each'
	from /usr/local/bundle/gems/danger-mention-0.6.1/lib/danger_plugin.rb:45:in `run'
	from Dangerfile:2:in `block in parse'
	from /usr/local/bundle/gems/danger-5.5.5/lib/danger/danger_core/dangerfile.rb:200:in `eval'
	from /usr/local/bundle/gems/danger-5.5.5/lib/danger/danger_core/dangerfile.rb:200:in `block in parse'
	from /usr/local/bundle/gems/danger-5.5.5/lib/danger/danger_core/dangerfile.rb:196:in `instance_eval'
	from /usr/local/bundle/gems/danger-5.5.5/lib/danger/danger_core/dangerfile.rb:196:in `parse'
	from /usr/local/bundle/gems/danger-5.5.5/lib/danger/danger_core/dangerfile.rb:273:in `run'
	from /usr/local/bundle/gems/danger-5.5.5/lib/danger/danger_core/executor.rb:27:in `run'
	from /usr/local/bundle/gems/danger-5.5.5/lib/danger/commands/runner.rb:66:in `run'
	from /usr/local/bundle/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
	from /usr/local/bundle/gems/danger-5.5.5/bin/danger:5:in `<top (required)>'
	from /usr/local/bundle/bin/danger:22:in `load'
	from /usr/local/bundle/bin/danger:22:in `<main>'
[!] The exception involves the following plugins:
 -  danger-mention

Missing blame information (Gitlab CI and docker)

Hi,

I keep getting this error

/usr/local/bundle/gems/danger-mention-0.6.1/lib/danger_plugin.rb:101:in `initialize':  (Danger::DSLError)
[!] Invalid `Dangerfile` file: No such file or directory @ rb_sysopen - **https://mygitlab.com/myproject/blame/development/path_to_my_file/file.ts**
  • I'm running Danger and Danger Mention in a docker image
  • blame/development this path does not exist
  • development is the name of my branch
  • Here is my Dangerfile
mention.run(2, [".gitlab-ci.yml"], ["danger"])

What do I need to do to have blame folder?

Thank you

Use GitHub request Reviewers feature

Recently GitHub has added a new feature into the PR to request specific users for a review.
Would be nice to have that automated with danger.

[!] Invalid `Dangerfile` file: 404 Not Found

It seems that when I submit a PR with new files, the danger plugin fails with a 404 Not Found error. You can see this here and here. If only modify existing files there are no failures as seen here. I am assuming that GitHub's response in the new file case is empty or different enough for the plugin to fail.

Please let me know if there is any additional information I can provide to help.

Thanks.

Something wrong with branch_for_base call (CircleCI)

Log

bundle exec danger

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

bundler: failed to load command: danger (/home/ubuntu/repo/vendor/bundle/ruby/2.2.0/bin/danger)
Danger::DSLError: 
[!] Invalid `Dangerfile` file: undefined method `branch_for_base' for #<Danger::Dangerfile:0x007f70336cc848>
 #  from Dangerfile:36
 #  -------------------------------------------
 #  # Mention potential reviewers
 >  mention.run
 #  -------------------------------------------

  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-4.0.5/lib/danger/danger_core/dangerfile.rb:68:in `method_missing'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-4.0.5/lib/danger/plugin_support/plugin.rb:23:in `method_missing'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-mention-0.4.0/lib/danger_plugin.rb:78:in `compose_urls'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-mention-0.4.0/lib/danger_plugin.rb:45:in `run'
  Dangerfile:36:in `block in parse'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-4.0.5/lib/danger/danger_core/dangerfile.rb:199:in `eval'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-4.0.5/lib/danger/danger_core/dangerfile.rb:199:in `block in parse'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-4.0.5/lib/danger/danger_core/dangerfile.rb:195:in `instance_eval'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-4.0.5/lib/danger/danger_core/dangerfile.rb:195:in `parse'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-4.0.5/lib/danger/danger_core/dangerfile.rb:272:in `run'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-4.0.5/lib/danger/danger_core/executor.rb:27:in `run'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-4.0.5/lib/danger/commands/runner.rb:66:in `run'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/gems/danger-4.0.5/bin/danger:5:in `<top (required)>'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/bin/danger:23:in `load'
  /home/ubuntu/repo/vendor/bundle/ruby/2.2.0/bin/danger:23:in `<top (required)>'

bundle exec danger returned exit code 1

Dangerfile

# Sometimes it's a README fix, or something like that - which isn't relevant for
# including in a project's CHANGELOG for example
# declared_trivial = github.pr_title.include? "#trivial"

# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"

# Warn when there is a big PR
warn("Big PR") if git.lines_of_code > 500

# Don't let testing shortcuts get into master by accident
# fail("fdescribe left in tests") if `grep -r fdescribe specs/ `.length > 1
# fail("fit left in tests") if `grep -r fit specs/ `.length > 1

# Ensure a PR has someone assigned to it
warn "This PR does not have any assignees yet." unless github.pr_json["assignee"]

# PRs should reference an issue
unless (github.pr_body.include? "Closes #" or github.pr_body.include? "Connects #")
  fail "This PR doesn't close or connect to an issue."
end

# PRs should almost always merge to dev.
unless github.branch_for_base == "dev"
  warn "This PR will not be merged into dev."
end

# Warn if TODOs are present in code
# todoist.warn_for_todos
# todoist.print_todos_table

# Lint commit message
commit_lint.check

# Mention potential reviewers
# mention.run

Gemfile

# frozen_string_literal: true
source "https://rubygems.org"

gem 'danger'
gem 'danger-todoist' # Checks for TODO etc in commits
gem 'danger-commit_lint' # Lints commit messages
gem 'danger-mention' # Mention potential reviewers

GitLab support

Hi @wojteklu,

now that Danger supports GitLab I'd be interested in your take on supporting GitLab. I am happy to do the work if you think it can be include in the plugin in a nice way.

Private repositories support

Hi there, I've been checking the code in this repo and couldn't think of a way of making this plugin available for private repositories.

Do you guys have any idea or plan to make this work with private repos?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.