This problem occurs on a self-hosted instance of GitLab Enterprise Edition (v14.7.2ee). All projects are set to "Internal".
Steps to reproduce:
- List all branches using the API
- Create a new branch using the API
- List all branches using the API
The new branch created in step 2 is missing unless we put a delay of about 30 seconds between step 2 and step 3.
However, if we do this instead:
- Create a new branch using the API
- List all branches using the API
we instantly see the new branch there.
The command to get all branches is: curl -s -k --header 'PRIVATE-TOKEN:xxx' 'https://gitlab.xxx.com/api/v4/projects/xx/repository/branches'
Does this mean GitLab is somehow caching branch list results or there is some configuration we need to apply in order to get the new branch instantly after creation?
The problem doesn't seem to be happening on another self-hosted instance of GitLab Community Edition v13.6.4 where all projects are set to "Public".
I am not sure if there is a fault in my setup or GitLab itself. Any help is greatly appreciated.