Allow overriding parts of Auto-DevOps-gitlab-ci.yml without overriding the whole thing
Problem
At the moment a user needs to override all or nothing for Auto DevOps configuration in .gitlab-ci.yml
. This is good for flexibility but one problem is that as soon as a user forks from our configuration they no longer get the benefits of new features we implement. Also this may lead to incompatibility with GitLab in future if their customisations make assumptions that we choose to no longer maintain in future. It would be nice if there was a middle ground where they could override just part of the configuration. And with our existing include
feature we're very close to being able to support this.
Possible Solution
If we have https://gitlab.com/gitlab-org/gitlab-ce/issues/52680 then we should be able to add the following to our auto devops template:
include:
path: '/Auto-DevOps-overrides.yml'
ignore_if_missing: true
merge_after: true
deep_merge: false
This will mean that users can then just trivially override a single part of the CI. For example when herokuish doesn't support your test suite or just doesn't work for some reason you can just create Auto-DevOps-overrides.yml
in your project like:
test:
image: ruby:2.4
script:
- bundle install
- bundle exec cucumber
- bundle exec rspec
BONUS: since this is not using herokuish it will be much faster and allow caching things like gems, npm packages. It will also allow you to make use of any CI feature you want for this step.