iver-wharf / wharf-api

Wharf backend written in Go
MIT License
1 stars 0 forks source link

Replace `Build.IsInvalid` with `Failed` status #169

Open applejag opened 2 years ago

applejag commented 2 years ago

We have duplication of ways to represent a similar process.

A while ago we introduced Build.IsInvalid to be used when a build fails to start but has already been created in the database, such as if the Jenkins call fails.

Suggest instead to only use the Failed build status. Migration could be done easily by a single SQL query of something like:

UPDATE build SET status=3 WHERE isInvalid=1

And then drop the isInvalid column

We could introduce a FailedStatus column that is a free-text field of why it failed, and then we could use that to show to the user the reason for it failing (when we know the cause, such as connection refused on contacting Jenkins).

applejag commented 2 years ago

Moved the issue. I think I accedentially created it in the wharf-cmd repo

Alexamakans commented 2 years ago

Suggest maybe FailedReason instead of FailedStatus