Catch attempts to compose a list

Attempting to compose a list property would result in an unhandled exception:

AttributeError: 'CommentedSeq' object has no attribute 'get'

We now at least detect the situation and produce an exception that the frontend will report neatly:

Error loading pipeline: element.bst [line 11 column 4]: Only values of type 'dict' can be composed.

I was getting this error from an attempt to conditionally extend the sources list:

sources:
  (?):
    arch == "x86_64":
      - url: http://example.com/x86_64

The correct way to do this is to move the conditional into the parent dict, e.g.:

(?):
  arch == "x86_64":
    sources:
      - url: https://example.com/x86_64

It would be nice if the error message could hint at how the user can do what they want, but it doesn't seem possible in this case.

Edited by Sam Thursfield

Merge request reports

Loading