Skip to content

Fix inventory tag count when repository has no tags

João Pereira requested to merge fix-tag-count-inventory into master

Problem

When a repository has 0 tags, and the user requests the tag count, the inventory tool outputs no tagCount field (for JSON) or without value (CSV):

{"repositories":[{"group":"bar","path":"bar"},{"group":"foo","path":"foo","tagCount":2}]}
group,path,tagCount
bar,bar,
foo,foo,2

Solution

tagCount should always be present and set to 0 when there are no tags:

{"repositories":[{"group":"bar","path":"bar","tagCount":0},{"group":"foo","path":"foo","tagCount":2}]}
group,path,tagCount
bar,bar,0
foo,foo,2
Edited by João Pereira

Merge request reports

Loading