You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task interface methods in repository.py return TaskResult. Repetitive literal definition of these objects (their attributes), together with a multi return pattern, clutter the code.
Existing remedies -- thin helper wrappers that generalise some common fields (see _task_result, _result) -- are not very effective.
Possible improvements:
Use single return pattern in interface methods, where the task result is constructed only once at the end of the method, e.g. based on state variables assigned in previous check clauses, or based on exceptions raised in subroutines. (related: don't construct task results in subroutines)
Define TaskResult subclasses with fixed values for re-occurring attributes.
Overall goal:
Better distinguish TUF routines from RSTUF service logic. Important to assess correctness and thus security critical!
References
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
What do you want to share with us?
Task interface methods in repository.py return
TaskResult
. Repetitive literal definition of these objects (their attributes), together with a multi return pattern, clutter the code.E.g.:
repository-service-tuf-worker/repository_service_tuf_worker/repository.py
Lines 564 to 650 in 6cc2877
Existing remedies -- thin helper wrappers that generalise some common fields (see
_task_result
,_result
) -- are not very effective.Possible improvements:
Use single return pattern in interface methods, where the task result is constructed only once at the end of the method, e.g. based on state variables assigned in previous check clauses, or based on exceptions raised in subroutines. (related: don't construct task results in subroutines)
Define TaskResult subclasses with fixed values for re-occurring attributes.
Overall goal:
Better distinguish TUF routines from RSTUF service logic. Important to assess correctness and thus security critical!
References
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: