Size constraint on YAML file? Error "yaml: missing kind attribute"

Hi,

I’m having trouble running a pipeline that’s generated with starlark.
If necessary, I can share the pipeline in its entirety, but I’ll keep it short for now.

The pipeline does pretty much this:

packages = ['a', 'b', 'c', ... 'zzzz' ]

def main(ctx):
  return {
    'kind': 'pipeline',
    'type': 'kubernetes',
    'name': 'default',
    'steps': [ build(i) for i in ctx.input.packages ]
  }

def build(package):
  return {
    'name': 'build-%s' % package,
    'image': 'arch-builder:master',
    'commands': [
      '''
      do_build %s
      ''' % package
    ],
  }

It works as it should - as long as there are only a few items in the packages array. Having ~65 items present, drone refuses to start a build, it yields a parse error on the YAML file:

{"commit":"5179c75b0e98677fcb5229213775e62496446774","error":"yaml: missing kind attribute","event":"push","level":"warning","msg":"trigger: cannot parse yaml","ref":"refs/heads/master","repo":"Arch/aur-builds","time":"2022-09-17T22:30:33Z"}

If I use the drone client to generate a .drone.yml, everything seems fine. drone lint doesn’t complain, yamllint neither - apart from line lengths. The resulting file has about 76K.

I’m stumped what’s the issue here, the message above is the only thing that’s present in the logs connected to this, with trace logging enabled.

Drone version: drone/drone:2.12.1

Hi @fuero ,You can use a generic yaml validation tool to see you have written a yaml file that cannot be parsed:
http://yaml-online-parser.appspot.com/ .

@Krishika_Singh
As mentioned, I’ve verified the YAML file I generated with drone starlark with yamllint and drone lint - both parse it without error.

Hello @fuero

You could certainly have found a bug. Can you give us the file size in bytes if the converted yaml when you start to see this behavior? Thanks

I checked file sizes in bytes from 2 build attempts:

24521 - working
74718 - not working.