Refactor pull request view (3)#37439
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the pull request “merge box” rendering by moving some previously-template-based logic into backend-prepared data.
Changes:
- Introduces a backend
pullMergeBoxDatastruct and exposes it to templates asPullMergeBoxData. - Updates the merge box template to consume
PullMergeBoxData(merge-box visibility, reload interval, and mergeability flags). - Refactors PR view preparation to reuse protected-branch rule data and adjusts signing / merge-box computations.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| templates/repo/issue/view_content/pull_merge_box.tmpl | Switches to $PullMergeBoxData for merge-box visibility and mergeability flags. |
| routers/web/repo/pull.go | Adds pullMergeBoxData, restructures pullRequestViewInfo fields, and centralizes loading of protected-branch rule and status check data. |
| routers/web/repo/issue_view.go | Populates MergeBoxData and moves complex merge-box conditionals from template into backend (incl. FIXME). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
045fa5f to
5fc4d63
Compare
5fc4d63 to
781d415
Compare
bircni
approved these changes
Apr 26, 2026
Member
bircni
left a comment
There was a problem hiding this comment.
good refactoring (how many (*) are left?
Contributor
Author
No idea. Maybe 2-3 for major changes? Although I can do everything in one PR, but it would be very difficult to review, and it might be also out of my control ( I can't guarantee that every change is on the right direction in that case) |
Member
|
you are right all good! I like it :-) |
lunny
approved these changes
Apr 26, 2026
silverwind
added a commit
to McMichalK/gitea
that referenced
this pull request
Apr 26, 2026
* origin/main: (176 commits) Refactor pull request view (3) (go-gitea#37439) Update 1.26.1 changelog in main (go-gitea#37442) Make GetPossibleUserByID can handle deleted user (go-gitea#37430) Fix fetch action redirect (go-gitea#37437) Refactor integration test DecodeJSON calls to use generic return value (go-gitea#37432) Integrate renovate bot for all dependency updates (go-gitea#37050) Refactor pull request view (2) (go-gitea#37428) Use MarkLongPolling instead of hard-coded route path (go-gitea#37427) Optimize CI caches (go-gitea#37387) Update AGENTS.md (go-gitea#37420) Update Nix flake (go-gitea#37425) [skip ci] Updated translations via Crowdin remove excessive quote from terraform instructions (go-gitea#37424) Improve testing init, clean up webhook tests (go-gitea#37412) Fix color regressions, add `priority` color (go-gitea#37417) [skip ci] Updated translations via Crowdin Stabilize e2e logout propagation test (go-gitea#37403) refactor: serve site manifest via `/assets/site-manifest.json` endpoint (go-gitea#37405) feat(security): set X-Content-Type-Options: nosniff by default (go-gitea#37354) Refactor pull request view (1) (go-gitea#37380) ... # Conflicts: # templates/repo/diff/box.tmpl
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Apr 27, 2026
* main: (33 commits) refactor: use named `Permission` field in `Repository` struct instead of anonymous embedding (go-gitea#37441) Refactor pull request view (3) (go-gitea#37439) Update 1.26.1 changelog in main (go-gitea#37442) Make GetPossibleUserByID can handle deleted user (go-gitea#37430) Fix fetch action redirect (go-gitea#37437) Refactor integration test DecodeJSON calls to use generic return value (go-gitea#37432) Integrate renovate bot for all dependency updates (go-gitea#37050) Refactor pull request view (2) (go-gitea#37428) Use MarkLongPolling instead of hard-coded route path (go-gitea#37427) Optimize CI caches (go-gitea#37387) Update AGENTS.md (go-gitea#37420) Update Nix flake (go-gitea#37425) [skip ci] Updated translations via Crowdin remove excessive quote from terraform instructions (go-gitea#37424) Improve testing init, clean up webhook tests (go-gitea#37412) Fix color regressions, add `priority` color (go-gitea#37417) [skip ci] Updated translations via Crowdin Stabilize e2e logout propagation test (go-gitea#37403) refactor: serve site manifest via `/assets/site-manifest.json` endpoint (go-gitea#37405) feat(security): set X-Content-Type-Options: nosniff by default (go-gitea#37354) ...
silverwind
added a commit
to hanism01/gitea
that referenced
this pull request
Apr 27, 2026
…-review-feedback * origin/main: (144 commits) Add API endpoint to reply to pull request review comments (go-gitea#36683) Add CurrentURL template variable back (go-gitea#37444) refactor: use named `Permission` field in `Repository` struct instead of anonymous embedding (go-gitea#37441) Refactor pull request view (3) (go-gitea#37439) Update 1.26.1 changelog in main (go-gitea#37442) Make GetPossibleUserByID can handle deleted user (go-gitea#37430) Fix fetch action redirect (go-gitea#37437) Refactor integration test DecodeJSON calls to use generic return value (go-gitea#37432) Integrate renovate bot for all dependency updates (go-gitea#37050) Refactor pull request view (2) (go-gitea#37428) Use MarkLongPolling instead of hard-coded route path (go-gitea#37427) Optimize CI caches (go-gitea#37387) Update AGENTS.md (go-gitea#37420) Update Nix flake (go-gitea#37425) [skip ci] Updated translations via Crowdin remove excessive quote from terraform instructions (go-gitea#37424) Improve testing init, clean up webhook tests (go-gitea#37412) Fix color regressions, add `priority` color (go-gitea#37417) [skip ci] Updated translations via Crowdin Stabilize e2e logout propagation test (go-gitea#37403) ... # Conflicts: # models/project/column.go # routers/web/repo/issue_page_meta.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move some complex logic to backend
Rename
pr.CanAutoMergetopr.IsStatusMergeable