Skip to content

Remove ProjectMember#owner? method

Manoj M J requested to merge mmj-remove-project-member-owner into master

What does this MR do and why?

This is a tiny refactor so as to get us ready towards keeping the changes in !81393 (merged) smaller and easier to review. !81393 (merged) is a big endeavour and has far-reaching side effects, so we decided the best way to do this is to iterate to it over multiple smaller MRs.

By breaking that into smaller chunks, it is easier for review and it would also help us control the surface area of problems if something were to go wrong.

In this particular MR, we are trying to:

  • Remove ProjectMember#owner? method because:
    • It is essentially an override of an already existing Member#owner? method.
    • This method only works correctly in case of projects that are in personal namespaces, not in groups.
    • The current usages of ProjectMember#owner? in the codebase is to check if the member user is the owner of the personal namespace of the project, so for the direction we are moving into with !82177 (merged), ie, provide the ability for projects to have multiple owners, making this check against just the namespace's owner does not make sense. Even a personal project can have more than one owner from now on.

I have added more details on the changes as notes on the diff for easier review.

No changelog added as this is only a refactor.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Manoj M J

Merge request reports