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

Old repository not updating news feed and "Updated x ago" #789

Closed
klausenbusk opened this issue Dec 27, 2014 · 19 comments
Closed

Old repository not updating news feed and "Updated x ago" #789

klausenbusk opened this issue Dec 27, 2014 · 19 comments
Labels
💊 bug Something isn't working

Comments

@klausenbusk
Copy link

  • Bug Description:
    Today I pushed commits to 3 of my "old" repositories.
    Later today, I created a new repository and discovered it added some entry to my "News Feed", every time I did a commit, the "Updated x ago" also got updated under my profile every time.
    That got my wondering, why I did that for my 3 commits to my "old" repositories, and why the "Updated x ago" stuck at 3 months..
  • I read the serve.go and update.go, trying to understand how it work, I then checked the log files, and there was no errors at all. For my new repository there was some "Repository updated:", but nothing for my "old" repository..
  • Gogs Version: v0.5.9.1216 Beta
  • Git Version: 2.2.1
  • System Type: Arch Linux
  • Error Log: Nothing
  • Other information: gogs fix didn't change anything..
@klausenbusk
Copy link
Author

It seems like the "update" hook is missing..
Should I close this issue?

@unknwon
Copy link
Member

unknwon commented Dec 28, 2014

Hi, thanks your report!

Someone else reported this issue before, and hasn't got an idea why this is happening, but I'm sure it is a bug.

@unknwon unknwon added 💊 bug Something isn't working status: needs reproduce Wait, how did that happen? labels Dec 28, 2014
@klausenbusk
Copy link
Author

Someone else reported this issue before, and hasn't got an idea why this is happening, but I'm sure it is a bug.

I don't know either.. I'm trying to add some of them activity manually.
https://gist.github.com/klausenbusk/525d4cfc609a43670d01
What should the uuid be?

@unknwon
Copy link
Member

unknwon commented Dec 28, 2014

UUID is generated by serve.go: https://github.com/gogits/gogs/blob/master/cmd/serve.go#L171

@klausenbusk
Copy link
Author

UUID is generated by serve.go: https://github.com/gogits/gogs/blob/master/cmd/serve.go#L171

So I can't add it manually easy?

@unknwon
Copy link
Member

unknwon commented Dec 28, 2014

At least you cannot do it this way, UUID is for matching operations internally in Gogs, and needs modify database records, too.

@klausenbusk
Copy link
Author

If I remember correctly the repository was created with gogs v5.0.0..

@unknwon
Copy link
Member

unknwon commented Dec 29, 2014

@klausenbusk thanks your info! I'll try to test on it.

@michaeldyrynda
Copy link
Contributor

Hi @unknwon, I'm experiencing this issue also. It seems to have stopped updating about a day ago.

For a new repo I have, it adds to activity feed fine.

I had one created in an organisation, that doesn't seem to be updating though.

I just created a new user repo and pushed and it updated the activity feed.

I created a new organisation repo and pushed and it updated the activity feed.

I have updated from master since I created the original repo. I have also switched my origin (the repo was in BitBucket, then I switched it to gogs) in my working copy. I cloned that same repository directly from gogs and the activity doesn't appear in it.

Hope that gives you some direction on where to look to fix this issue!

@klausenbusk
Copy link
Author

Ho @deringer is the git update hook missing?

@michaeldyrynda
Copy link
Contributor

It's working fine for other repos, unless the hook is per-repository? Where would I look to check @klausenbusk?

@klausenbusk
Copy link
Author

It's working fine for other repos, unless the hook is per-repository? Where would I look to check @klausenbusk?

It is per-repository, check /user/repo/hooks . There should be a update file..

@michaeldyrynda
Copy link
Contributor

Looks like it's not there. This is from one of the repos that isn't working:

