hermes icon indicating copy to clipboard operation
hermes copied to clipboard

Reverse precedence of configured harverster results during merge

Open jkelling opened this issue 2 years ago • 1 comments

At the moment successive merge steps belonging to successive harvester runs override previous values on pre-existing keys.

Harvesters are and their merge steps are executed in the order they are listed in the harvest section of the configuration, leading the last one to take precedence. This seems counter-intuitive, especially considering the current default/example hermes.toml: https://github.com/hermes-hmc/workflow/blob/05e4e530af77bd38810dd802c5c4f1b8249a8ca5/hermes.toml#L5-L6 where a value produce by the git harvester, which could only be a commit hash, would override a value read from a CFF file. #154 does not change this behavior apart from storing the previous value as an alternative.

The are two general ways to address this: either

  1. run the harvesters in reverse order, or
  2. invert the behavior the the merger to not touch existing values (and add new values as alternatives in #154 ).

Note, that the second option cannot left for the individual harvesters to implement, because

  1. this would make implementing a merge strategy mandatory for each harvester, to the detriment of the harvester developers, and
  2. would allow for inconsistent harvester precedence, to the detriment of the user.

jkelling avatar Apr 19 '23 14:04 jkelling

In principal, this behaviour could be easily implemented in the current code (at least to flip the precedence).

Do we want that already in Proof-of-Concept? We should definately re-consider it when discussing the breaking changes for Alpha.

led02 avatar May 08 '23 14:05 led02

The order is flipped so the first harvester source is the most important.

SKernchen avatar Nov 18 '24 07:11 SKernchen