Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor: move part of updating protected branch logic to service layer#33742

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@lunny
Copy link
Member

No description provided.

@GiteaBotGiteaBot added the lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelFeb 27, 2025
@github-actionsgithub-actionsbot added modifies/apiThis PR adds API routes or modifies them modifies/goPull requests that update Go code labelsFeb 27, 2025
@lunnylunny requested a review fromCopilotFebruary 27, 2025 18:00
@lunnylunny added the type/refactoringExisting code has been cleaned up. There should be no new functionality. labelFeb 27, 2025
@lunnylunny added this to the1.24.0 milestoneFeb 27, 2025
Copy link

CopilotAI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR refactors the protected branch update logic by moving part of it to the service layer, centralizing functionality and reducing redundancy. Key changes include:

  • Introducing a new service function (CreateOrUpdateProtectedBranch) in services/pull/protected_branch.go to encapsulate the update and PR recheck logic.
  • Updating the web and API route handlers to call the new service function instead of duplicating the branch-check logic.
  • Removing redundant inline recheck logic and cleaning up obsolete comments.

Reviewed Changes

FileDescription
services/pull/protected_branch.goNew service function for creating or updating protected branches.
routers/web/repo/setting/protected_branch.goUpdated to use the new service function for protected branch updates.
routers/api/v1/repo/branch.goRemoved duplicate branch-check logic in favor of the new service.
services/forms/repo_form.goRemoved extraneous ASCII art comments.

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

Comments suppressed due to low confidence (1)

services/pull/protected_branch.go:22

  • [nitpick] Consider renaming 'isPlainRule' to 'isRegularRule' for improved clarity on the branch rule type.
isPlainRule := !git_model.IsRuleNameSpecial(protectBranch.RuleName)

@GiteaBotGiteaBot added lgtm/need 1This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelsMar 4, 2025
@GiteaBotGiteaBot added lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1This PR needs approval from one additional maintainer to be merged. labelsMar 5, 2025
@lunnylunnyenabled auto-merge (squash)March 5, 2025 18:48
@lunnylunny added the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelMar 5, 2025
@lunnylunny merged commit0453177 intogo-gitea:mainMar 5, 2025
26 checks passed
@GiteaBotGiteaBot removed the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelMar 5, 2025
zjjhot added a commit to zjjhot/gitea that referenced this pull requestMar 6, 2025
* giteaofficial/main:  [skip ci] Updated translations via Crowdin  Refactor: move part of updating protected branch logic to service layer (go-gitea#33742)  Update changelog for v1.23.5 (go-gitea#33797)  Email option to embed images as base64 instead of link (go-gitea#32061)  Update TypeScript types (go-gitea#33799)  Disable vet=off again (go-gitea#33794)
@lunnylunny deleted the lunny/merge_update_protected_branch branchMarch 14, 2025 02:45
@go-giteago-gitea locked asresolvedand limited conversation to collaboratorsJun 3, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

Copilot code reviewCopilotCopilot left review comments

@wxiaoguangwxiaoguangwxiaoguang approved these changes

+1 more reviewer

@hiifonghiifonghiifong approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore.modifies/apiThis PR adds API routes or modifies themmodifies/goPull requests that update Go codetype/refactoringExisting code has been cleaned up. There should be no new functionality.

Projects

None yet

Milestone

1.24.0

Development

Successfully merging this pull request may close these issues.

4 participants

@lunny@wxiaoguang@hiifong@GiteaBot

[8]ページ先頭

©2009-2025 Movatter.jp