Skip to content

Commit

Permalink
fix: remove automated contribution message
Browse files Browse the repository at this point in the history
Unfortunately, the automated contribution message does not work properly. To evaluate this correctly, we need to first filter out all merge commits. To do this, we need to check the length of the `parents` property. I did not find a way to do this with jinja2 filters. Which would allow us to do something like `rejectattr`.

In the code snippet removed in this PR, I attempted to create a property to filter the merge commits on. This also doesn't work because the underlying object exposed by mergify is not a dictionary but a class and thus does not have the `update` function.

Mergify is shipping an additional property next month: Mergifyio/mergify#4636 (reply in thread). Thus, I am replacing this automated mechanism with a manual section that we can add to the PR until mergify ships the additional property that we can utilize to implement this in a clean way.

Related: #4130.
Related: #4104.

Pull-Request: #4131.
  • Loading branch information
thomaseizinger authored Jun 27, 2023
1 parent 7953a79 commit 514e2e9
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,8 @@ defaults:
{{ body | get_section("## Description", "") }}
Pull-Request: #{{ number }}.
{# Here comes some fancy Jinja2 stuff for correctly attributing co-authorship: #}
{%- set _ = 0 -%}
{%- for commit in commits -%}
{%- if commit.parents|length != 1 -%}
{%- set _ = commit.update({'merge': true}) -%}
{%- else -%}
{%- set _ = commit.update({'merge': false}) -%}
{%- endif -%}
{%- endfor -%}
{%- for commit in (commits | rejectattr("merge") | unique(False, 'email_author')) | rejectattr("author", "==", author) -%}
Co-authored-by: {{ commit.author }} <{{ commit.email_author }}>
{% endfor %}
{# GitHub requires that the `Co-authored-by` lines are AT THE VERY END of a commit, hence nothing must come after this. #}
{{ body | get_section("## Attributions", "") }}
pull_request_rules:
- name: Ask to resolve conflict
Expand Down

0 comments on commit 514e2e9

Please sign in to comment.