osbuild icon indicating copy to clipboard operation
osbuild copied to clipboard

pipelines in a result from v2 manifests are not ordered

Open ondrejbudai opened this issue 3 years ago • 5 comments

Pipelines in v2 manifest are stored in an array:

{
  "pipelines": [
    {
      "name": "asdf"
    },
    {
      "name": "ghjk"
    },
  ]
}

Whereas in the result, they are a dictionary:

{
  "log": {
    "asdf": [
      {
        "type": "org.osbuild.rpm"
      }
    ],
    "ghjk": [
    ]
  }
}

In my opinion, we shouldn't rely on the ordering of keys in the result and just use an array as we do in the manifest. Not all json parsers keep the ordering, for example Go doesn't: https://github.com/golang/go/issues/27179

ondrejbudai avatar Mar 25 '21 06:03 ondrejbudai

Thought from more caffeinated Ondřej: If the input if ordered, the output should be also ordered. :)

ondrejbudai avatar Mar 25 '21 09:03 ondrejbudai

While I 100% agree with all that and this is just a bug, I think "log" should be completely removed from the results ;)

gicmo avatar Apr 13 '21 15:04 gicmo

@ondrejbudai I think it's safe to close this issue. If we ever change the way logs are returned in the manifest, I think that should be done with @achilleas-k idea: https://github.com/osbuild/osbuild/issues/837

lavocatt avatar Feb 07 '23 14:02 lavocatt

Did we change anything about results and logs recently? Isn't this still an issue?

achilleas-k avatar Feb 07 '23 14:02 achilleas-k

Did we change anything about results and logs recently? Isn't this still an issue?

I don't think we changed anything, so yes it's still an issue, I was too eager to close it. I'm reopening.

lavocatt avatar Feb 08 '23 08:02 lavocatt