With Pipelines for Merge Requests feature, users cannout keep using
$CI_COMMIT_REF_NAME and _SLUG predefined variables for dynamic
environments. We fix this problem by explicitly looking at the source
ref.
This commits extract code responsible for calculating essential CI/CD
variables to a separate concern. This makes it possible to share this
code between a `Ci::Build` and a `Ci::Bridge`.
We might want to refactor this to use composition instead of
inheritance.
We extracted implementation of build/bridge metadata attributes to a
separate concern, because in EE `Ci::Bridge` also has metadata
attributes, and we want to build abstraction for storing values in build
metadata table.
This commit segregates interface that is require to make CI/CD entity
processable, like `Ci::Build`. With this change it is not clear and
explicit what methods need to be implement to pass an object to pipeline
processing service.