danger / danger

🚫 Stop saying "you forgot to …" in code review (in Ruby)
https://danger.systems
MIT License
5.47k stars 480 forks source link

Danger 9.5.1 won't run with Xcode 16 build tools. #1503

Closed paul-livefront closed 1 week ago

paul-livefront commented 1 week ago

Report

What did you do?

Run danger on CI with bundler:

arch -arm64 bundle exec danger

What did you expect to happen?

Run danger.

What happened instead?

Danger fails to run due to a deprecated Xcode function.

Run arch -arm64 bundle exec danger
Error: This command is deprecated and will be removed in a future release, --legacy flag is required to use it.
Usage: xcresulttool get object [--legacy] --path <path> [--id <id>] [--version <version>] [--format <format>]
  See 'xcresulttool get object --help' for more information.
bundler: failed to load command: danger (/Users/ci/.rbenv/versions/2.7.5/bin/danger)
/Users/ci/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/xcresult-0.2.1/lib/xcresult/parser.rb:87:in `execute_cmd': \e[31m (Danger::DSLError)
[!] Invalid `Dangerfile` file: Failed to execute - xcrun xcresulttool get --format json --path fastlane/test_output/MyAppNameTests.xcresult\e[0m
 #  from Dangerfile:4
 #  -------------------------------------------
 #  xcode_summary.ignored_files = '**/SourcePackages/**'
 >  xcode_summary.report 'fastlane/test_output/MyAppNameTests.xcresult'
 #  
 #  -------------------------------------------

Your Environment

CI is GitHub actions with Danger version 9.5.1

Dangerfile

# Configure `danger-xcode_summary` to report build warnings, test failures, etc.
# Ignore warnings generated by Swift Packages. Pod warnings are already excluded by the Podfile.
xcode_summary.ignored_files = '**/SourcePackages/**'
xcode_summary.report 'fastlane/test_output/MyAppNameTests.xcresult'

# Configure `danger-slather` to report unit test coverage. Slather uses the coverage files from
# Xcode so is unrelated to the `xcode_summary` config above.
slather.configure('MyAppName.xcodeproj', 'MyAppName', options: {
  workspace: 'MyAppName.xcworkspace',
  ignore_list: [
    '../**/SourcePackages/**', # Exclude Swift Packages
  ],
})

slather.notify_if_coverage_is_less_than(minimum_coverage: 80, notify_level: :warning)
slather.notify_if_modified_file_is_less_than(minimum_coverage: 80, notify_level: :warning)
slather.show_coverage
paul-livefront commented 1 week ago

As you can see in the error message, the problem here is actually in the xcode_summary plugin at line 4 of the Dangerfile.

We needed to update danger-xcode_summary to 1.3.1 https://github.com/diogot/danger-xcode_summary/issues/91