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

Allow including Reviewed-on/Reviewed-by lines for custom merge messages #31211

Merged
merged 8 commits into from
Jun 6, 2024

Conversation

MaxWipfli
Copy link
Contributor

@MaxWipfli MaxWipfli commented Jun 1, 2024

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}

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 1, 2024
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 1, 2024
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/docs labels Jun 1, 2024
services/pull/merge.go Outdated Show resolved Hide resolved
docs/content/usage/merge-message-templates.en-us.md Outdated Show resolved Hide resolved
services/pull/merge.go Outdated Show resolved Hide resolved
@MaxWipfli
Copy link
Contributor Author

Thanks for the review, @delvh! I have addressed your comments.

@delvh delvh changed the title Add support for Reviewed-on/Reviewed-by trailers with custom merge messages Allow including Reviewed-on/Reviewed-by lines for custom merge messages Jun 3, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 3, 2024
@delvh delvh added type/enhancement An improvement of existing functionality topic/pr Issues related to pull requests labels Jun 3, 2024
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 6, 2024
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 6, 2024
@lunny lunny enabled auto-merge (squash) June 6, 2024 08:08
@lunny lunny merged commit da4bbc4 into go-gitea:main Jun 6, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Jun 6, 2024
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 6, 2024
silverwind added a commit to silverwind/gitea that referenced this pull request Jun 6, 2024
* origin/main: (231 commits)
  Allow including `Reviewed-on`/`Reviewed-by` lines for custom merge messages (go-gitea#31211)
  Add `MAX_ROWS` option for CSV rendering (go-gitea#30268)
  Update `golang.org/x/net` (go-gitea#31260)
  Add replacement module for `mholt/archiver` (go-gitea#31267)
  Fix Activity Page Contributors dropdown (go-gitea#31264)
  Optimize runner-tags layout to enhance visual experience (go-gitea#31258)
  fix: allow actions artifacts storage migration to complete succesfully (go-gitea#31251)
  Add `lint-go-gopls` (go-gitea#30729)
  Make blockquote attention recognize more syntaxes (go-gitea#31240)
  Fix admin oauth2 custom URL settings (go-gitea#31246)
  Replace `gt-word-break` with `tw-break-anywhere` (go-gitea#31183)
  Make pasted "img" tag has the same behavior as markdown image (go-gitea#31235)
  Remove .segment from .project-column (go-gitea#31204)
  Fix overflow on push notification (go-gitea#31179)
  Fix NuGet Package API for $filter with Id equality  (go-gitea#31188)
  Fix overflow on notifications (go-gitea#31178)
  Update chroma to v2.14.0 (go-gitea#31177)
  Update air package path (go-gitea#31233)
  Bump `@github/relative-time-element` to v4.4.1 (go-gitea#31232)
  Add option for mailer to override mail headers (go-gitea#27860)
  ...
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jun 7, 2024
* giteaofficial/main:
  Fix and clean up `ConfirmModal` (go-gitea#31283)
  Enable poetry non-package mode (go-gitea#31282)
  fixed the dropdown menu for the top New button to expand to the left (go-gitea#31273)
  Optimize repo-list layout to enhance visual experience (go-gitea#31272)
  Allow including `Reviewed-on`/`Reviewed-by` lines for custom merge messages (go-gitea#31211)
  Add `MAX_ROWS` option for CSV rendering (go-gitea#30268)
  Update `golang.org/x/net` (go-gitea#31260)
  Add replacement module for `mholt/archiver` (go-gitea#31267)
  Fix Activity Page Contributors dropdown (go-gitea#31264)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/docs modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files size/S Denotes a PR that changes 10-29 lines, ignoring generated files. topic/pr Issues related to pull requests type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants