Refactor common dependencies into their own library
Overview
In gitlab-com/runbooks!4735 (merged) and gitlab-com/runbooks!4750 (merged) we've added a downstream dependency on patroni. This created duplication ex1, ex2.
Proposal
Extract this into a common library so that we can reuse it. There was a PoC on this in gitlab-com/runbooks!4780 (closed) which implemented this in a different way but didn't work out and it's not what we wanted.
Results
In gitlab-com/runbooks!4804 (merged) we've extracted the common dependencies in it's own library and now can use it like below:
local dependOnPatroni = import 'inhibit-rules/depend_on_patroni.libsonnet';
metricsCatalog.serviceDefinition({
type: 'web',
serviceLevelIndicators: {
workhorse: {
dependsOn: dependOnPatroni.sql_components,
},
},
})
Edited by Steve Xuereb