total 48K
drwxrwxr-x 2 git git 4.0K Jan  5 14:02 .
drwxrwxr-x 7 git git 4.0K Jan  5 14:02 ..
-rwxrwxr-x 1 git git  452 Jan  5 14:02 applypatch-msg.sample
-rwxrwxr-x 1 git git  896 Jan  5 14:02 commit-msg.sample
-rwxrwxr-x 1 git git  189 Jan  5 14:02 post-update.sample
-rwxrwxr-x 1 git git  398 Jan  5 14:02 pre-applypatch.sample
-rwxrwxr-x 1 git git 1.7K Jan  5 14:02 pre-commit.sample
-rwxrwxr-x 1 git git 1.3K Jan  5 14:02 prepare-commit-msg.sample
-rwxrwxr-x 1 git git 1.4K Jan  5 14:02 pre-push.sample
-rwxrwxr-x 1 git git 4.8K Jan  5 14:02 pre-rebase.sample
-rwxrwxr-x 1 git git 3.6K Jan  5 14:02 update.sample

This is from one that is:

total 56K
drwxrwxr-x 2 git git 4.0K Jan  7 08:07 .
drwxrwxr-x 7 git git 4.0K Jan  6 08:46 ..
-rw-rw-rw- 1 git git  452 Mar 17  2014 applypatch-msg.sample
-rw-rw-rw- 1 git git  896 Mar 17  2014 commit-msg.sample
-rw-rw-rw- 1 git git  160 Mar 17  2014 post-commit.sample
-rw-rw-rw- 1 git git  552 Mar 17  2014 post-receive.sample
-rw-rw-rw- 1 git git  189 Mar 17  2014 post-update.sample
-rw-rw-rw- 1 git git  398 Mar 17  2014 pre-applypatch.sample
-rw-rw-rw- 1 git git 1.7K Mar 17  2014 pre-commit.sample
-rw-rw-rw- 1 git git 1.3K Mar 17  2014 prepare-commit-msg.sample
-rw-rw-rw- 1 git git 4.9K Mar 17  2014 pre-rebase.sample
-rwxrwxr-x 1 git git   83 Jan  6 08:45 update
-rw-rw-rw- 1 git git 3.6K Mar 17  2014 update.sample

I wonder what would cause the hook to disappear? It might have something to do with the fact that I migrated the repository and that process didn't create the update hook. Looking at the non-working hooks directory, all those files are set with permissions 775, whilst one that was created by gogs they're all 666 AND there's also an update and post-commit hook present.

That said, perhaps gogs should check if the update hook exists for a migration - if not, create it and if so, merge / append it to the existing one?

EDIT: Adding the missing hook then pushing resulted in the dashboard being updated.

@michaeldyrynda
Copy link
Contributor

Doing some light perusing of models/repo.go, I see that createHookUpdate is called only within initRepository, so adding the checks into the MigrateRepository check as outlined above (merge if update hook exists, else create) should do the trick for migrated repositories.

@klausenbusk
Copy link
Author

@unknwon I was able to reproduce this (what @deringer said):

  1. New Migration https://github.com/gogits/gogs
  2. git clone https://try.gogs.io/klausenbusk/gogs
  3. touch test && git -a commit -m "test" && git push
  4. "activity" feed not updated..
    https://try.gogs.io/klausenbusk/gogs
    skaermbillede fra 2015-02-09 18 20 33

@unknwon
Copy link
Member

unknwon commented Feb 9, 2015

@klausenbusk thanks for the tip!

@unknwon
Copy link
Member

unknwon commented Feb 9, 2015

Hi @klausenbusk , I've pushed fix on dev branch and you can test on https://try.gogs.io

BTW, if you want to fix old repos, there is an operation called Rewrite all update hook of repositories to do this job right now.

@unknwon unknwon added status: needs feedback Tell me more about it and removed status: needs reproduce Wait, how did that happen? labels Feb 9, 2015
@klausenbusk
Copy link
Author

Hi @klausenbusk , I've pushed fix on dev branch and you can test on https://try.gogs.io

I can confirm that it work now, when you do a "Migration"..

@unknwon
Copy link
Member

unknwon commented Feb 9, 2015

@klausenbusk awesome!

Thanks for your patient!

@unknwon unknwon closed this as completed Feb 9, 2015
@unknwon unknwon removed the status: needs feedback Tell me more about it label Feb 9, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💊 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants