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

Use GitLab's squash_commit_sha when available #27824

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

invliD
Copy link
Contributor

@invliD invliD commented Oct 28, 2023

Before this PR, the PR migration code populates Gitea's MergedCommitID field by using GitLab's merge_commit_sha field. However, that field is only populated when the PR was merged using a merge strategy. When a squash strategy is used, squash_commit_sha is populated instead.

Given that Gitea does not keep track of merge and squash commits separately, this PR simply populates Gitea's MergedCommitID by using whichever field is present in the GitLab API response.

ref: https://docs.gitlab.com/ee/api/merge_requests.html#response

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 28, 2023
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 28, 2023
@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 Oct 28, 2023
@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 Oct 29, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 29, 2023
@lunny lunny enabled auto-merge (squash) October 29, 2023 00:23
@lunny lunny merged commit 8faa385 into go-gitea:main Oct 29, 2023
25 checks passed
@GiteaBot GiteaBot added this to the 1.22.0 milestone Oct 29, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 29, 2023
@invliD invliD deleted the sb/squash-commit-sha branch October 29, 2023 00:59
zjjhot added a commit to zjjhot/gitea that referenced this pull request Oct 30, 2023
* giteaofficial/main:
  List all Debian package versions in `Packages` (go-gitea#27786)
  Fix merge base commit for fast-forwarded GitLab PRs (go-gitea#27825)
  Fix bad method call when deleting user secrets via API (go-gitea#27829)
  Change katex limits (go-gitea#27823)
  Dockerfile small refactor (go-gitea#27757)
  Use GitLab's squash_commit_sha when available (go-gitea#27824)
  [skip ci] Updated translations via Crowdin
  Upgrade xorm to 1.3.4 (go-gitea#27807)
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this pull request Jan 17, 2024
Before this PR, the PR migration code populates Gitea's MergedCommitID
field by using GitLab's merge_commit_sha field. However, that field is
only populated when the PR was merged using a merge strategy. When a
squash strategy is used, squash_commit_sha is populated instead.

Given that Gitea does not keep track of merge and squash commits
separately, this PR simply populates Gitea's MergedCommitID by using
whichever field is present in the GitLab API response.
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jan 27, 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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants