purescript / registry-dev

Development work related to the PureScript Registry
https://github.com/purescript/registry
95 stars 80 forks source link

Package set compilation failures should notify users of what failed #647

Closed thomashoneyman closed 11 months ago

thomashoneyman commented 1 year ago

Currently when a user issues a manual package set update and it fails because of compilation errors we simply send back a message to that effect. See:

https://github.com/purescript/registry/issues/331#issuecomment-1661022201

This isn't helpful because you have no idea what failed without digging through the 'actions' tab to find the relevant job, and then scrolling down to the end of the logs. We already have the compilation failures available — we should send them to the user.

Right now a package set update returns Nothing if it failed, and so we just send back a comment:

https://github.com/purescript/registry-dev/blob/8177cd30d7b7cf3379b8b728564def0ed438298c/app/src/App/API.purs#L219-L221

But there's no reason we couldn't return a Left instead; we've got all the error information right there:

https://github.com/purescript/registry-dev/blob/8177cd30d7b7cf3379b8b728564def0ed438298c/app/src/App/Effect/PackageSets.purs#L116-L118

I think we should change this to return the error and then the pipeline can notify the user via a comment.