Remove git requirement for worker & worker versions
Refs https://redmine.teklia.com/issues/4471
As we want to move away from Git integrations into Arkindex and allow users to easily manage their own worker / worker versions / worker runs, we need to remove the requirement for:
- Repository on Worker
- Revision on WorkerVersion
This means making a DB migration that sets these fields as nullable, and supporting this change across endpoints (making the related field nullable). Especially:
RetrieveWorker
ListWorkers
ListWorkerVersions
RetrieveWorkerVersion
The creation endpoints CreateWorker
& CreateWorkerVersion
are extremely specific and should not be updated for now (We'll surely create new endpoints to create "local" worker runs & versions).
A check must be implemented on CreateWorkerVersion
UpdateWorkerVersion
so that a worker version is either:
- with a revision when its worker has a repo (and that revision must belong to the repo)
- without a revision when its worker as no repo set
In addition to these changes, we will need a new field WorkerVersion.version
(positive integer field) to actually make them versionable (and sortable) when a Revision is not set. As there is no way to create a worker version without a revision for now, it will only be set by default to null, then later set manually by endpoints. Please add it to existing read serializers though.
Finally, we need the usual created/updated automated fields on WorkerVersion
, as that information is currently provided by Revision
.
Ideally the data migration will set the initial values of these fields to the ones from Revision