deployphp / deployer

The PHP deployment tool with support for popular frameworks out of the box
https://deployer.org
MIT License
10.56k stars 1.48k forks source link

Gitlab CI collapsible sections use unique section header name. #3787

Closed fliespl closed 5 months ago

fliespl commented 6 months ago

Currently script uses unix timestamp ($start) as both start time + section name (same goes for section_end - using $start).

This causes collision within multiple tasks running in the same second cause it's used by gitlab for grouping.

           $this->output->writeln("\e[0Ksection_start:{$start}:{$start}[collapsed=true]\r\e[0K{$task->getName()}");
           $this->output->writeln("\e[0Ksection_end:{$endTime}:{$start}\r\e[0K");

I think better solution is to use slug of task name:

           $this->output->writeln("\e[0Ksection_start:{$start}:{$slug}[collapsed=true]\r\e[0K{$task->getName()}");
           $this->output->writeln("\e[0Ksection_end:{$endTime}:{$slug}\r\e[0K");

or to be more "unique" - combination of task name slug + startTime:

           $this->output->writeln("\e[0Ksection_start:{$start}:{$slug}_{$start}[collapsed=true]\r\e[0K{$task->getName()}");
           $this->output->writeln("\e[0Ksection_end:{$endTime}:{$slug}_{$start}\r\e[0K");
mbrodala commented 6 months ago

Or make use of e.g. uniqid()

mbrodala commented 1 month ago

@antonmedv Can you make a new release with this change? I would like to test it but cannot apply it as patch since dep is a Phar in releases.

antonmedv commented 1 month ago

Will do a release.