The default value for rules:changes:compare_to
Problem to solve
rules:changes:compare_to
introduced in 15.3 is an awesome feature but it's not clear from the docs what is the default value for it. The warning label at the rules:changes
kind of imply that it's effectively HEAD~
but I'd prefer it being stated explicitly, something akin what is done in rules:changes:paths
.
If the default is indeed HEAD~
I'd suggest changing it to $CI_DEFAULT_BRANCH
but that's a separate issue.
Proposal
So the documentation regarding rules:changes:compare_to
could read like this:
docker-build-1:
script: docker build -t my-image:$CI_COMMIT_REF_SLUG .
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- Dockerfile
docker-build-2:
script: docker build -t my-image:$CI_COMMIT_REF_SLUG .
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
paths:
- Dockerfile
compare_to: HEAD~
In this example, both jobs have the same behavior.
Who can address the issue
Someone who actually knows what the default to compare_to
is.