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

Create base and head branches before running danger #5295

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

tomhughes
Copy link
Member

Let's have another go at getting danger working shall we...

This avoids the need to path danger, and resolves the problems with not fetching enough history for PRs with many commits, by prefetching the data and creating local danger_base and danger_head branches which are the default names that danger looks for.

@mmd-osm
Copy link
Contributor

mmd-osm commented Oct 30, 2024

Gemfile.lock update seems to be missing in the PR...

@tomhughes
Copy link
Member Author

That should be fixed now...

@mmd-osm
Copy link
Contributor

mmd-osm commented Oct 30, 2024

@nenad-vujicic : this might be a good topic for another rule in Dangerfile. Something like:

gemfile_modified = git.modified_files.include?("Gemfile")
gemfile_lock_modified = git.modified_files.include?("Gemfile.lock")

if gemfile_modified && !gemfile_lock_modified
  warn("Gemfile was updated, but Gemfile.lock wasn't updated. Usually, when Gemfile is updated, you should run `bundle install`.")
end

Copy link
Contributor

@nenad-vujicic nenad-vujicic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works perfectly on my side. I tested it by applying patches on my personal fork, forking my personal fork from another account and creating 2 PRs (one with 20 commits - worked perfectly, one with changed only Gemfile - worked perfectly again by generating appropriate label) for which new workflow worked fine.

Thanks!

@gravitystorm gravitystorm merged commit 8c0f575 into openstreetmap:master Nov 13, 2024
22 checks passed
@gravitystorm
Copy link
Collaborator

Merged, thanks!

@tomhughes tomhughes deleted the danger-branches branch November 13, 2024 16:51
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

Successfully merging this pull request may close these issues.

4 participants