In the gitlab CI, I use the DOCKER_IMAGE variable to define a custom docker image in which the pipeline should run. In this image, I have already cloned all the code needed for the upstream workspace, but as there is currently no way of defining it as a path in this container, I have to write an additional .repos file that clones the code again under /root/upstream.
I would suggest that one could also define a path in the docker image that would then be either copied or symlinked to /root/upstream so that the upstream wouldn't need to be maintained at two places