Commit Graph

5 Commits

Author SHA1 Message Date
Sunny 1c4db83b08 Introduce ResultV2 for update results
ResultV2 update result contains Result (original), which provides
information in terms of files, objects and images, and also includes
file changes which provides information in terms of files, objects and
changes. The changes contain the old value, new value and the setter
that was involved in the update.
ResultV2 can be used to obtain detailed information about updates in
terms of the previous value and the new value, which could be beneficial
in commit messages to summarize the granular changes.

Signed-off-by: Sunny <github@darkowlzz.space>
2024-03-15 21:05:50 +05:30
Sunny ffbc825dcd
update pkg/test and pkg/update with testenv
Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-04-26 01:21:52 +05:30
Michael Bridgen 2eebaa46c7 Make the image policy name available to templates
Signed-off-by: Michael Bridgen <michael@weave.works>
2021-03-03 13:01:29 +00:00
Michael Bridgen df7d570ae5 Give details of template data in spec docs
This explains the data available to the commit message template in the
API guide. While writing it, I realised it could be made more
convenient, so:

 - mask external types by embedding them
 - make the most useful parts of an image ref available using a
   wrapper struct and interface

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-03-03 11:08:53 +00:00
Michael Bridgen 908f8b775c Supply values to the commit message template
This commit:

 - passes a value including the update result to the commit message
   template
 - gives the template result a method for enumerating the
   objects regardless of file

This means you can access the images updated either by file
(`.Files`), by object (`.Objects()`), or just as a list
(`.Images()`). The additional test case shows how to use these.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-03-01 22:25:25 +00:00