Skip to content

Support unique identifiers in group outputs for GitLab CI job log section names #2806

@outofrange

Description

@outofrange

Description

GitLab CI support job log sections using markers like:

  • \e[0Ksection_start:UNIX_TIMESTAMP:SECTION_NAME\r\e[0KTEXT_OF_SECTION_HEADER
  • \e[0Ksection_end:UNIX_TIMESTAMP:SECTION_NAME\r\e[0K

The issue I'm facing is that I haven't found a suitable way for templating SECTION_NAME for the group start/end property:

  • a slugged variant of {{.TASK}} or {{.ALIAS}} isn't unique for repeated executions of the same task, resulting in duplicate identifiers
  • {{uuid}} would return different ids when evalauted for group start and end string

Maybe I overlooked an existing special var / function I can use for this?

A special variable like {{.TASK_EXEC_UUID}}, which would be unique for each individual execution of a task, should help for templating unique GitLab CI section names.

Metadata

Metadata

Assignees

Labels

area: templatingChanges related to the templating engine.
No fields configured for feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions