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’ll 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
Merged

Conversation

kolaente
Copy link
Member

@kolaente kolaente 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

@lafriks
Copy link
Member

lafriks commented Oct 3, 2018

Do not merge with master but try rebasing on master branch

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 3, 2018
@lafriks lafriks added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Oct 3, 2018
@kolaente
Copy link
Member Author

kolaente commented Oct 3, 2018

@lafriks done (actually, resetting was much faster)

@kolaente
Copy link
Member Author

kolaente 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)
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Member

@jonasfranz jonasfranz left a comment

Choose a reason for hiding this comment

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

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
@codecov-io
Copy link

codecov-io 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
Copy link
Member Author

kolaente 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
Copy link
Member

lunny commented Oct 8, 2018

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

@adelowo
Copy link
Member

adelowo 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
Copy link
Member

adelowo 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
Copy link
Member Author

@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
Copy link
Member Author

@adelowo which other changes cannot be updated in github?

@techknowlogick
Copy link
Member

@kolaente conflict with CSS

@jonasfranz please update review

@kolaente
Copy link
Member Author

@techknowlogick resolved conflicts

@techknowlogick techknowlogick dismissed jonasfranz’s stale review January 23, 2019 18:58

Changes have been made

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

@kolaente Thanks 😄

@theAkito
Copy link

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

@kolaente kolaente deleted the feature/archive-repos branch January 23, 2019 19:52
@kolaente
Copy link
Member Author

Thanks for merging this!

@adelowo
Copy link
Member

adelowo 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
Copy link
Member Author

kolaente 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
Copy link
Member

adelowo 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
Copy link
Member Author

Did you customize the header?

@kolaente
Copy link
Member Author

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

@adelowo
Copy link
Member

adelowo commented Jan 24, 2019

Did you customize the header?

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

Will go get again :)

@adelowo
Copy link
Member

adelowo 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

bmackinney pushed a commit to bmackinney/gitea that referenced this pull request Jan 27, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@delvh delvh removed the type/changelog Adds the changelog for a new Gitea version label Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.