-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Fix public activity showing private repos #892
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
Conversation
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{ |
There was a problem hiding this comment.
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, | ||
}) | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough
LGTM |
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, |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
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.".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
@strk, will look into tests later today |
LGTM |
Added a test, as requested by @strk. |
LGTM, thanks for the test ! |
Fixes #811