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

[Note] Refactor Pull MergeBox logic #11077

Open
6543 opened this issue Apr 15, 2020 · 4 comments
Open

[Note] Refactor Pull MergeBox logic #11077

6543 opened this issue Apr 15, 2020 · 4 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/refactoring Existing code has been cleaned up. There should be no new functionality.

Comments

@6543
Copy link
Member

6543 commented Apr 15, 2020

currently a lot of the logic went into templates/repo/issue/view_content/pull.tmpl witch is general a bad idear.

move status check logick back into a go function ...
(red vs yelow vs green ... icon)
(if if can merged or force-merged or blocked)

come up with: #11074

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Apr 15, 2020
@stale
Copy link

stale bot commented Jun 14, 2020

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale stale bot added the issue/stale label Jun 14, 2020
@6543
Copy link
Member Author

6543 commented Jun 14, 2020

ping

@stale stale bot removed the issue/stale label Jun 14, 2020
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Jun 15, 2020
@silverwind
Copy link
Member

@6543 still valid?

@MaxWipfli
Copy link
Contributor

Yes, this is still an issue. It is very related to a problem I am having, which is the following:

I want to use a default merge message (by using .gitea/default_merge_message/MERGE_TEMPLATE.md). However, this removes the Reviewed-on and Reviewed-by lines in the merge message, and as far as I can see, there is no way to add them back in using the message template.

The reason for this is that the logic constructing the default-default merge message (i.e., if MERGE_TEMPLATE.md does not exist) is embedded in templates/repo/issue/view_content/pull.tmpl. If DefaultMergeBody (which is the templated MERGE_TEMPLATE.md is not set, the Reviewed-on and Reviewed-by lines are directly injected into the HTML template.

What would be desired is a way to inject these lines into the custom merge template, most likely via some variables.

lunny pushed a commit that referenced this issue Jun 6, 2024
…ssages (#31211)

This PR introduces the `ReviewedOn` and `ReviewedBy` variables for the
default merge message templates (e.g.,
`.gitea/default_merge_message/MERGE_TEMPLATE.md`).

This allows customizing the default merge messages while retaining these
trailers.

This also moves the associated logic out of `pull.tmpl` into the
relevant Go function.

This is a first contribution towards #11077.

---

For illustration, this allows to recreate the "default default" merge
message with the following template:
```
.gitea/default_merge_message/MERGE_TEMPLATE.md
Merge pull request '${PullRequestTitle}' (${PullRequestReference}) from ${HeadBranch} into ${BaseBranch}

${ReviewedOn}
${ReviewedBy}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

No branches or pull requests

4 participants