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

Commits pushed with deploy keys not shown in owner/member dashboard #21324

Closed
lassebm opened this issue Oct 3, 2022 · 5 comments · Fixed by #24521
Closed

Commits pushed with deploy keys not shown in owner/member dashboard #21324

lassebm opened this issue Oct 3, 2022 · 5 comments · Fixed by #24521
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Milestone

Comments

@lassebm
Copy link

lassebm commented Oct 3, 2022

Description

After upgrading from 1.15.x to 1.17.2, all commits pushed by an organization using deploy keys with write access are not shown in the dashboard of owner or member users of the org/repo receiving the push. The commits are shown on the dashboard of admin users. Tried "Resynchronize pre-receive, update and post-receive hooks of all repositories." without luck.

Reproducible on 1.17.2, not reproducible on 1.15.x and 1.16.x.

Steps to reproduce:

  • Spin up Gitea instance as Docker container: docker run -p "3000:3000" -p "2222:22" gitea/gitea:1.17.2
  • Walk through first time setup with defaults and 'testadmin' admin user
  • Create 'testuser' normal user through site admin
  • Create 'testorg' organization with private visibility
  • Create 'testteam' team in 'testorg'
  • Add 'testuser' to 'testteam'
  • Create 'testrepo' repo in 'testorg' with private visibility
  • Add 'testteam' as collaborator in 'testrepo'
  • Generate SSH key and add it as deploy key with write access in 'testrepo'
  • Checkout 'testrepo', make commit and push to server with deploy key
  • Verify commit is visible in dashboard
  • Login as 'testuser' and verify commit is visible in dashboard

Gitea Version

1.17.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker container on Docker Engine 20.10.17.

Database

SQLite

@wxiaoguang wxiaoguang added this to the 1.17.3 milestone Oct 3, 2022
@6543 6543 modified the milestones: 1.17.3, 1.17.4 Oct 13, 2022
@lunny
Copy link
Member

lunny commented Dec 12, 2022

Maybe because testuser hasn't watch testrepo before that push?

@lassebm
Copy link
Author

lassebm commented Dec 12, 2022

@lunny All repos the user is a member of seems to be auto-watched.

@lunny lunny modified the milestones: 1.17.4, 1.17.5 Dec 21, 2022
@lassebm
Copy link
Author

lassebm commented Jan 19, 2023

Still reproducible on 1.18.1.

@lunny lunny removed this from the 1.17.5 milestone Mar 20, 2023
@lassebm
Copy link
Author

lassebm commented May 2, 2023

Still reproducible on 1.19.2.

@wxiaoguang wxiaoguang added this to the 1.20.0 milestone May 2, 2023
@wxiaoguang wxiaoguang added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label May 2, 2023
@wxiaoguang
Copy link
Contributor

Thank you for the detailed steps and sorry for the inconvenience.

I was going to take a look at it but recently I have some high priority PRs. Hopefully some people could help to look into this problem. 🙏

lunny pushed a commit that referenced this issue May 10, 2023
Fix #21324

In the current logic, if the `Actor` user is not an admin user, all
activities from private organizations won't be shown even if the `Actor`
user is a member of the organization.

As mentioned in the issue, when using deploy key to make a commit and
push, the activity's `act_user_id` will be the id of the organization so
the activity won't be shown to non-admin users because the visibility of
the organization is private.

https://github.com/go-gitea/gitea/blob/55a57177600028ba8e4a480a08f1ee4d69d219d6/models/activities/action.go#L490-L503

This PR improves this logic so the activities of private organizations
can be shown.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants