fuero
(fuero)
October 24, 2022, 12:35pm
1
I asked that this post be moved here, please see it for details about this bug and continue discussion here.
In short:
A starlak based pipeline is readily accepted by the drone cli binary (using drone starlark
) and verified with drone lint
, but upon submission to drone CI it crashes with a parsing error:
yaml: missing kind attribute
Making the pipeline smaller (reducing the amount of steps) makes it pass without issue.
Hi @fuero , can you send the yaml file?
Thanks!
fuero
(fuero)
October 24, 2022, 2:01pm
3
Here you go:
https://file.io/iHtEJn5UO1xU
.drone.yml
77.26 KB
@fuero downloaded yaml looks unorganised. Can you send it to me the other way around?
Thanks!
@fuero in the meantime can you check this link too see if Drone CLI generates the Drone YAML from Starlark and then check in the resulting file.
Do let me know if you still see this issue.
Thanks!
fuero
(fuero)
October 29, 2022, 10:38pm
6
Here’s the file generated by drone starlark --format
https://file.io/GG0WhS1nkg58
Hi @fuero I suggest submitting a bug here: Issues · harness/drone · GitHub along with the file you shared.
Thanks!
fuero
(fuero)
November 1, 2022, 10:41pm
8
Again, as I mentioned this in the previous thread.
Opening an issue @ github.com yields this instruction:
Bugs or Issues? Please create a new topic in our Discourse forum.
We are migrating all Drone repositories to Discourse for bug tracking.
New GitHub issues may be automatically deleted.
Which is what I did. You are sending mixed messages here.
fuero
(fuero)
November 1, 2022, 10:56pm
9
I’ve created a Github issue, as requested. I hope it doesn’t get deleted.
opened 10:52PM - 01 Nov 22 UTC
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:
```python
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 60K.
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.
See:
https://discuss.harness.io/t/size-constraint-on-yaml-file-error-yaml-missing-kind-attribute/12521/13
https://discuss.harness.io/t/drone-yaml-parser-apparantly-chockes-on-too-large-yaml-pipeline/12677/2
Find the files (the starlak file and the resulting yml file generated by `drone starlark --format`) in question here:
[files.zip](https://github.com/harness/drone/files/9914428/files.zip)
Hi @fuero generally, none of the GitHub issues gets deleted. Thanks for reporting the bug. We will look into it and get back to you.
Thanks!