Geo: Support custom hooks
<!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION --> *This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.* <!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION --> ### Summary (for the Release Post; describes potential future state) GitLab Geo now replicates [server-side Git Hooks](https://docs.gitlab.com/ee/administration/custom_hooks.html) to all **secondaries**. Even though all push operations happen on the **primary** node, this ensures that in the case of a planned fail-over Git Hook data is preserved and no data will be lost. ### Problem to solve All customer data that is relevant to the customer's workflow should be replicated via Geo; however, this is not yet the case. We [are working towards this state](https://gitlab.com/groups/gitlab-org/-/epics/893). <!-- What problem do we solve? --> GitLab [supports server-side Git Hooks](https://docs.gitlab.com/ee/administration/custom_hooks.html), which allows certain scripts to be run automatically on the server. Even though Git Hooks are only active on the **primary**, where all push operations are received, Git Hooks are important customer data that should be synced to *secondaries**. This is not the case right now and means that when a **secondary** is promoted to a **primary** because of a fail-over the Git Hooks will be lost. ### Intended users <!-- Who will use this feature? If known, include any of the following: types of users (e.g. Developer), personas, or specific company roles (e.g. Release Manager). It's okay to write "Unknown" and fill this field in later. Personas can be found at https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas/ --> - Systems administrators ### Proposal <!-- How are we going to solve the problem? Try to include the user journey! https://about.gitlab.com/handbook/journeys/#user-journey --> * Customers can add [Git Hooks to their repositories](https://docs.gitlab.com/ee/administration/custom_hooks.html) * Git Hook data is replicated (and verified) to all secondaries * When a **secondary** is promoted to a **primary** the replicated Git Hook data should be usable automatically ### Further details - Hooks are standalone files that are not under version control. We would need Gitaly support to access them. - What content is present in Git Hooks? Is it context dependent? There was a bit of communication on this topic on [Slack](https://gitlab.slack.com/archives/C32LCGC1H/p1548360976306200). ### Permissions and Security <!-- What permissions are required to perform the described actions? Are they consistent with the existing permissions as documented for users, groups, and projects as appropriate? Is the proposed behavior consistent between the UI, API, and other access methods (e.g. email replies)? --> N/A ### Documentation <!-- See the Feature Change Documentation Workflow https://docs.gitlab.com/ee/development/documentation/feature-change-workflow.html Add all known Documentation Requirements here, per https://docs.gitlab.com/ee/development/documentation/feature-change-workflow.html#documentation-requirements --> * Remove note from https://docs.gitlab.com/ee/administration/custom_hooks.html ### Testing <!-- What risks does this change pose? How might it affect the quality of the product? What additional test coverage or changes to tests will be needed? Will it require cross-browser testing? See the test engineering process for further guidelines: https://about.gitlab.com/handbook/engineering/quality/guidelines/test-engineering/ --> N/A ### What does success look like, and how can we measure that? <!-- Define both the success metrics and acceptance criteria. Note that success metrics indicate the desired business outcomes, while acceptance criteria indicate when the solution is working correctly. If there is no way to measure success, link to an issue that will implement a way to measure this. --> * Hooks are synced from the **primary** to all **secondaries**. ### What is the type of buyer? <!-- Which leads to: in which enterprise tier should this feature go? See https://about.gitlab.com/handbook/product/pricing/#four-tiers --> * Premium ### Links / references
epic