Skip to content

Allow worker contributors and anyone on public workers to start training

Erwan Rouchet requested to merge free-train-tickets into master

Closes #1359 (closed)

The query we were previously using was looking strictly for worker versions where the user had admin access on the worker or the repository, ignoring Worker.public. I switched the query to another existing property on a mixin to switch to contributors, and without really thinking about it, accidentally added Worker.public; now any worker version where the user has contributor access on the worker or on the repository, or where the worker is public, is allowed. I had implemented some nicer error handling to show a more user-friendly message when the user has access to the worker, but does not have enough access, and was trying to figure out why my tests were failing when I found this out.

After a discussion with Bastien, it turns out running training processes on public workers is a feature and not a bug. This made it so that the exact same property on the WorkerACLMixin is now used to look for workers to display in the frontend's worker version modal through ListWorkers, and to select a worker version in CreateTrainingProcess, making the special error message unnecessary.

Merge request reports

Loading