Change request: fix review comments form#139
Conversation
…e update routes * fix template to use /pulls/ instead of /issues/ in change request urls * register article-namespace view routes for change request info, attachments, content-history * register article-namespace update routes for comments, reactions, title, content, and all other change request update operations * register article-namespace comment edit/delete and pull-specific review routes
There was a problem hiding this comment.
Pull request overview
This pull request fixes URL paths for pull request operations to use /pulls/ instead of /issues/ and adds article-based routes for pull request operations. The changes enable proper routing for pull requests in article-based views (accessed via /article/{username}/{subjectname} URLs).
Changes:
- Moved
addIssuesPullsUpdateRoutesfunction earlier in the file to make it reusable for both standard and article-based routes - Added article-based pull request view routes (info, attachments, content-history) at line 1413
- Added article-based pull request update routes (comments, reactions, title, content, etc.) at lines 1416-1431
- Fixed template to dynamically use
/pulls/or/issues/path based on whether the item is a pull request
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| routers/web/web.go | Refactored route definitions to share update routes between standard and article-based URLs; added new article-based routes for pull request operations |
| custom/templates/repo/issue/view_content.tmpl | Introduced dynamic path selection to use correct URL path (/pulls/ vs /issues/) for reactions, attachments, and comments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* remove redundant RepoMustNotBeArchived() on inner article pulls group
|
/review |
|
Automated Review Notice This PR does not appear to have an associated issue. Every PR must have an assigned issue linked in its description. Please update the PR description to reference an issue (e.g., |
|
/review |
Automated PR ReviewCombined Code Review🔴 Critical: Article-based URLs missing
|
|
/review |
Automated PR ReviewCombined Code Review🔴
|
|
/review AI review started. |
Advanced AI Review
Click to expand review1. 🔴 Critical: Route Registration path mismatch for Attachments
File: Problem: Suggestion: // routers/web/web.go:1308-1338
addIssuesPullsUpdateRoutes := func() {
// for "/{username}/{reponame}/issues", "/{username}/{reponame}/pulls",
// or "/article/{username}/{subjectname}/pulls"
m.Group("/{index}", func() {
m.Post("/title", repo.UpdateIssueTitle)
m.Post("/content", repo.UpdateIssueContent)
m.Post("/deadline", repo.UpdateIssueDeadline)
m.Post("/watch", repo.IssueWatch)
m.Post("/ref", repo.UpdateIssueRef)
m.Post("/pin", reqRepoAdmin, repo.IssuePinOrUnpin)
m.Post("/viewed-files", repo.UpdateViewedFiles)
m.Group("/dependency", func() {
m.Post("/add", repo.AddDependency)
m.Post("/delete", repo.RemoveDependency)
})
m.Combo("/comments").Post(repo.MustAllowUserComment, web.Bind(forms.CreateCommentForm{}), repo.NewComment)
m.Group("/times", func() {
m.Post("/add", web.Bind(forms.AddTimeManuallyForm{}), repo.AddTimeManually)
m.Post("/{timeid}/delete", repo.DeleteTime)
m.Group("/stopwatch", func() {
m.Post("/start", repo.IssueStartStopwatch)
m.Post("/stop", repo.IssueStopStopwatch)
m.Post("/cancel", repo.CancelStopwatch)
})
})
m.Post("/time_estimate", repo.UpdateIssueTimeEstimate)
m.Post("/reactions/{action}", web.Bind(forms.ReactionForm{}), repo.ChangeIssueReaction)
m.Post("/lock", reqRepoIssuesOrPullsWriter, web.Bind(forms.IssueLockForm{}), repo.LockIssue)
m.Post("/unlock", reqRepoIssuesOrPullsWriter, repo.UnlockIssue)
m.Post("/delete", reqRepoAdmin, repo.DeleteIssue)
m.Post("/content-history/soft-delete", repo.SoftDeleteContentHistory)
// START FIX: Move attachments inside the /{index} group
m.Post("/attachments", repo.UploadIssueAttachment)
m.Post("/attachments/remove", repo.DeleteAttachment)
// END FIX
})
// These routes likely apply to the issue list or batch operations, kept outside /{index}
m.Post("/labels", reqRepoIssuesOrPullsWriter, repo.UpdateIssueLabel)
m.Post("/milestone", reqRepoIssuesOrPullsWriter, repo.UpdateIssueMilestone)
m.Post("/projects", reqRepoIssuesOrPullsWriter, reqRepoProjectsReader, repo.UpdateIssueProject)
m.Post("/assignee", reqRepoIssuesOrPullsWriter, repo.UpdateIssueAssignee)
m.Post("/status", reqRepoIssuesOrPullsWriter, repo.UpdateIssueStatus)
m.Post("/delete", reqRepoAdmin, repo.BatchDeleteIssues)
m.Delete("/unpin/{index}", reqRepoAdmin, repo.IssueUnpin)
m.Post("/move_pin", reqRepoAdmin, repo.IssuePinMove)
}2. 🟡 Medium: Potential duplication of Route Definitions
File: Problem: Suggestion: 3. 🟡 Medium: Outdated Comment in
|
1. 🔴 Critical: Route Registration path mismatch for Attachments
2. 🟡 Medium: Potential duplication of Route DefinitionsThere's no duplication. The 3. 🟡 Medium: Outdated Comment in
|
|
/crush_fast AI review started. |
Advanced AI Review
Click to expand reviewNo review found in agentic output. Review generated using |
|
/crush_fast (Z.ai seems to be having problems... let me try that one more time) AI review started. |
Advanced AI Review
Click to expand reviewCode Review: Discussion Feature for Change Requests🔴 Issue 1: Missing
|
taoeffect
left a comment
There was a problem hiding this comment.
Great work @pedrogaudencio!! 🎉
Fixes #93