Skip to content

Fix activity feed - #1779

Merged
lunny merged 4 commits into
go-gitea:masterfrom
ethantkoenig:fix_action
May 26, 2017
Merged

Fix activity feed#1779
lunny merged 4 commits into
go-gitea:masterfrom
ethantkoenig:fix_action

Conversation

@ethantkoenig

@ethantkoenig ethantkoenig commented May 23, 2017

Copy link
Copy Markdown
Member

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.

Comment thread models/migrations/v34.go Outdated

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

lunny commented May 23, 2017

Copy link
Copy Markdown
Member

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

sapk commented May 23, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

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

@ethantkoenig

Copy link
Copy Markdown
Member Author

Build timed out 😢

@sapk

sapk commented May 23, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

Rebased onto master to retrigger build

Comment thread models/action_test.go Outdated

Copy link
Copy Markdown
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

lunny commented May 25, 2017

Copy link
Copy Markdown
Member

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

lafriks commented May 25, 2017

Copy link
Copy Markdown
Member

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