Backend: Support UUID as fallback if parallel job name is too long
Summary
Long parallel job names cause errors when they exceed the maximum 255
(see #426781). In this issue, we propose to avoid this error by defaulting to an auto-generated UUID as the job name.
Further context:
Ref: #263401 (comment 1751415986)
I am sure we've discussed this but if we'll replace the job name with the UUID only in case we are crossing the char limit + provide our users with a tooltip with a short explanation (e.g. the job name is too long and was replaced by UUID), could be a quick turnaround for this issue, wdyt?
Ref: #263401 (comment 1756389137)
Just from a first glance, I think there may be a small complication in its integration with
needs:parallel:matrix
. The challenge with this approach is that the parallel job names cannot be regenerated exactly from the given matrix values, which our current process forneeds:parallel:matrix
relies on. But this is the same challenge we'd have to face in #285853, so I'm not sure how much faster UUID would be. In either case, we'd likely have to preserve a mapping of parallel job names (i.e.job name/UUID <==> variable values
).Having said that, I do like the idea of using UUID only if the job name is too long. It also wouldn't conflict with the proposal in #285853. The UUID could be the fallback if a custom name is not defined. So I think this could be a good idea to move forward with first.
Proposal
Support a UUID as the parallel job name only if it exceeds the limit. Follow the approach as described in the Summary and:
- Regenerate the UUID if it happens to not be unique for the pipeline.
- Ensure that the implementation works when the parallel jobs are needed.
For displaying purposes:
We can use a UUID as the unique parallel job name internally and then save the original/expanded job name in ci_builds_metadata
. Then we can update our API to output the expanded job name (if it exists) in the job_name
and tooltip
fields. The FE would display the job name and tooltip as it normally does since it doesn't have a character length limitation.
This means that the displayed job name could be very long, (and I think the FE automatically truncates it when viewing.) But the full job name can be viewed in the tooltip when hovering.