Group hash describing state of all repos within a group
Merge requests across multiple projects will allow organizations that have related projects that need to be changed in sync to do so with a single merge request https://gitlab.com/gitlab-org/gitlab-ce/issues/36273. The change may only touch a subset of the projects in the group, but the CI process will ensure that every project in the group integrates correctly at that change. If a regression is identified and fixed, the organization needs a way to be able to walk back through every state of the group - that is the unique combination of all states of the project.
To do this, each state of the group needs a unique ID that describes the state of every project in the group. The ID might be calculated as the SHA of the concatenation of each SHA in the project. This isn't inherently orderable which means we will need to provide additional information.
Proposal
- Calculate a unique ID for every state of the group
- Concatenate the SHA of the HEAD of the default branch of every project in the group in alphabetical order. This means that ordering can be calculated from on the commit SHAs which will not change unlike project names which could change and therefor change ordering.
- Provide a group level hook that is triggered every time a new group hash is created. This should contain sufficient information for the CI environment to integrate every project in the group (list all projects and hashes used to calculate the group has)
Questions:
- How do we provide a find each state between two states?
- How do we calculate a Group ID for commits on branches? Prior to a merge request being created a change across multiple projects will exist as multiple unrelated branches?
- How do we handle projects being removed from a group? If a project is removed the group sha will become unreachable.