Check existing forks for user access before suggesting creation of a fork
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=549642) </details> <!--IssueSummary end--> <!-- This issue template can be used as a great starting point for feature requests. Learn more about the process: https://handbook.gitlab.com/handbook/product/product-management/#customer-feature-requests. The section "Release notes" can be used as a summary of the feature and is also required if you want to have your release post blog MR auto generated using the release post item generator: https://about.gitlab.com/handbook/marketing/blog/release-posts/#release-post-item-generator. The remaining sections are the backbone for every feature in GitLab. The goal of this template is brevity for quick/smaller iterations. For a more thorough list of considerations for larger features or feature sets, you can leverage the detailed [feature proposal](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/issue_templates/Feature%20proposal%20-%20detailed.md). --> ### Release notes <!-- What is the problem and solution you're proposing? This content sets the overall vision for the feature and serves as the release notes that will populate in various places, including the [release post blog](https://about.gitlab.com/releases/categories/releases/) and [Gitlab project releases](https://gitlab.com/gitlab-org/gitlab/-/releases). " --> ### Problem to solve <!-- What is the user problem you are trying to solve with this issue? --> When users without access try to edit a page, they get a popup telling them to fork the project to make changes. ![gitlab_fork](/uploads/f2465124a94a37a5b168c8d928455a47/gitlab_fork.png) For large projects like GitLab, forking it can exceed the Free storage limit of 10GiB, which prevents changes being added to the fork. Here is how that might look for the user: 1. Identify a change to be made (e.g. a typo) 2. Edit -> Open in Web IDE 3. Fork to make changes popup -> Fork 4. User has to wait for the large fork to be made in their namespace 5. After waiting, the user goes to edit their fork, only to discover they are now over their namespace storage limit and cannot edit their fork. 6. The user is presented with no path forward. They cannot make the change because they can't push, they cannot make any changes until they wait for the fork to be deleted, and there's no clear guidance on how they can make the change they'd like. ### Proposal <!-- Use this section to explain the feature and how it will work. It can be helpful to add technical details, design proposals, and links to related epics or issues. --> The "Fork to make changes" popup should present the user with forks that the user has appropriate permission to edit (if one exists). I think the order that makes the most sense is: 1. Check the user's namespace (this is the current behavior) 2. Check the current namespace (e.g. GitLab.org/gitlab-community-fork) 3. Check groups the user is a member of (e.g. Gitlab Community/Gitlab) Other points: - I don't think it makes sense to check all public forks - but it could be configurable for an instance? - Project Owners might want to be able to specify a default fork. - Instance Administrators might want to be able to specify a default forking behavior. ### Intended users Open source communities/organizations, but particularly ones that follow a similar model to GitLab. But the utility can extend to any organization that wants to limit private namespaces while also limiting edit access to projects. * [Sasha (Software Developer)](https://handbook.gitlab.com/handbook/product/personas/#sasha-software-developer) * [Sidney (Systems Administrator)](https://handbook.gitlab.com/handbook/product/personas/#sidney-systems-administrator) * [Ingrid (Infrastructure Operator)](https://handbook.gitlab.com/handbook/product/personas/#ingrid-infrastructure-operator) * [Eddie (Content Editor)](https://handbook.gitlab.com/handbook/product/personas/#eddie-content-editor) * [Amy (Application Security Engineer)](https://handbook.gitlab.com/handbook/product/personas/#amy-application-security-engineer) * [Isaac (Infrastructure Engineer)](https://handbook.gitlab.com/handbook/product/personas/#isaac-infrastructure-security-engineer) ### Feature Usage Metrics <!-- How are you going to track usage of this feature? Think about user behavior and their interaction with the product. What indicates someone is getting value from it? Explore (../../doc/development/internal_analytics/internal_event_instrumentation/quick_start.md) for a guide. --> ### Does this feature require an audit event? <!--- Checkout these docs to know more https://docs.gitlab.com/ee/development/audit_event_guide/#what-are-audit-events https://docs.gitlab.com/administration/compliance/audit_event_reports/ ---> If setting default forks or default forking behavior is implemented, those would need audit events. <!-- Label reminders Make sure to add the appropriate labels for the product stage and/or group (e.g ~"devops::plan") if known and add a comment tagging the appropriate Product Manager. Use the following resources to find the appropriate labels: - Use only one tier label choosing the lowest tier this is intended for - https://gitlab.com/gitlab-org/gitlab/-/labels - https://about.gitlab.com/handbook/product/categories/features/ Examples: /label ~group:: ~section:: ~Category: /label ~"GitLab Free" ~"GitLab Premium" ~"GitLab Ultimate" -->
issue