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

Pushes via deployment write keys do not trigger reindex #3795

Closed
1 of 7 tasks
mqudsi opened this issue Apr 14, 2018 · 10 comments · Fixed by #5935
Closed
1 of 7 tasks

Pushes via deployment write keys do not trigger reindex #3795

mqudsi opened this issue Apr 14, 2018 · 10 comments · Fixed by #5935
Labels
Milestone

Comments

@mqudsi
Copy link
Contributor

mqudsi commented Apr 14, 2018

Description

It seems pushes to repos with rw deployment keys do not trigger a reindex of the repo or the "commit" event.

  1. Create repo
  2. Add deployment key with write access
  3. Push to repo with deployment key
  4. webui does not reflect changes, repo continues to show as if new

Reproduced on try.gitea: https://try.gitea.io/mqudsi/test-deploy
That repo appears blank, but it has content.

@bjoe2k4
Copy link

bjoe2k4 commented Sep 15, 2018

This bug just hit me hard and took me hours to realize what the problem was. Any update on this?

@stale
Copy link

stale bot commented Jan 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Jan 9, 2019
@lunny
Copy link
Member

lunny commented Jan 9, 2019

@bjoe2k4 need more investigation.

@stale stale bot removed the issue/stale label Jan 9, 2019
@dakira
Copy link
Contributor

dakira commented Jan 31, 2019

I'm using the latest HEAD and have the exact same problem. Using read/write deploy keys, the cache is not invalidated when pushing, using a user key, it is. Can I help investigating @lunny?

@zeripath
Copy link
Contributor

This is pushing with SSH keys?

I bet the environment variables for the hooks aren't being set properly.

@mqudsi
Copy link
Contributor Author

mqudsi commented Feb 1, 2019

Not regular ssh key push, pushing with rw-enabled deployment keys.

@zeripath
Copy link
Contributor

zeripath commented Feb 2, 2019

Yep, taking a look at gitea cmd/serv.go the environment settings aren't properly set.

@zeripath
Copy link
Contributor

zeripath commented Feb 2, 2019

I've pushed a branch to github but not opened a PR just yet until I've had a chance to test it

@lunny
Copy link
Member

lunny commented Feb 3, 2019

@mqudsi maybe you can confirm that #5935 fix this issue.

zeripath added a commit that referenced this issue Feb 3, 2019
…ment variables (#5935)

The gitea prerecieve and postrecieve hooks and the gitea PushUpdate function require that the PusherID and PusherName are real users. Previously, these environment variables were not being set when using a deploy key - the main result being that pushing to empty repositories meant that is_empty status was not changed.

I've also added an integration test to ensure that the is_empty status is updated on pushing with a deploy key.

There is a slight issue in that the deploy key is now considered a proxy for the owner - we don't have a way of separating out the deploy key from the owner at present. This can be fixed in another PR.

Fix #3795 

Signed-off-by: Andrew Thornton [email protected]
zeripath added a commit to zeripath/gitea that referenced this issue Feb 3, 2019
…ment variables (go-gitea#5935)

The gitea prerecieve and postrecieve hooks and the gitea PushUpdate function require that the PusherID and PusherName are real users. Previously, these environment variables were not being set when using a deploy key - the main result being that pushing to empty repositories meant that is_empty status was not changed.

I've also added an integration test to ensure that the is_empty status is updated on pushing with a deploy key.

There is a slight issue in that the deploy key is now considered a proxy for the owner - we don't have a way of separating out the deploy key from the owner at present. This can be fixed in another PR.

Fix go-gitea#3795 

Signed-off-by: Andrew Thornton [email protected]
aswild pushed a commit to aswild/gitea that referenced this issue Feb 3, 2019
…ment variables (go-gitea#5935)

The gitea prerecieve and postrecieve hooks and the gitea PushUpdate function require that the PusherID and PusherName are real users. Previously, these environment variables were not being set when using a deploy key - the main result being that pushing to empty repositories meant that is_empty status was not changed.

I've also added an integration test to ensure that the is_empty status is updated on pushing with a deploy key.

There is a slight issue in that the deploy key is now considered a proxy for the owner - we don't have a way of separating out the deploy key from the owner at present. This can be fixed in another PR.

Fix go-gitea#3795

Signed-off-by: Andrew Thornton [email protected]
Cherry-pick: 13c0f7d
techknowlogick pushed a commit that referenced this issue Feb 3, 2019
…ment variables (#5935) (#5944)

The gitea prerecieve and postrecieve hooks and the gitea PushUpdate function require that the PusherID and PusherName are real users. Previously, these environment variables were not being set when using a deploy key - the main result being that pushing to empty repositories meant that is_empty status was not changed.

I've also added an integration test to ensure that the is_empty status is updated on pushing with a deploy key.

There is a slight issue in that the deploy key is now considered a proxy for the owner - we don't have a way of separating out the deploy key from the owner at present. This can be fixed in another PR.

Fix #3795 

Signed-off-by: Andrew Thornton [email protected]
@dakira
Copy link
Contributor

dakira commented Feb 5, 2019

@lunny I can confirm this fixes the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants