italia/publiccode-parser-go

Crawler panic on empty list

Closed this issue · 3 comments

I believe the crawler does not correctly handle the case when a list is empty, see this example o publiccode:

https://github.com/aziendazero/ecm/blob/bdbe58c3553c497b045410067e16e6b3e348c204/publiccode.yml#L18-L23

which has this behaviour:

panic: key "dependsOn/open" is empty. Remove it or fill with valid values

goroutine 1 [running]:
github.com/italia/publiccode-parser-go.(*Parser).decoderec(0xc000512380, 0xc000658ab0, 0x9, 0xc0006607b0, 0xc000660cf0, 0x3, 0x3)
        /Users/libremente/go/src/github.com/italia/publiccode-parser-go/parser.go:165 +0x13dc
github.com/italia/publiccode-parser-go.(*Parser).decoderec(0xc000512380, 0x0, 0x0, 0xc000660720, 0x0, 0xc0006ec0e0, 0x8ae)
        /Users/libremente/go/src/github.com/italia/publiccode-parser-go/parser.go:160 +0xec3
github.com/italia/publiccode-parser-go.(*Parser).Parse(0xc000512380, 0xc000718000, 0x8ae, 0xe00, 0x8ae, 0xe00)
        /Users/libremente/go/src/github.com/italia/publiccode-parser-go/parser.go:52 +0x229
github.com/italia/publiccode-parser-go.(*Parser).ParseRemoteFile(0xc000512380, 0xc0006820c0, 0x47, 0x0, 0x0)
        /Users/libremente/go/src/github.com/italia/publiccode-parser-go/parser.go:85 +0x135
main.main()
        /Users/libremente/go/src/github.com/italia/publiccode-parser-go/pcvalidate/pcvalidate.go:46 +0x6e9

@sebbalex OT question: what does the issueopener do in this case (crawler panicking)?

@libremente it needs to be analyzed, by the way, issueopener starts at the end of the workflow when all validation errors are collected and logged. This panic seems caused still in working routine phase. My first guess is that IO will not be called at all.

This is publiccode-parser-go project related issue, I move to correct repo.