{"action":"created","issue":{"url":"https://api.github.com/repos/danger/danger/issues/304","repository_url":"https://api.github.com/repos/danger/danger","labels_url":"https://api.github.com/repos/danger/danger/issues/304/labels{/name}","comments_url":"https://api.github.com/repos/danger/danger/issues/304/comments","events_url":"https://api.github.com/repos/danger/danger/issues/304/events","html_url":"https://github.com/danger/danger/issues/304","id":163812711,"number":304,"title":"Deleted files swapped with added files","user":{"login":"paweldudek","id":968513,"avatar_url":"https://avatars.githubusercontent.com/u/968513?v=3","gravatar_id":"","url":"https://api.github.com/users/paweldudek","html_url":"https://github.com/paweldudek","followers_url":"https://api.github.com/users/paweldudek/followers","following_url":"https://api.github.com/users/paweldudek/following{/other_user}","gists_url":"https://api.github.com/users/paweldudek/gists{/gist_id}","starred_url":"https://api.github.com/users/paweldudek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paweldudek/subscriptions","organizations_url":"https://api.github.com/users/paweldudek/orgs","repos_url":"https://api.github.com/users/paweldudek/repos","events_url":"https://api.github.com/users/paweldudek/events{/privacy}","received_events_url":"https://api.github.com/users/paweldudek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-05T09:53:29Z","updated_at":"2016-07-05T11:38:30Z","closed_at":null,"body":"I'm having a rather peculiar issue where Danger reports that files I've added were deleted and the files I've deleted were added. \r\n\r\nThe report I'm getting: \r\n\r\n```\r\n+----------------------+--------------------------------------------------------------------------------------------------+\r\n|                                                      Danger v0.8.4                                                      |\r\n|                                                     DSL Attributes                                                      |\r\n+----------------------+--------------------------------------------------------------------------------------------------+\r\n| status_report        |                                                                                                  |\r\n| violation_report     |                                                                                                  |\r\n| added_files          | AirHelp/Classes/Account/View/AccounterVersionFooterView.swift                                    |\r\n| deleted_files        | AirHelp/Classes/Account/AccountViewControllerSpec.swift                                          |\r\n|                      | AirHelp/Classes/Account/View/AccountTableViewCell.xib                                            |\r\n|                      | AirHelp/Classes/Account/View/AccountVersionFooterView.swift                                      |\r\n|                      | AirHelp/Classes/Generic/Table View Cell Registration/NibLoadable.swift                           |\r\n|                      | AirHelp/Classes/Generic/Table View Cell Registration/ReusableView.swift                          |\r\n|                      | AirHelp/Classes/Generic/Table View Cell Registration/TableViewCellRegistration.swift             |\r\n|                      | AirHelpSpecs/ReferenceImages/AccountViewControllerSpec/account_view@2x.png                       |\r\n|                      | AirHelpSpecs/Test Helpers/AirHelpSpecsHelper.swift                                               |\r\n| lines_of_code        | 1041                                                                                             |\r\n| deletions            | 749                                                                                              |\r\n| insertions           | 292                                                                                              |\r\n| commits              | []                                                                                               |\r\n| pr_title             | Grouped account view                                                                             |\r\n| pr_author            | paweldudek                                                                                       |\r\n| pr_labels            | []                                                                                               |\r\n| branch_for_base      | develop                                                                                          |\r\n| branch_for_head      | feature/grouped-account-view                                                                     |\r\n| base_commit          | 40008fb14a6df6b7f9a393727ec9cff49d1df0db                                                         |\r\n| head_commit          | 9a6dd3dda868e090b8ed19768c42507b70c03fef                                                         |\r\n| pr_json              | [Skipped]                                                                                        |\r\n| api                  | Octokit::Client                                                                                  |                                                                                          |\r\n| ---                  | ---                                                                                              |\r\n| SCM                  | Danger::GitRepo                                                                                  |\r\n| Source               | Danger::CISource::LocalGitRepo                                                                   |\r\n| Requests             | Danger::RequestSources::GitHub                                                                   |\r\n+----------------------+--------------------------------------------------------------------------------------------------+\r\n```\r\n\r\nBasically what's under `Added` is what I've deleted (or renamed, typos 😅) and what's under `Deleted` I've added. I wasn't sure what's causing this issue so I quickly glued together a small script that uses Danger internals to get diff based on head/base commits:\r\n\r\n```\r\n  repo = Danger::GitRepo.new\r\n\r\n  repo.diff_for_folder('.', from: '40008fb14a6df6b7f9a393727ec9cff49d1df0db', to: '9a6dd3dda868e090b8ed19768c42507b70c03fef')\r\n  diff =  Danger::FileList.new(repo.diff.select { |diff| diff.type == 'deleted' }.map(&:path))\r\n  puts diff\r\n```\r\n\r\nThis prints our deleted files correctly:\r\n\r\n```\r\nAirHelp/Classes/Account/View/AccounterVersionFooterView.swift\r\n``` \r\n\r\nSo ultimately the question is whether someone has any clue what I'm doing wrong? This looks like a configuration issue as I'm getting correct data when using Danger internals directly. \r\n\r\nI've also checked out previous versions of Danger with similar results (all up till 0.7.3)."},"comment":{"url":"https://api.github.com/repos/danger/danger/issues/comments/230455284","html_url":"https://github.com/danger/danger/issues/304#issuecomment-230455284","issue_url":"https://api.github.com/repos/danger/danger/issues/304","id":230455284,"user":{"login":"paweldudek","id":968513,"avatar_url":"https://avatars.githubusercontent.com/u/968513?v=3","gravatar_id":"","url":"https://api.github.com/users/paweldudek","html_url":"https://github.com/paweldudek","followers_url":"https://api.github.com/users/paweldudek/followers","following_url":"https://api.github.com/users/paweldudek/following{/other_user}","gists_url":"https://api.github.com/users/paweldudek/gists{/gist_id}","starred_url":"https://api.github.com/users/paweldudek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paweldudek/subscriptions","organizations_url":"https://api.github.com/users/paweldudek/orgs","repos_url":"https://api.github.com/users/paweldudek/repos","events_url":"https://api.github.com/users/paweldudek/events{/privacy}","received_events_url":"https://api.github.com/users/paweldudek/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T11:38:30Z","updated_at":"2016-07-05T11:38:30Z","body":"Definitely better! I also see insertions and deletions are now correctly calculated 👍 \r\n\r\n```\r\n+----------------------+--------------------------------------------------------------------------------------------------+\r\n|                                                      Danger v0.8.4                                                      |\r\n|                                                     DSL Attributes                                                      |\r\n+----------------------+--------------------------------------------------------------------------------------------------+\r\n| status_report        |                                                                                                  |\r\n| violation_report     |                                                                                                  |\r\n| added_files          | AirHelp/Classes/Account/AccountViewControllerSpec.swift                                          |\r\n|                      | AirHelp/Classes/Account/View/AccountTableViewCell.xib                                            |\r\n|                      | AirHelp/Classes/Account/View/AccountVersionFooterView.swift                                      |\r\n|                      | AirHelp/Classes/Generic/Table View Cell Registration/NibLoadable.swift                           |\r\n|                      | AirHelp/Classes/Generic/Table View Cell Registration/ReusableView.swift                          |\r\n|                      | AirHelp/Classes/Generic/Table View Cell Registration/TableViewCellRegistration.swift             |\r\n|                      | AirHelpSpecs/ReferenceImages/AccountViewControllerSpec/account_view@2x.png                       |\r\n|                      | AirHelpSpecs/Test Helpers/AirHelpSpecsHelper.swift                                               |\r\n| deleted_files        | AirHelp/Classes/Account/View/AccounterVersionFooterView.swift                                    |\r\n| lines_of_code        | 1041                                                                                             |\r\n| deletions            | 292                                                                                              |\r\n| insertions           | 749                                                                                              |\r\n| commits              | 9a6dd3dda868e090b8ed19768c42507b70c03fef                                                         |\r\n| pr_title             | Grouped account view                                                                             |\r\n| pr_labels            | []                                                                                               |\r\n| branch_for_base      | develop                                                                                          |\r\n| branch_for_head      | feature/grouped-account-view                                                                     |\r\n| base_commit          | 40008fb14a6df6b7f9a393727ec9cff49d1df0db                                                         |\r\n| head_commit          | 9a6dd3dda868e090b8ed19768c42507b70c03fef                                                         |\r\n| pr_json              | [Skipped]                                                                                        |\r\n| api                  | Octokit::Client                                                                                  |\r\n| ---                  | ---                                                                                              |\r\n| SCM                  | Danger::GitRepo                                                                                  |\r\n| Source               | Danger::CISource::LocalGitRepo                                                                   |\r\n| Requests             | Danger::RequestSources::GitHub                                                                   |\r\n+----------------------+--------------------------------------------------------------------------------------------------+\r\n```\r\n\r\nThere's only one concern (not sure whether this should be the default behavior here) - I'm seeing the deleted file in both deleted and modified files. \r\n\r\nI've checked previous version (aka 0.8.4, current one) and this was the case before as well there - added and deleted files pop up in modified files as well. "}}
{"actor":{"display_login":"paweldudek"}}