feat: enabled multiple metrics per ref #934
Open
+375
−39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
We have pipelines running on the same git ref but with different settings in variables.
Before this change here we had the problem that we were missing metrics for some of these runs.
What changed
We generalized how pipelines are cached using the
Store
instead of theLastPipeline
on theRef
object.Furthermore, we used variables (if configured) for deciding if a new metric needs to be created or not.
We have tried this approach and can confirm that this now solves the issue we had before.
Backwards compatibility
The new behavior is backwards compatible. In the
pipelines
section of apull
section in the config there's a new keyper_ref
that you can use to set how many most recent pipelines you want to fetch per ref. The default is set to 1 which should result in the same behavior as before this change. That means that existing users will not be affected by this and have to actively configure this behavior.