Added workflow for PR labeling using Danger
This PR proposes possible solution for labeling pull requests using Danger described in #4912
Proposed solution introduces new workflow, executed whenever new PR is created or updated. Workflow checks if PR is too big (>500 changed lines) or changes one of translation files (YML, except en.yml) or contains merge-commits and generates appropriate labels using Danger and danger-auto_label plugin. If none of these is found, green "Good PR" is generated.
Dear @tomhughes ,
Thanks for reviewing and comments. I've just updated with above fixes.
Regarding linear_history plugin, its implementation is exactly the same we are using in Dangerfile and it reports "Please rebase to get rid of the merge commits in this PR", so, is it better to install new gem for perhaps simpler code or to use current solution? I would be happy to replace with using linear_history plugin if required :-)
Regarding updating .rubocop.yml, it seems Dangerfile file is already being linted (without updating .rubocop.yml). Do we need some special adjustments?
Please, let me know if I could improve these further.
Thanks, Nenad.
Rebased and updated Gemfile.lock to work with the latest sources.
What do you mean by adding pre-commit hooks? If you mean that will run on people's checkouts then there is no way to add those to a repository in a way that means they will automatically be enabled in checkouts. We can certainly provide examples but people would have to enable them by hand.
By adding pre-commit hooks, I mean providing a setup that contributors can manually enable/install to streamline the process of following our contributing guidelines before committing. While hooks can't be automatically enabled, we can provide contributors with scripts and instructions to simplify their setup. Tools like Overcommit for Ruby projects can be a good start for this.
Hi @gravitystorm, did you maybe have a chance to take a look at this PR?
Thanks!
Updated colors (see below screenshots) and message when there are no warnings (to "PR passed all labeling tests. It is small enough, doesn't contain merge-commits and doesn't change non-EN translations!").
Here is how they look in dark mode:
Improved green color for "Good" label.
Please, let me know if we can further improve it.
Thanks.
Please rebase, to resolve conflicts in Gemfile.lock
Please rebase, to resolve conflicts in Gemfile.lock
Rebased, thanks!
Removed "Good" label and rebased again. Thanks!
Merged, thanks! In particular, thanks for your patience and for the multiple rebases.
Sadly this does not appear to be working properly ... https://github.com/openstreetmap/openstreetmap-website/actions/runs/11370083928/job/31629028217?pr=5266