BURs: add processing and failed states.

When a BUR is approved, put it in a `processing` state. After it
successfully finishes processing, put it in the `approved` state. If it
fails processing, put it in the `failed` state.

If approving the BUR fails with a validation error, for example because
the alias already exists or an implication lacks a wiki, then leave the
BUR in the `pending` state. The `failed` state is only for unexpected
errors during processing.
This commit is contained in:
evazion
2021-09-19 19:42:15 -05:00
parent 9ba84efc07
commit 21f0c2acc3
8 changed files with 85 additions and 20 deletions

View File

@@ -171,6 +171,11 @@ class BulkUpdateRequestProcessor
raise Error, "Unknown command: #{command}"
end
end
bulk_update_request.update!(status: "approved")
rescue StandardError
bulk_update_request.update!(status: "failed")
raise
end
# The list of tags in the script. Used for search BURs by tag.