Teach Danger how to pick up renamed files
What does this MR do?
Danger does not pick up renamed files correctly. If someone uses git.modified_files
of the Danger DSL, it will pick up the file name before the rename.
Consider these changes:
- A new_file.rb
- D deleted_file.rb
- M modified_file.rb
- R renamed_file_before.rb -> renamed_file_after.rb
If you use the pattern git.added_files + git.modified_files
you'll end up with [ 'new_file.rb', 'modified_file.rb', 'renamed_file_before.rb' ]
.
This MR introduces a new helper plugin common_helpers
. common_helpers.all_changed_files
will return: [ 'new_file.rb', 'modified_file.rb', 'renamed_file_after.rb' ]
for the changes above.
What are the relevant issue numbers?
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52783
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides
Edited by Lukas Eipert