Skip to content

Add gpg signing for merge rebase and update by rebase#36701

Merged
lunny merged 6 commits into
go-gitea:mainfrom
lunny:lunny/fix_sign_update_by_rebase
Apr 5, 2026
Merged

Add gpg signing for merge rebase and update by rebase#36701
lunny merged 6 commits into
go-gitea:mainfrom
lunny:lunny/fix_sign_update_by_rebase

Conversation

@lunny
Copy link
Copy Markdown
Member

@lunny lunny commented Feb 21, 2026

Fix #36685


Generated by a coding agent with Codex 5.2 LLM.

@lunny lunny added type/bug backport/v1.25 This PR should be backported to Gitea 1.25 labels Feb 21, 2026
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 21, 2026
@lunny lunny requested a review from Copilot February 22, 2026 05:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds GPG/SSH signing support for pull request operations that involve rebasing: merge-by-rebase and update-branch-by-rebase. Previously, commits created during these operations were not signed even when signing was configured, which is the issue reported in #36685.

Changes:

  • Refactored commit signing logic into a reusable addCommitSigningOptions helper function
  • Applied signing to rebase operations in merge and update workflows
  • Added integration test to verify commits are signed after update-by-rebase operation

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
services/pull/merge.go Introduces addCommitSigningOptions helper function to centralize GPG/SSH signing configuration for git commands
services/pull/merge_squash.go Refactored to use the new addCommitSigningOptions helper instead of inline signing logic
services/pull/merge_rebase.go Added signing support to the commit amend operation in rebase fast-forward merge
services/pull/merge_prepare.go Added signing support to the rebase command used when tracking branch is rebased onto base
tests/integration/gpg_ssh_git_test.go Added comprehensive test case verifying commits are signed after update-by-rebase with appropriate signing configuration
Comments suppressed due to low confidence (1)

services/pull/merge.go:454

  • Inconsistent flag format: The codebase consistently uses -S%s format for GPG signing (see modules/git/repo_tree.go:52, services/repository/init.go:51, services/repository/files/temp_repo.go:299), but this line uses --gpg-sign=%s. While both formats are functionally equivalent in git, the code should maintain consistency with the existing convention.
	cmd.AddOptionFormat("--gpg-sign=%s", signKey.KeyID)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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 Feb 22, 2026
@silverwind silverwind changed the title Add sign for merge rebase and update by rebase Add gpg signing for merge rebase and update by rebase Feb 22, 2026
@silverwind
Copy link
Copy Markdown
Member

silverwind commented Feb 22, 2026

BTW @lunny i would recommend stop backporting so much and focus on getting 1.26 out, it's already due. Maybe make one last 1.25 release but then move forward please.

@wxiaoguang
Copy link
Copy Markdown
Contributor

I never see he has any plan. Till now, the 1.25.4 release issue is still open. Release: Publish Gitea 1.25.4 #36278

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Feb 22, 2026

Yeah and this manual release process is too complex. Like 75% of those points can and should be automated. Release process should be triggered by the tag push, everything else can be triggered on CI, except maybe the blog post.

@lunny
Copy link
Copy Markdown
Member Author

lunny commented Feb 22, 2026

I never see he has any plan. Till now, the 1.25.4 release issue is still open. Release: Publish Gitea 1.25.4 #36278

Hm, too many security fix haven't been fixed/merged.

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Feb 22, 2026

Sure, security fixes are fine but instead of backporting so much, I think it's more important to have regular main branch releases, like every 3 months would be desirable, on a fixed an predictable schedule at least.

The problem with the release branches is they are always lagging behind in many regards. We don't update dependencies in them so the dependencies become vulnerable over time. Better to have more frequent main branch releases to lessen that dependency problem.

@lunny lunny removed the backport/v1.25 This PR should be backported to Gitea 1.25 label Feb 22, 2026
@lunny lunny marked this pull request as ready for review February 22, 2026 20:23
@lunny
Copy link
Copy Markdown
Member Author

lunny commented Apr 5, 2026

Last call @go-gitea/technical-oversight-committee

@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 Apr 5, 2026
@bircni bircni added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 5, 2026
@lunny lunny merged commit e47c613 into go-gitea:main Apr 5, 2026
26 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Apr 5, 2026
@lunny lunny deleted the lunny/fix_sign_update_by_rebase branch April 5, 2026 20:37
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 5, 2026
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 7, 2026
* main:
  Repair duration display for bad stopped timestamps (go-gitea#37121)
  Add terraform state registry (go-gitea#36710)
  Add placeholder content for empty content page (go-gitea#37114)
  Improve control char rendering and escape button styling (go-gitea#37094)
  Add gpg signing for merge rebase and update by rebase (go-gitea#36701)
  Move package settings to package instead of being tied to version (go-gitea#37026)
  Merge some standalone Vite entries into index.js (go-gitea#37085)
  Update Nix flake (go-gitea#37110)
  [skip ci] Updated translations via Crowdin
  Fix the wrong push commits in the pull request when force push (go-gitea#36914)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Update branch by rebase" button doesn`t sign commits

6 participants