[policy, no patch] Merge request policy questions

Created on 24 February 2021, about 4 years ago
Updated 9 May 2023, almost 2 years ago

Problem/Motivation

Now that we have merge requests, we have some documentation on the practicalities of how to create and merge them:

Developers: https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
Maintainers: https://www.drupal.org/docs/develop/git/git-for-drupal-project-maintaine...
(see also this related issue about a 3rd page that duplicates this content: #3197834: Two pages about merge requests

One thing we are lacking in this documentation is guidance/policies.

Steps to reproduce

Proposed resolution

a. Identify the questions to be answered (see below)

b. The core governance group needs to come up with answers/policies/guidelines for Drupal core. (see below)

c. Document these answers somewhere.

Remaining tasks

All of the above.

Current question/answer list

Questions to be answered and/or policies to establish:

  1. When should an issue use a patch and when should it use a merge request?
  2. If there is already a merge request on an issue, is it OK for a new developer to commit to it?
  3. When should you make a new branch in the issue fork or a new merge request?
    from xjm in Slack:
    The issue summary explodes if there are multiple MRs and there's no way to delete/hide them currently. If that were fixed we could establish a convention around creating a new branch for a rebase, but it doesn't scale to every time something needs to be rerolled. Maybe there could be a maximum of 2 non-hidden MRs?

    from drumm in Slack:
    I do not recommend using multiple merge requests to re-roll. Either git rebase or git merge in upstream, using the same branches.

    from xjm in Slack:
    Rebased branches are easier for reviewers to work with. Merges make the issue history on d.o very confusing and make it harder to identify which commits are actually part of the changeset.

    That said, there is some risk in teaching novice contributors to do that. There is also a UI button for rebasing I believe? I think that "Needs reroll" is something that should cease to be a task (and cease to be credited unless there are merge conflicts that were resolved). We don't want people doing drive-by rebases of branches they've not contributed to otherwise.

    drumm: I’m 70% certain the rebase button doesn’t handle conflict. There is a conflict resolution UI somewhere, I think on merge only.

    xjm: 95% of patch rerolls are rebased locally with no merge conflicts. I think we should add a "Needs merge conflict resolution" tag (or sometihng) that will replace the 5% remaining usecase of "Needs reroll".

    drumm: And there’s no point to rebasing unless there is a merge conflict. If it is just rebasing for the sake of rebasing, that’s just extra noise.

  4. Is it OK to force push if you are rebasing?
    From xjm in Slack:
    rebase-force-push is the cleanest way to update an MR branch so long as the contributor is aware it's destructive and dangerous if used incorrectly

    From drumm in Slack:
    On force push, backup tags are made of the previous work, like https://git.drupalcode.org/issue/drupalorg-3192158/-/tags

  5. Something about the "suggestion feature" ??? [mentioned by xjm in Slack]
  6. Continue to heavily encourage making a comment before we work on an existing merge request / issue fork branch.
    From drumm in Slack: Yes. Always be communicating. Especially commenting to sum up once a round of work is done.
🌱 Plan
Status

Fixed

Version

10.1

Component
Other 

Last updated 1 day ago

Created by

🇺🇸United States jhodgdon Spokane, WA, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    I am trying to figure out what still needs to be done here. We've been using GitLab for a while now and some established practices has emerged and there is more documentation as well. Using GitLab to Contribute to Drupal .

    This is a summary of the items in the issue summary.

    1. When should an issue use a patch and when should it use a merge request?
    2. No documentation that I could find.

    3. If there is already a merge request on an issue, is it OK for a new developer to commit to it?
    4. Yes. Documented at https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-drupal/introduction#s-introduction-to-issue-forks-and-merge-requests <

    5. When should you make a new branch in the issue fork or a new merge request?
    6. No documentation that I could find

    7. Is it OK to force push if you are rebasing?
    8. Documented process at Rebase a merge request .

    9. Something about the "suggestion feature" ??? [mentioned by xjm in Slack]
    10. No documentation that I could find.

    11. Continue to heavily encourage making a comment before we work on an existing merge request / issue fork branch.
    12. The contributor tasks for patches and merge requests includes a step for adding the comment before working.
      Related documentation regarding credit at How is credit granted for Drupal core issues

    So this is what is fixed and what needs work.
    1 - This seems to be at the preference of the contributor and therefor I don't think this needs to be documented. However, an MR and the suggestion feature make working on coding standards issues easier. But that can be done in a specific how to wiki page for coding standards.
    2 - Fixed
    3 - What I see is that new MRs are created when needed to change the branch or by people seeking credit for clicking a button. The latter has been addressed in the crediting documentation. As for the former, I am not sure documentation is needed.
    4 - Fixed
    5 - The suggestion feature is in use and is just part of GitLab. I don't see why this need specific documentation.
    6 - Fixed?

    I am not finding a need to add documentation, which is surprising. Is documentation needed for 1, 3, 5 or 6?

  • Status changed to Needs review almost 2 years ago
  • 🇳🇿New Zealand quietone

    Setting to NR to get other opinions.

    Is there documentation needed?

  • 🇳🇿New Zealand quietone

    I asked in #needs-review-queue-initiative about this issue. FeyP responded about 1, 2 and 5.

    For 1) I have taken the suggestion and added documentation that simply states the contributor decides to use a patch or merge workflow. The docs are Patch or merge request and linked to it at Creating merge requests .

    For 2) FeyP prefers a single MR per issue. I think this is implied in the existing documentation, "One or more contributors commits/pushes changes to the fork." so no change for this one.

    For 5) FeyP thinks that the intention was to document that the suggestion feature should be used instead of just commenting. So I have added that to the Reviewing a merge request .

  • Status changed to Fixed almost 2 years ago
  • 🇳🇿New Zealand quietone

    That leaves 3) and 6).

    3) For this, there has been a learning phase and people engaged in credit farming. Ignoring those, people make a new branch or MR as needed. One frequent reason is to move to a more recent branch. I am not sure what to document here nor is there a suggestion in this issue. Also things may change with 🌱 [Policy] Branch Naming: Use an 11.x branch for HEAD, then use 'main' when d.o can support it Fixed .

    6) adding comments is something that is encouraged all the time. I see it in comments, wiki pages, slack etc. I do think that is part of our practice and that no further documentation is needed.

    Therefor I am going to close this as fixed. It was worthwhile to endure that these points are covered.

    If you disagree, or I have missed something, re-open the issue and add a comment. ping me in Slack as well.

    Cheers

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024