Make the "new project" and "edit project" pages extensible
Description
I'd like to have a way of adding custom input fields to the "new project" and "edit project" pages in GitLab. Right now, this is only possible by modifying the GitLab source and doing a custom build. In that case, code changes would need to be rebased each time a new version is released. Instead, I'd like the pages to be extensible so fields can be added to the UI without doing a custom build.
Note: In the proposed scenario, the inputs provided do not be be stored by the GitLab application. They just need to be available to listeners on the project creation and project modification hooks.
Proposal
- Allow a site admin to drop custom .haml files into a predefined folder. If the corresponding .haml file exists, the page would render it in a predefined location inside the HTML form.
- Add a hook that would allow for custom validation of the inputs. The validator must be capable of blocking creation or modification of the project. Any error message returned by the validator should be surfaced in the UI.
- Project creation and project modification hooks would include the custom properties in the webhook message to registered endpoints.
Links / references
Documentation blurb
Overview
This feature would allow site admins to easily add one or more input fields to the project creation and project modification forms in the GitLab UI. This would make it possible for site admins to track additional metadata about GitLab projects that isn't currently captured by the GitLab application.
Use cases
-
I manage a GitLab instance and I want everyone who is creating a project on my server to agree to certain terms and conditions. This feature would allow me to inject a checkbox and a link to my terms and conditions into the project creation UI. I could block users from creating projects if they don't agree to the terms.
-
I manage a GitLab instance and I need to associate GitLab projects with a cost center in my company for internal tracking / billing purposes. Users or groups may be working on multiple projects associated with different cost centers, so I can't determine this information based on the owner of the project. This feature would allow me to inject a dropdown where a user can select a cost center when a project is created or modified. I can use project creation and modification hooks to update records in a separate billing application.
Feature checklist
Make sure these are completed before closing the issue, with a link to the relevant commit.
-
Feature assurance -
Documentation -
Added to features.yml