Clean up default branch stubbing in CI template tests
In !53280 (merged), we updated Auto Deploy to deploy from the default branch instead of hardcoded master.
There were two outstanding things to address post-merge:
-
Updating the specs in spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb. It indirectly uses Jobs/Deploy/ECS.gitlab-ci.yml
, so the new default branch behavior should be explicitly tested. -
Fixing the default branch stubbing to be more robust, see this discussion !53280 (comment 501540080). In that MR, we only fixed it for auto_devops_gitlab_ci_yaml_spec.rb
. The problem with stubbing the method is that the underlying repository does not receive the correct ref, and this is hard to debug.
Edited by Hordur Freyr Yngvason