danger / danger/danger

Danger fails when new commits are pushed to an already commented merge request.

Open
#1,280 4 comments 2 reactions 0 assignees View on GitHub
Bug GitLab
Dominant language
Ruby
Stars
5.7k
Forks
488
PR merge metrics
No merged PRs in 30d

Description

# Report
## What did you do?

I have Danger running on a BitRise workflow, every time a pull request is made, it commented inline about linting issues.
I pushed a new commit with changes to resolve those commented issues.

## What did you expect to happen?

Expected danger to check the merge request with the new commits, and add new inline comments if new issues were found.

## What happened instead?

pipeline failed because of danger exit code 1

> WARNING:
Please convert ObjectifiedHash object to hash before calling Hash methods on it.
WARNING: Please convert ObjectifiedHash object to hash before calling Hash methods on it.
WARNING: Please convert ObjectifiedHash object to hash before calling Hash methods on it.
WARNING: Please convert ObjectifiedHash object to hash before calling Hash methods on it.
WARNING: Please convert ObjectifiedHash object to hash before calling Hash methods on it.
WARNING: Please convert ObjectifiedHash object to hash before calling Hash methods on it.
WARNING: Please convert ObjectifiedHash object to hash before calling Hash methods on it.
WARNING: Please convert ObjectifiedHash object to hash before calling Hash methods on it.
WARNING: Please convert ObjectifiedHash object to hash before calling Hash methods on it.
WARNING: Please convert ObjectifiedHash object to hash before calling Hash methods on it.
bundler: failed to load command: danger (/usr/local/bin/danger)
/usr/local/lib/ruby/gems/2.7.0/gems/danger-8.2.1/lib/danger/request_sources/gitlab.rb:366:in `hash': no implicit conversion of Hash into Integer (TypeError)
from /usr/local/lib/ruby/gems/2.7.0/gems/danger-8.2.1/lib/danger/request_sources/gitlab.rb:366:in `-'
from /usr/local/lib/ruby/gems/2.7.0/gems/danger-8.2.1/lib/danger/request_sources/gitlab.rb:366:in `submit_inline_comments!'
from /usr/local/lib/ruby/gems/2.7.0/gems/danger-8.2.1/lib/danger/request_sources/gitlab.rb:209:in `update_pull_request_with_inline_comments!'
from /usr/local/lib/ruby/gems/2.7.0/gems/danger-8.2.1/lib/danger/request_sources/gitlab.rb:174:in `update_pull_request!'
from /usr/local/lib/ruby/gems/2.7.0/gems/danger-8.2.1/lib/danger/danger_core/dangerfile.rb:260:in `post_results'
from /usr/local/lib/ruby/gems/2.7.0/gems/danger-8.2.1/lib/danger/danger_core/dangerfile.rb:288:in `run'
from /usr/local/lib/ruby/gems/2.7.0/gems/danger-8.2.1/lib/danger/danger_core/executor.rb:29:in `run'
from /usr/local/lib/ruby/gems/2.7.0/gems/danger-8.2.1/lib/danger/commands/runner.rb:73:in `run'
from /usr/local/lib/ruby/gems/2.7.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
from /usr/local/lib/ruby/gems/2.7.0/gems/danger-8.2.1/bin/danger:5:in `'
from /usr/local/bin/danger:23:in `load'
from /usr/local/bin/danger:23:in `'
from /usr/local/lib/ruby/site_ruby/2.7.0/bundler/cli/exec.rb:63:in `load'
from /usr/local/lib/ruby/site_ruby/2.7.0/bundler/cli/exec.rb:63:in `kernel_load'
from /usr/local/lib/ruby/site_ruby/2.7.0/bundler/cli/exec.rb:28:in `run'
from /usr/local/lib/ruby/site_ruby/2.7.0/bundler/cli.rb:497:in `exec'
from /usr/local/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from /usr/local/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
from /usr/local/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
from /usr/local/lib/ruby/site_ruby/2.7.0/bundler/cli.rb:30:in `dispatch'
from /usr/local/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
from /usr/local/lib/ruby/site_ruby/2.7.0/bundler/cli.rb:24:in `start'
from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/exe/bundle:49:in `block in '
from /usr/local/lib/ruby/site_ruby/2.7.0/bundler/friendly_errors.rb:130:in `with_friendly_errors'
from /usr/local/lib/ruby/gems/2.7.0/gems/bundler-2.2.0/exe/bundle:37:in `'
from /usr/local/bin/bundle:23:in `load'
from /usr/local/bin/bundle:23:in `'

## Your Environment

* Which CI are you running on?
Bitrise
* Are you running the latest version of Danger?
Yes:
danger (8.2.1)
danger-gitlab (8.0.0)
* What is your Dangerfile?

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

#only have messages posted within the diff of the current PR
gitlab.dismiss_out_of_range_messages

# ktlint
checkstyle_format.base_path = Dir.pwd
checkstyle_format.report "/bitrise/src/build/reports/ktlint/ktlint-report.xml"

# AndroidLint
android_lint.report_file = "/bitrise/src/build/reports/lint/lint-report.xml"
android_lint.skip_gradle_task = true
android_lint.severity = "Error"
android_lint.filtering = true
android_lint.lint(inline_mode: true)

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.