Hello,
In the schema for product-build, there is a description for the id field that says:
id
ID of the product meaning the sha256 digest of the sorted ids of the `artifacts` list. An immutable constructed id is used to ensure results can be tracked to their subject.
So far so good.
However, later the artifacts list is defined as:
artifacts
List of child artifacts, from which this product consists. It is required, but can be an empty list.
if the artifacts list is empty, the sha256 id of the product build will be always the same and thus not unique for different products/builds. So using the id to track it back to the original subject won't work (?)
Or am I missing something here?
Thanks!
Ok, I found this merged pull-request which discusses exactly this. It looks like this was intentional.
Hmm...
@ralph Hi Ralph, git-blame points to you here.
git-blame
I am trying to understand how this is supposed to work in practice.
Let's say I have a product-scenario where I test 2 product-builds. The first one is RHEL, and the second is let's say Ansible Tower.
How should the artifacts list look like for these 2 product-builds?
@msrb good point with the no artifacts :) I guess no good solution here, I see 2 options:
I would opt for 1. @Ralph what was the use case for empty artifacts?
I see that there is also nvrfield in the schema. I guess it can be used to identify the test subject even if the artifacts list is empty.
nvr
@mvadkert @msrb
Actual idea of getting artifact.id value when the artifacts list is empty is that you actually get sha256sum of empty string ('') which would end up in this string:
"id": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
Use case for empty artifacts would be cases where something goes wrong and artifacts are not produced, for example, my build produces artifacts (jars) but is broken and so I cannot really came up with forged artifacts, empty list is the result and product-build object will be part of build.error. That could be example..
I guess nvr would also be an option instead of empty artifacts...