Danger: Danger crashing - NoMethodError: undefined method `merge' for

Created on 9 Jul 2020  Â·  9Comments  Â·  Source: danger/danger

Report

What did you do?

ℹ Please replace this with what you did.
Run danger-gitlab on a CI instance using Gitlab runner after creating a merge request
Run bundle install
Run bundle exec danger init
* When I create a MR it succeeds the first time, but if a push a 2nd commit it fails everytime *

What did you expect to happen?

ℹ Please replace this with what you expected to happen.
Danger runs without crashing

What happened instead?

ℹ Please replace this with of what happened instead.

$ bundle exec danger --version
 8.0.2
 $ bundle exec danger
 [17:43:57]: Skipping file blacklisting as no ignore file was found at path ./.xcovignore
 [17:43:57]: Skipping file blacklisting as no ignore file was found at path ./.xcovignore
 +-----------------------------+-----------------------------------------------------------------------------------------------------------+
 |                                                         Summary for xcov 1.7.3                                                          |
 +-----------------------------+-----------------------------------------------------------------------------------------------------------+
 | scheme                      | zDocsKitUnitTests                                                                                         |
 | workspace                   | UnitTests/zDocsKitUnitTests.xcworkspace                                                                   |
 | minimum_coverage_percentage | 26.0                                                                                                      |
 | output_directory            | UnitTests                                                                                                 |
 | html_report                 | true                                                                                                      |
 | markdown_report             | false                                                                                                     |
 | json_report                 | false                                                                                                     |
 | skip_slack                  | false                                                                                                     |
 | slack_username              | xcov                                                                                                      |
 | slack_message               | Your *xcov* coverage report                                                                               |
 | ignore_file_path            | ./.xcovignore                                                                                             |
 | include_test_targets        | false                                                                                                     |
 | only_project_targets        | false                                                                                                     |
 | disable_coveralls           | false                                                                                                     |
 | ideFoundationPath           | /Applications/Xcode.app/Contents/Developer/../Frameworks/IDEFoundation.framework/Versions/A/IDEFoundation |
 | legacy_support              | false                                                                                                     |
 +-----------------------------+-----------------------------------------------------------------------------------------------------------+
 [17:43:57]: Resolving Swift Package Manager dependencies...
 [17:43:57]: $ xcodebuild -resolvePackageDependencies -workspace UnitTests/zDocsKitUnitTests.xcworkspace -scheme zDocsKitUnitTests
 [17:43:58]: â–¸ Command line invocation:
 [17:43:58]: â–¸     /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -resolvePackageDependencies -workspace UnitTests/zDocsKitUnitTests.xcworkspace -scheme zDocsKitUnitTests
 [17:43:59]: â–¸ resolved source packages: 
 [17:43:59]: $ xcodebuild -showBuildSettings -workspace UnitTests/zDocsKitUnitTests.xcworkspace -scheme zDocsKitUnitTests
 [17:44:00]: Copying .xccovarchive to UnitTests/action_0.xccovarchive
 [17:44:00]: Copying .xccovreport to UnitTests/action_0.xccovreport
 [17:44:00]: $ /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/xcov-1.7.3/lib/xcov-core/bin/xcov-core -s UnitTests/action_0.xccovreport -o UnitTests/tmp/report.json20200708-26662-1briqby --ide-foundation-path /Applications/Xcode.app/Contents/Developer/../Frameworks/IDEFoundation.framework/Versions/A/IDEFoundation
 [17:44:00]: â–¸ Loading...
 [17:44:00]: â–¸ Opening .xccoverage file at path: /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/UnitTests/action_0.xccovreport
 [17:44:00]: â–¸ Parsing .xccoverage file...
 [17:44:00]: â–¸ File successfully parsed
 [17:44:00]: â–¸ Serializing coverage report...
 [17:44:00]: â–¸ Report successfully serialized
 [17:44:00]: â–¸ Writing report on disk...
 [17:44:00]: â–¸ Coverage report successfully created at path: /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/UnitTests/tmp/report.json20200708-26662-1briqby
 +-------------------+--------+
 |    xcov Coverage Report    |
 +-------------------+--------+
 | ZDocKit.framework | 26.36% |
 +-------------------+--------+
 bundler: failed to load command: danger (/Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/bin/danger)
 NoMethodError: undefined method `merge' for #<Gitlab::ObjectifiedHash:0x00007fe0f607fe20>
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/gitlab-4.16.0/lib/gitlab/objectified_hash.rb:37:in `method_missing'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/request_sources/gitlab.rb:87:in `block (2 levels) in mr_comments'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/request_sources/gitlab.rb:87:in `map'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/request_sources/gitlab.rb:87:in `block in mr_comments'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/request_sources/gitlab.rb:87:in `each'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/request_sources/gitlab.rb:87:in `flat_map'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/request_sources/gitlab.rb:87:in `mr_comments'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/request_sources/gitlab.rb:180:in `update_pull_request_with_inline_comments!'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/request_sources/gitlab.rb:173:in `update_pull_request!'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/danger_core/dangerfile.rb:260:in `post_results'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/danger_core/dangerfile.rb:288:in `run'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/danger_core/executor.rb:29:in `run'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/lib/danger/commands/runner.rb:73:in `run'
   /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/gems/danger-8.0.2/bin/danger:5:in `<top (required)>'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/bin/danger:23:in `load'
   /Users/iosci/builds/qPmAMNAW/0/itx/zillow-docs/zdocs-ios/zdockit/bin/danger:23:in `<top (required)>'
 ERROR: Job failed: exit status 1

Your Environment

  • Which CI are you running on? Gitlab
  • Are you running the latest version of Danger? 8.0.2
  • What is your Dangerfile?

    swiftlint.lint_files
    xcode_summary.report 'xcodebuild.json'
    xcode_summary.ignored_files = 'UnitTests/Pods/**'
    xcode_summary.inline_mode = true
    xcov.report(
     scheme: 'zDocsKitUnitTests',
     workspace: 'UnitTests/zDocsKitUnitTests.xcworkspace',
     minimum_coverage_percentage: 26.0,
     output_directory: 'UnitTests'
    )
    
    

Most helpful comment

Well, you have a docker image, which points to this repository. The docker image was updated 7 days ago. Here is the Dockerfile, which states that you (@orta) are the maintainer of it. 😄 I did not find any CI jobs which push this docker image, so maybe some of the other repo maintainers are doing it manually?

All 9 comments

Closing this issue.
ortatherox on the support forums suggested taking a look at the Gitlab gem file. I looked at a MR that succeeded earlier in the week and saw it was using Gitlab gem 4.15.0 and the one that fails is using 4.16.0, so i constrained the Gitlab gem in the Gemfile to use 4.15.0 and its working again.

Shouldn't this issue be kept open? downgrading is a interim solution not a fix.

Just came across this myself, will downgrade for the time being.

@MiralDesai Yes, you're correct but this is the wrong repo for the fix. There is another thread which discusses the issue and the fix in the gitlab repo here.

@orta As this is fixed in https://github.com/NARKOZ/gitlab/releases/tag/v4.16.1 I think you should rebuild docker image as it still contains v4.16.0.
I specifically checked on the latest version:

root@9073c79fd9c0:/myapp# grep 'gitlab' Gemfile.lock 
    danger-gitlab (8.0.0)
      gitlab (~> 4.2, >= 4.2.0)
    gitlab (4.16.0)
  danger-gitlab

This isn't blocking anything, but the output of the build does contain a lot of these warnings.

WARNING: Please convert ObjectifiedHash object to hash before calling Hash methods on it.

And it seems that NARKOZ intends to deprecate the direct hash methods. Should a new issue be opened for resolving these warnings?

Sure, make a new issue and I'm happy for someone to update the docker image

@orta can you rebuild the docker image? Or should we open a new issue for that?

I don't use docker, and thought we didn't have one - https://github.com/danger/danger/issues/1110

So I don't know how, but you're welcome to open an issue

Well, you have a docker image, which points to this repository. The docker image was updated 7 days ago. Here is the Dockerfile, which states that you (@orta) are the maintainer of it. 😄 I did not find any CI jobs which push this docker image, so maybe some of the other repo maintainers are doing it manually?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JuanitoFatas picture JuanitoFatas  Â·  6Comments

Antondomashnev picture Antondomashnev  Â·  7Comments

orta picture orta  Â·  9Comments

v-ahadke picture v-ahadke  Â·  8Comments

rpassis picture rpassis  Â·  4Comments