Jobs Overhaul: Refactor JobResult.result
to JSONField
from TextField
#3229
Closed
Labels
type: housekeeping
Changes to the application which do not directly impact the end user
Milestone
Revisit
JobResult.result
which is where the Celery task result is stored (different than theJobResult.data
field which is used by Jobs for results). Would be best to attempt to marry the two.This field is currently unused for Jobs, but we should coerce it to a
JSONField
and set a contract that anything returned from a Job task MUST be JSON. In DCR core it is expected to be encoded/decoded usingcontent_type
andcontent_encoding
which we have # eliminated for our implmentation.Identify a pattern for how the "result" of a Job's Celery task can be returned so that it can be stored on
JobResult.result
and therefore also handed off to other subtasks for more advanced workflows. See:run_job()
return value in PR #3164.To implement this we could just rename the
data
field onJobResult
toresult
instead of adding a new field and doing data migration:https://github.com/nautobot/nautobot/blob/next/nautobot/extras/migrations/0066_jobresult__add_celery_fields.py#LL51-L55C11
Care should be taken to assure that the result serialization will need to be handled to know that it is not being dumped into a TextFied.
The text was updated successfully, but these errors were encountered: