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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Archive repos #5009

Merged
merged 94 commits into from Jan 23, 2019

Conversation

@kolaente
Copy link
Member

commented Oct 3, 2018

This pr adds the ability to archive a repo, as described in #1353.

When a repo is archived, it is not possible to push to it, neither the creation of new issues or pull requests. In all lists (~Dashboard/Search/Explore/Profiles), the repo is marked with a tiny inicator if its archived.

Blocked by go-gitea/go-sdk#122

Off-Topic: I actually don't know why this pr shows up with 391 commits 馃, so if anyone knows how to resolve this, please tell me.

Screenshots

image
image
image
image

@kolaente kolaente referenced this pull request Oct 3, 2018
@lafriks

This comment has been minimized.

Copy link
Member

commented Oct 3, 2018

Do not merge with master but try rebasing on master branch

@kolaente kolaente force-pushed the kolaente:feature/archive-repos branch from 062b168 to 16a96f3 Oct 3, 2018

@kolaente

This comment has been minimized.

Copy link
Member Author

commented Oct 3, 2018

@lafriks done (actually, resetting was much faster)

@kolaente

This comment has been minimized.

Copy link
Member Author

commented Oct 3, 2018

I tried to use this icon for the "this repo is archived"-indicator, but it seems like the version of octicon we're using is outdated. After that, I looked for a way to update it (in a seperate pr) but apparantly github has removed icon font usage entirely, meaning we'd need to update every icon in the whole project to use svg icons instead...

So I'm sticking with the icon from semantic ui for now.

routers/repo/http.go Show resolved Hide resolved
}
if err := repo.ToggleArchiveRepo(); err != nil {
log.Error(4, "Tried to archive a repo: %s", err)
ctx.Error(500)

This comment has been minimized.

Copy link
@jonasfranz

jonasfranz Oct 5, 2018

Member

This will be ignored since ctx.Redirect will use a 3XX HTTP code.

@jonasfranz
Copy link
Member

left a comment

screenshot_2018-10-05 archived

It is possible to add/upload new files although the repo is archived.

Editing an existing file is possible too.

@lunny lunny added this to the 1.7.0 milestone Oct 5, 2018

kolaente added some commits Oct 5, 2018

fmt
@codecov-io

This comment has been minimized.

Copy link

commented Oct 6, 2018

Codecov Report

Merging #5009 into master will decrease coverage by 0.04%.
The diff coverage is 30.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5009      +/-   ##
==========================================
- Coverage   37.93%   37.89%   -0.05%     
==========================================
  Files         328      328              
  Lines       48141    48190      +49     
==========================================
- Hits        18264    18261       -3     
- Misses      27252    27299      +47     
- Partials     2625     2630       +5
Impacted Files Coverage 螖
modules/auth/repo_form.go 39% <酶> (酶) 猬嗭笍
routers/repo/setting.go 10.41% <0%> (-0.77%) 猬囷笍
routers/repo/http.go 38.17% <0%> (-0.42%) 猬囷笍
routers/repo/release.go 33.04% <100%> (酶) 猬嗭笍
routers/repo/view.go 47.3% <100%> (酶) 猬嗭笍
routers/repo/wiki.go 44.59% <100%> (酶) 猬嗭笍
models/repo.go 43.81% <20%> (-0.08%) 猬囷笍
modules/context/repo.go 59.57% <50%> (-0.21%) 猬囷笍
routers/routes/routes.go 85.05% <92.3%> (酶) 猬嗭笍
models/repo_indexer.go 44.49% <0%> (-3.82%) 猬囷笍
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 6ad834e...746f9a9. Read the comment docs.

routers/repo/editor.go Outdated Show resolved Hide resolved
models/repo.go Outdated Show resolved Hide resolved
@kolaente

This comment has been minimized.

Copy link
Member Author

commented Oct 7, 2018

You mean I should just explicitly check if the repo is archived when someone tries to create an issue/pr?
I tried to do exactly this, but I figured it would be much easier to just disable issue/pr creation when I archive a repo... What do you think about disabling the "re-enabling" of issue/pr when a repo is archived?

@lunny

This comment has been minimized.

Copy link
Member

commented Oct 8, 2018

@kolaente maybe somebody want to search issues on an archive repo?

kolaente added some commits Oct 11, 2018

@adelowo adelowo referenced this pull request Oct 11, 2018
5 of 5 tasks complete

kolaente added some commits Jan 16, 2019

@adelowo

This comment has been minimized.

Copy link
Member

commented Jan 20, 2019

By the way, wouldn't we want to make it request for the name of
the repository as with other actions in the Danger Zone?

@adelowo

This comment has been minimized.

Copy link
Member

commented Jan 20, 2019

On GitHub when a repo is archived, its name and some other options cannot be updated.

screenshot 2019-01-20 at 15 30 47

@kolaente

This comment has been minimized.

Copy link
Member Author

commented Jan 22, 2019

@adelowo I don't think it's nessecary to have a name-check as this can easily be undone, not like renaming the repo.

@kolaente

This comment has been minimized.

Copy link
Member Author

commented Jan 22, 2019

@adelowo which other changes cannot be updated in github?

kolaente added some commits Jan 22, 2019

@techknowlogick

This comment has been minimized.

Copy link
Member

commented Jan 23, 2019

@kolaente conflict with CSS

@jonasfranz please update review

@kolaente

This comment has been minimized.

Copy link
Member Author

commented Jan 23, 2019

@techknowlogick resolved conflicts

Changes have been made

@techknowlogick techknowlogick merged commit 0b51072 into go-gitea:master Jan 23, 2019

2 checks passed

approvals/lgtm this commit looks good
continuous-integration/drone/pr the build was successful
Details
@techknowlogick

This comment has been minimized.

Copy link
Member

commented Jan 23, 2019

@kolaente Thanks 馃槃

@Akito13

This comment has been minimized.

Copy link

commented Jan 23, 2019

I have been waiting so long for this feature and now it has been finally added!

@kolaente kolaente deleted the kolaente:feature/archive-repos branch Jan 23, 2019

@kolaente

This comment has been minimized.

Copy link
Member Author

commented Jan 23, 2019

Thanks for merging this!

lafriks added a commit to lafriks-fork/gitea that referenced this pull request Jan 23, 2019

@adelowo

This comment has been minimized.

Copy link
Member

commented Jan 24, 2019

template: repo/header:11:10: executing "repo/header" at <.IsArchived>: can't evaluate field IsArchived in type *models.Repository

This didn't come with a migration. I keep on getting this error.
Looking at the history of the migrations folder, I cannot see anything related: https://github.com/go-gitea/gitea/commits/master/models/migrations

I know when I tested earlier, it was fine :)

@kolaente

This comment has been minimized.

Copy link
Member Author

commented Jan 24, 2019

Did it create the table column? Normally it syncs all structs automatically, so it should exist (which is why I didn't create a dedicated migration).

@adelowo

This comment has been minimized.

Copy link
Member

commented Jan 24, 2019

is_archived is in the table. I just tried this on a new database ( from scratch ) and still the same thing :). My master branch is clean though.

@kolaente

This comment has been minimized.

Copy link
Member Author

commented Jan 24, 2019

Did you customize the header?

@kolaente

This comment has been minimized.

Copy link
Member Author

commented Jan 24, 2019

I just tried it on try.gitea.io where it works without issues...

@adelowo

This comment has been minimized.

Copy link
Member

commented Jan 24, 2019

Did you customize the header?

No... I do have a clean branch, no customizations

Will go get again :)

@adelowo

This comment has been minimized.

Copy link
Member

commented Jan 24, 2019

No idea why rm -rf and go get worked again. I am 100% I had a clean branch but it's solved already.

/shrug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.