-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Use ghost user if package creator does not exist #23822
Conversation
@@ -99,7 +101,11 @@ func GetPackageDescriptor(ctx context.Context, pv *PackageVersion) (*PackageDesc | |||
} | |||
creator, err := user_model.GetUserByID(ctx, pv.CreatorID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be GetPossibleUserByID
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, if the user gets deleted, the CreatorID
is not -1 or -2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So maybe we need to check if it's -2 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does actions user have write permission to create packages?
If not, maybe we don't need to check -2 here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does actions user have write permission to create packages?
I think it doesn't. Gitea will use the trigger user instead of actions bot user as the package creator in #23729.
However, I think it will be more robust to support actions bot as package creator. (BTW, not the owner)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it is not merged. It seems that actions user can not create packages in current version, but I’m not sure about this, so I asked this question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it is not merged. It seems that actions user can not create packages in current version, but I’m not sure about this, so I asked this question.
OK, I misunderstand your question. So the answer to Does actions user have write permission to create packages
is no now, and I 90% sure it should be no by default, but maybe we can provide an option to set it on UI for users in the future.
This comment was marked as outdated.
This comment was marked as outdated.
* giteaoffical/main: Fix image border-radius (go-gitea#23886) [skip ci] Updated translations via Crowdin Scroll collapsed file into view (go-gitea#23702) docs: make the required backticks in email password more explicit (go-gitea#23923) docs: fix typo (go-gitea#23924) Update docs markdown file weight to make it clear (go-gitea#23909) Add activity feeds API (go-gitea#23494) Fix code view (diff) broken layout (go-gitea#23096) Use ghost user if package creator does not exist (go-gitea#23822) Org pages style fixes (go-gitea#23901) User/Org Feed render description as per web (go-gitea#23887)
Fixes #23818