Add chatops command to check if MR is going to be included in next monthly release
The goal here is to allow developers to be able to check if an MR is going to be included in the upcoming SM release. Developers should be able to do this check any time during the release cycle.
Proposal
/chatops run release check <MR URL> <release version (optional)>
@mayra-cabrera suggested the following:
- Before the creation of the stable branch, we just check if the SHA is deployed to production
- After the creation of the stable branch, we verify if the SHA is included in the branch
We should also mention in the documentation that it is possible for us to decide to release an older SHA if newly deployed ones are not stable enough.
We can mention this command in the candidate commit
and final commit
messages that get posted to Slack.
Implementation
/chatops run release check <MR URL> <release version (optional)>
The command uses the following steps to check the status of an MR:
-
The command checks if the MR has already been released in a past release. If it has been released, the command will print the version in which the MR was first released. Since releases are incremental, all versions after that will also contain the MR. If a version was not specified in the command, the command will terminate here.
-
If the MR has not yet been released, it will check if the stable branch has been created for the given release version, and if the MR has been included in the stable branch.
-
If the stable branch has been created and the MR has been included in it, the MR will be released in the given release version.
-
If the stable branch has been created, but the MR has not been included in it, the MR will not be released in the given release version.
-
-
If the stable branch has not yet been created, it will check if the MR has been deployed to production. If the MR has been deployed to production, it is highly likely that the MR will be included in the stable branch whenever it is created. An MR that has not been deployed to production cannot be included in the monthly release.
Situation | Message | |
---|---|---|
1 | MR URL not supplied to command | You must specify a merge request URL and an optional self-managed release version. Ex: release check https://gitlab.com/gitlab-org/gitlab/-/merge_requests/12345 or release check https://gitlab.com/gitlab-org/gitlab/-/merge_requests/12345 14.2
|
2 | Invalid version string | 14.2.2 is not a valid monthly release version. Monthly release versions look like 10.0 or 14.2. |
3 | Invalid MR URL | 12345 is not a valid merge request URL. |
4 | MR from invalid project | Only merge requests from ["gitlab-org/gitlab", "gitlab-org/security/gitlab"] are currently supported. |
5 | MR does not exist |
gitlab-org/gitlab!12345 does not exist. |
6 | MR not merged |
gitlab-org/gitlab!12345 has not been merged as yet! |
7 | MR commit already released/chatops run release check 12345 14.0
|
gitlab-org/gitlab!12345 was first released in 14.0. |
8 | MR commit not released yet, and the upcoming version was not specified in command |
gitlab-org/gitlab!12345 was not released in any past version. Try checking with the upcoming release version. Ex: release check <MR URL> 14.2
|
9 | MR commit present in stable branch |
gitlab-org/gitlab!12345 has been included in the stable branch. This MR will be released in 14.2. |
10 | MR commit not present in stable branch |
gitlab-org/gitlab!12345 has not been included in the stable branch. The MR will not be released in 14.2. |
11 | Stable branch doesn't exist and MR commit has been deployed to gprd/chatops run release check 12345 14.3
|
gitlab-org/gitlab!12345 has been deployed to gprd. It will most likely be included in release 14.3. |
12 | Stable branch doesn't exist and MR commit has not been deployed to gprd |
gitlab-org/gitlab!12345 has not yet been deployed to gprd. It cannot be included in the monthly release until it is deployed to gprd. |