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

Add star in archived repo results in an error #6228

Closed
1 task done
Aragur opened this issue Mar 2, 2019 · 4 comments · Fixed by #6247
Closed
1 task done

Add star in archived repo results in an error #6228

Aragur opened this issue Mar 2, 2019 · 4 comments · Fixed by #6247
Labels
Milestone

Comments

@Aragur
Copy link

Aragur commented Mar 2, 2019

Description

See my repo on try.gitea.io.
Try to star it. This results in the following error

template: repo/header:31:51: executing "repo/header" at <$.UnitTypeCode>: invalid value; expected models.UnitType
@jolheiser
Copy link
Member

jolheiser commented Mar 5, 2019

This same thing happens when you click on watch in that repo, which narrows it down to most likely being the code here:
https://github.com/go-gitea/gitea/blob/master/routers/repo/repo.go#L288-L316

Nevermind, I think this is actually a context issue.

@jolheiser
Copy link
Member

The issue presented is partially caused by #5980
Now that the 404 page is loading a repo header if possible, this was failing because unit types aren't loaded for the action URL and the archived status is returning a 404 on actions.
I will send a PR to fix this, however I think there may be more work to be done after that.


In my opinion, it may be confusing to the end user why they get a 404 that displays the repo header, however they were unable to (un)watch/star the repo.

We could disable the buttons similarly to how the fork button is disabled if the user cannot fork, but...

  1. Shouldn't a user be able to, at the very least, unstar/watch an archived repo?
  2. Should all watchers and/or stargazers be removed when a repo is archived automatically? (I understand having a starred archived repo since you can still clone/download, but watching would be pretty moot)

In addition, should we display an error to the end user explaining that archived repos cannot be (un)watched/starred?

@Aragur
Copy link
Author

Aragur commented Mar 5, 2019

I think it should be possible to (un)star a archived repo. As of watching it's not that useful but I think enabling it would be better considering usibility

@jolheiser
Copy link
Member

For comparison, GitHub allows you to still fully interact with starring/watching an archived repo.

@lunny lunny added this to the 1.8.0 milestone Mar 9, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants