The recentCommitComments method on GitLabRepository is a big hack to overcome shortcomings in the GitLab APIs that has caused trouble for us at several occasions. I have now discovered another flaw in the implementation.
The sub method `getCommitTitleToCommitsMap` is used to build a map of commit messages to a list of commits. On first call, it builds the bulk of the map from a local repository. This is then kept up to date by calling the rest endpoint "GET /projects/:id/repository/commits" using the `since` argument to get all commits created after the newest commit already present in the map. The problem is that this API point will only return commits on the default branch. This means that after a bot restart, any new commits on other branches will not be found when looking for commit commands.
The sub method `getCommitTitleToCommitsMap` is used to build a map of commit messages to a list of commits. On first call, it builds the bulk of the map from a local repository. This is then kept up to date by calling the rest endpoint "GET /projects/:id/repository/commits" using the `since` argument to get all commits created after the newest commit already present in the map. The problem is that this API point will only return commits on the default branch. This means that after a bot restart, any new commits on other branches will not be found when looking for commit commands.