Skip to content

Conversation

thehowl
Copy link
Contributor

@thehowl thehowl commented Feb 10, 2017

Fixes #811

Signed-off-by: Morgan Bazalgette <the@howl.moe>
models/repo.go Outdated

// If repo has become private, we need to set its actions to private.
if repo.IsPrivate {
e.Where("repo_id = ?", repo.ID).Cols("is_private").Update(&Action{
Copy link
Member

Choose a reason for hiding this comment

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

We should check the returned error

e.Where("repo_id = ?", repo.ID).Cols("is_private").Update(&Action{
IsPrivate: true,
})
}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we also mark the actions as public if the repo becomes public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've thought about that, and I am not sure whether having a feed that adds new events "in the past" would make much sense.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough

@ethantkoenig
Copy link
Member

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Feb 10, 2017
@lunny lunny added this to the 1.1.0 milestone Feb 11, 2017
@lunny lunny added the type/bug label Feb 11, 2017
@strk
Copy link
Member

strk commented Feb 11, 2017

It would be good to add tests for bugfixes, had you looked at what it would take ?

// If repo has become private, we need to set its actions to private.
if repo.IsPrivate {
_, err = e.Where("repo_id = ?", repo.ID).Cols("is_private").Update(&Action{
IsPrivate: true,
Copy link
Member

Choose a reason for hiding this comment

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

IsPrivate: repo.IsPrivate, ? And remove the if repo.IsPrivate ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already discussed this in the linked comment. As I said, "I am not sure whether having a feed that adds new events "in the past" would make much sense.".

Copy link
Member

Choose a reason for hiding this comment

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

OK.

@thehowl
Copy link
Contributor Author

thehowl commented Feb 11, 2017

@strk, will look into tests later today

@lunny
Copy link
Member

lunny commented Feb 11, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 11, 2017
@thehowl
Copy link
Contributor Author

thehowl commented Feb 11, 2017

Added a test, as requested by @strk.

@strk
Copy link
Member

strk commented Feb 11, 2017

LGTM, thanks for the test !

@lunny lunny merged commit 442145d into go-gitea:master Feb 11, 2017
@thehowl thehowl deleted the 811-fix-public-activity branch February 11, 2017 11:21
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
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/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Public activity shows private repositories
5 participants