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

Fix activity feed #1779

Merged
merged 4 commits into from
May 26, 2017
Merged

Fix activity feed #1779

merged 4 commits into from
May 26, 2017

Conversation

ethantkoenig
Copy link
Member

@ethantkoenig ethantkoenig commented May 23, 2017

Preserve actions after user/repo name change. Fixes #1730.

Essentially removes the act_user_name, repo_user_name, and repo_name columns from the action table (which can become stale when a user/repo changes name). There's really no point in having the act_user_name column, since you have the load the user for the avatar link anyways.

NOTE: I'm having some trouble getting the migration to work; if anyone knows how to drop columns with xorm, please help me out.

return "action"
}

func removeActionColumns(x *xorm.Engine) (err error) {
Copy link
Member

Choose a reason for hiding this comment

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

But this will not remove the column currently.

Copy link
Member Author

Choose a reason for hiding this comment

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

I know, I made a note of it in the PR description. How does one remove columns with xorm?

Copy link
Member

Choose a reason for hiding this comment

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

Not the best at xorm but you could still execute sql and pass a ALTER TABLE command

@lunny lunny added this to the 1.2.0 milestone May 23, 2017
@lunny lunny added the type/bug label May 23, 2017
@lunny
Copy link
Member

lunny commented May 23, 2017

This will also drop #1744

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 23, 2017
@sapk
Copy link
Member

sapk commented May 23, 2017

It will be more easy/clean to remove :

 	ActUserID    int64  `xorm:"INDEX"` // Action user id.
	ActUserName  string // Action user name.
 	ActAvatar    string `xorm:"-"`
 	RepoID       int64  `xorm:"INDEX"`
	RepoUserName string
	RepoName     string

and simply use ActUser *User et Repo *Repository and let xorm make the linking.

@ethantkoenig
Copy link
Member Author

@sapk Updated the migration, and took your suggestion about the fields for the Action struct

@ethantkoenig
Copy link
Member Author

Build timed out 😢

@sapk
Copy link
Member

sapk commented May 23, 2017

You could easely restart the build by doing a git commit --amend and pushing (with -f) the new commit ;-).
We should add an issue for this problem that were seing more and more with the addition of test.

@ethantkoenig
Copy link
Member Author

Rebased onto master to retrigger build

"github.com/stretchr/testify/assert"
)

func TestAction_GetRepoPath(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

How about add some new tests?

@lunny
Copy link
Member

lunny commented May 25, 2017

LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 25, 2017
@lafriks
Copy link
Member

lafriks commented May 25, 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 May 25, 2017
@lunny lunny merged commit 0c332f0 into go-gitea:master May 26, 2017
@ethantkoenig ethantkoenig deleted the fix_action branch May 29, 2017 14:34
@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.

Activity Feed is not updated after username-change
5 participants