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

"git.modified_files" crash with xcframework #1439

Open
paul-lavoine opened this issue May 5, 2023 · 3 comments
Open

"git.modified_files" crash with xcframework #1439

paul-lavoine opened this issue May 5, 2023 · 3 comments

Comments

@paul-lavoine
Copy link

Report

What did you do?

My CI runner ran bundle exec fastlane run_danger danger_id:pull_request_metadata after I created a pull request

What did you expect to happen?

Running your Dangerfile without it crashing.

What happened instead?

Danger crashed with the following error message:

Danger has errored

[!] Invalid Dangerfile file: undefined method [] for nil:NilClass

        final[current_file][:patch] \<\< "\n" + line
                           ^^^^^^^^
 #  from Dangerfile:55
 #  -------------------------------------------
 #    ## Let's check if there are any changes in the project folder
 >    has_app_changes = git.modified_files
 #    ## Then, we should check if tests are updated
 #  -------------------------------------------

Generated by 🚫 Danger

Actually this crash happens only when a .xcframework file has been modified.
It looks like the plugin danger_git doesn't succeed to access to the path inside the xcframework and crash instead

Your Environment

  • Which CI are you running on?

  • Circle CI

  • Are you running the latest version of Danger?

  • Yes, version 9.3.0

  • What is your Dangerfile?

        has_app_changes = git.modified_files
@Jawnnypoo
Copy link

I have this issue too on an Android project, so not likely isolated to just xcframework. Also tested and saw issues with 9.3.1

/../../../vendor/bundle/ruby/3.2.0/gems/git-1.18.0/lib/git/diff.rb:148:in `block in process_full_diff': undefined method `[]' for nil:NilClass (NoMethodError)
--

final[current_file][:patch] << "\n" + line
^^^^^^^^

@orta
Copy link
Member

orta commented Jun 8, 2023

That looks like the issue lays inside the git gem, based on the stack trace

@Jawnnypoo
Copy link

true, would downgrading the git gem suffice?

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