repository-service-tuf / repository-service-tuf-worker

Repository Service for TUF: Worker
MIT License
8 stars 15 forks source link

Task: Improve the task result by making the `result` `message` and `error` simpler #454

Open kairoaraujo opened 4 months ago

kairoaraujo commented 4 months ago

What is the task about?

We can do the task result from the Worker better, see this discussion below.

Only mandate task results with message field for SUCCESS, ERROR, FAILURE state responses, and do not add them if they are missing in any of the other state responses. Consolidate message and error fields for ERROR and FAILURE. For ERROR the message could be a combination of what's currently in both fields, and error could be omitted. For FAILURE the message could be the exception message, and error could be omitted or show the exception type.

Source: https://github.com/repository-service-tuf/repository-service-tuf-api/pull/524#issuecomment-1923592533

The changes were made in the RSTUF API and require 'enforcement' in the RSTUF Worker.

Parent feature

No response

References

No response

Code of Conduct

KAUTH commented 2 months ago

@kairoaraujo For this task I think we should consider removing the error field in general (we can set it to None and gradually remove it from the other RSTUF component if it's being used or remove it at once now if it's not being used).

Since the idea is to merge the error and message fields, IMO it doesn't make sense to keep them both in their current format. If message was a human-readable error message (as it is now) and error was a single string value denoting the error type, then it would be logical to keep both fields. However, I think that would be a bigger change since we would need to standardize the error code strings.