-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Feature: Archive repos #5009
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
Feature: Archive repos #5009
Changes from all commits
16a96f3
232f71e
fbf39fe
8655d0e
6f53048
b365cd9
34c1419
a7cc8fa
3877a2d
9c366eb
4b38053
d94b479
b4fb9cd
afa879a
88a916e
365217a
be792b5
0b3a040
88ed10a
5564126
376cb8a
fa5e308
f522479
ffed84e
3cee9db
badaed3
587c539
4e51555
7e9928b
35168a2
e85bde0
3de3a52
8125e5c
d7540c3
3717807
33b1100
5b6d3ab
4875328
4ba0284
427a19d
abc4769
1845c55
1d4743e
e6e6514
52c423a
a907901
ea44530
35c043b
d839ef3
a1cdf69
5a51757
d6769d9
9ac5878
f14bf50
9c02656
9f79370
21a6ee9
f0558ad
ff9b36d
e0ba3c3
06b57c4
3e3ef92
5a2d7a0
b9e4ef2
f56ebf1
ee1460c
f58ed26
24cc9a6
14f176e
3f3d4bf
6f15e7f
39c9cd5
de0c4e0
5095950
d40cbde
d1f9402
212b21f
36b947b
feb2c74
dce82f5
a07b36b
dcaefdb
4cf4278
b4de2fe
8af6f25
37977a2
8bb4bb2
c60da13
559b4cf
06b99c9
280baa5
0a118f0
71d9305
746f9a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -492,7 +492,7 @@ func RegisterRoutes(m *macaron.Macaron) { | |
m.Group("/branches", func() { | ||
m.Combo("").Get(repo.ProtectedBranch).Post(repo.ProtectedBranchPost) | ||
m.Combo("/*").Get(repo.SettingsProtectedBranch). | ||
Post(bindIgnErr(auth.ProtectBranchForm{}), repo.SettingsProtectedBranchPost) | ||
Post(bindIgnErr(auth.ProtectBranchForm{}), context.RepoMustNotBeArchived(), repo.SettingsProtectedBranchPost) | ||
}, repo.MustBeNotEmpty) | ||
|
||
m.Group("/hooks", func() { | ||
|
@@ -530,13 +530,13 @@ func RegisterRoutes(m *macaron.Macaron) { | |
}) | ||
}, reqSignIn, context.RepoAssignment(), reqRepoAdmin, context.UnitTypes(), context.RepoRef()) | ||
|
||
m.Get("/:username/:reponame/action/:action", reqSignIn, context.RepoAssignment(), repo.Action) | ||
m.Get("/:username/:reponame/action/:action", reqSignIn, context.RepoAssignment(), context.RepoMustNotBeArchived(), repo.Action) | ||
|
||
m.Group("/:username/:reponame", func() { | ||
m.Group("/issues", func() { | ||
m.Combo("/new").Get(context.RepoRef(), repo.NewIssue). | ||
Post(bindIgnErr(auth.CreateIssueForm{}), repo.NewIssuePost) | ||
}, reqRepoIssueReader) | ||
}, context.RepoMustNotBeArchived(), reqRepoIssueReader) | ||
// FIXME: should use different URLs but mostly same logic for comments of issue and pull reuqest. | ||
// So they can apply their own enable/disable logic on routers. | ||
m.Group("/issues", func() { | ||
|
@@ -557,32 +557,32 @@ func RegisterRoutes(m *macaron.Macaron) { | |
}) | ||
}) | ||
m.Post("/reactions/:action", bindIgnErr(auth.ReactionForm{}), repo.ChangeIssueReaction) | ||
}) | ||
}, context.RepoMustNotBeArchived()) | ||
|
||
m.Post("/labels", reqRepoIssuesOrPullsWriter, repo.UpdateIssueLabel) | ||
m.Post("/milestone", reqRepoIssuesOrPullsWriter, repo.UpdateIssueMilestone) | ||
m.Post("/assignee", reqRepoIssuesOrPullsWriter, repo.UpdateIssueAssignee) | ||
m.Post("/status", reqRepoIssuesOrPullsWriter, repo.UpdateIssueStatus) | ||
}) | ||
}, context.RepoMustNotBeArchived()) | ||
m.Group("/comments/:id", func() { | ||
m.Post("", repo.UpdateCommentContent) | ||
m.Post("/delete", repo.DeleteComment) | ||
m.Post("/reactions/:action", bindIgnErr(auth.ReactionForm{}), repo.ChangeCommentReaction) | ||
}) | ||
}, context.RepoMustNotBeArchived()) | ||
m.Group("/labels", func() { | ||
m.Post("/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel) | ||
m.Post("/edit", bindIgnErr(auth.CreateLabelForm{}), repo.UpdateLabel) | ||
m.Post("/delete", repo.DeleteLabel) | ||
m.Post("/initialize", bindIgnErr(auth.InitializeLabelsForm{}), repo.InitializeLabels) | ||
}, reqRepoIssuesOrPullsWriter, context.RepoRef()) | ||
}, context.RepoMustNotBeArchived(), reqRepoIssuesOrPullsWriter, context.RepoRef()) | ||
m.Group("/milestones", func() { | ||
m.Combo("/new").Get(repo.NewMilestone). | ||
Post(bindIgnErr(auth.CreateMilestoneForm{}), repo.NewMilestonePost) | ||
m.Get("/:id/edit", repo.EditMilestone) | ||
m.Post("/:id/edit", bindIgnErr(auth.CreateMilestoneForm{}), repo.EditMilestonePost) | ||
m.Get("/:id/:action", repo.ChangeMilestonStatus) | ||
m.Post("/delete", repo.DeleteMilestone) | ||
}, reqRepoIssuesOrPullsWriter, context.RepoRef()) | ||
}, context.RepoMustNotBeArchived(), reqRepoIssuesOrPullsWriter, context.RepoRef()) | ||
m.Group("/milestone", func() { | ||
m.Get("/:id", repo.MilestoneIssuesAndPulls) | ||
}, reqRepoIssuesOrPullsWriter, context.RepoRef()) | ||
|
@@ -607,7 +607,7 @@ func RegisterRoutes(m *macaron.Macaron) { | |
m.Post("/upload-file", repo.UploadFileToServer) | ||
m.Post("/upload-remove", bindIgnErr(auth.RemoveUploadFileForm{}), repo.RemoveUploadFileFromServer) | ||
}, context.RepoRef(), repo.MustBeEditable, repo.MustBeAbleToUpload) | ||
}, reqRepoCodeWriter, repo.MustBeNotEmpty) | ||
}, context.RepoMustNotBeArchived(), reqRepoCodeWriter, repo.MustBeNotEmpty) | ||
|
||
m.Group("/branches", func() { | ||
m.Group("/_new/", func() { | ||
|
@@ -617,7 +617,7 @@ func RegisterRoutes(m *macaron.Macaron) { | |
}, bindIgnErr(auth.NewBranchForm{})) | ||
m.Post("/delete", repo.DeleteBranchPost) | ||
m.Post("/restore", repo.RestoreBranchPost) | ||
}, reqRepoCodeWriter, repo.MustBeNotEmpty) | ||
}, context.RepoMustNotBeArchived(), reqRepoCodeWriter, repo.MustBeNotEmpty) | ||
|
||
}, reqSignIn, context.RepoAssignment(), context.UnitTypes()) | ||
|
||
|
@@ -630,11 +630,11 @@ func RegisterRoutes(m *macaron.Macaron) { | |
m.Get("/new", repo.NewRelease) | ||
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost) | ||
m.Post("/delete", repo.DeleteRelease) | ||
}, reqSignIn, repo.MustBeNotEmpty, reqRepoReleaseWriter, context.RepoRef()) | ||
}, reqSignIn, repo.MustBeNotEmpty, context.RepoMustNotBeArchived(), reqRepoReleaseWriter, context.RepoRef()) | ||
m.Group("/releases", func() { | ||
m.Get("/edit/*", repo.EditRelease) | ||
m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost) | ||
}, reqSignIn, repo.MustBeNotEmpty, reqRepoReleaseWriter, func(ctx *context.Context) { | ||
}, reqSignIn, repo.MustBeNotEmpty, context.RepoMustNotBeArchived(), reqRepoReleaseWriter, func(ctx *context.Context) { | ||
var err error | ||
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.Repository.DefaultBranch) | ||
if err != nil { | ||
|
@@ -652,7 +652,7 @@ func RegisterRoutes(m *macaron.Macaron) { | |
|
||
m.Group("/:username/:reponame", func() { | ||
m.Post("/topics", repo.TopicsPost) | ||
}, context.RepoAssignment(), reqRepoAdmin) | ||
}, context.RepoMustNotBeArchived(), context.RepoAssignment(), reqRepoAdmin) | ||
|
||
m.Group("/:username/:reponame", func() { | ||
m.Group("", func() { | ||
|
@@ -672,7 +672,7 @@ func RegisterRoutes(m *macaron.Macaron) { | |
m.Combo("/:page/_edit").Get(repo.EditWiki). | ||
Post(bindIgnErr(auth.NewWikiForm{}), repo.EditWikiPost) | ||
m.Post("/:page/delete", repo.DeleteWikiPagePost) | ||
}, reqSignIn, reqRepoWikiWriter) | ||
}, context.RepoMustNotBeArchived(), reqSignIn, reqRepoWikiWriter) | ||
}, repo.MustEnableWiki, context.RepoRef()) | ||
|
||
m.Group("/wiki", func() { | ||
|
@@ -694,14 +694,14 @@ func RegisterRoutes(m *macaron.Macaron) { | |
m.Get(".diff", repo.DownloadPullDiff) | ||
m.Get(".patch", repo.DownloadPullPatch) | ||
m.Get("/commits", context.RepoRef(), repo.ViewPullCommits) | ||
m.Post("/merge", reqRepoPullsWriter, bindIgnErr(auth.MergePullRequestForm{}), repo.MergePullRequest) | ||
m.Post("/cleanup", context.RepoRef(), repo.CleanUpPullRequest) | ||
m.Post("/merge", context.RepoMustNotBeArchived(), reqRepoPullsWriter, bindIgnErr(auth.MergePullRequestForm{}), repo.MergePullRequest) | ||
m.Post("/cleanup", context.RepoMustNotBeArchived(), context.RepoRef(), repo.CleanUpPullRequest) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In fact, this will delete the branch on the head repository not the base repository. For example. there are some pull requests merged but not clean up on the base repository, but then it's archived. Then should user delete head repository's branch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean we should still enable the possiblity to still clean it when its archived? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think yes, need more discuss. |
||
m.Group("/files", func() { | ||
m.Get("", context.RepoRef(), repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.ViewPullFiles) | ||
m.Group("/reviews", func() { | ||
m.Post("/comments", bindIgnErr(auth.CodeCommentForm{}), repo.CreateCodeComment) | ||
m.Post("/submit", bindIgnErr(auth.SubmitReviewForm{}), repo.SubmitReview) | ||
}) | ||
}, context.RepoMustNotBeArchived()) | ||
}) | ||
}, repo.MustAllowPulls) | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.