When a new .config is imported some values may change, but the
corresponding note is not always updated to reflect the new value.
This is wrong and it can lead to errors and incorrect information in the
annotations file.
To prevent this from happening automatically add a TODO note when any
config with a note is changing to force the reviewer to update the note.
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
val = "-"
if conf in self.config:
if "policy" in self.config[conf]:
+ # Add a TODO if a config with a note is changing and print
+ # a warning
+ old_val = self.search_config(config=conf, arch=arch, flavour=flavour)
+ if old_val:
+ old_val = old_val[conf]
+ if val != old_val and "note" in self.config[conf]:
+ self.config[conf]['note'] = "TODO: update note"
+ print(f"WARNING: {conf} changed from {old_val} to {val}, updating note")
self.config[conf]["policy"][flavour] = val
else:
self.config[conf]["policy"] = {flavour: val}