1
0
mirror of https://github.com/go-task/task.git synced 2026-04-24 19:54:16 +02:00
Valentin Maerten b8abadb4f0 🐛 fix(output): wrap gitlab sections at task level (#2806)
Previously the gitlab output wrapped each command individually, causing
two visible bugs in real GitLab pipelines:

- every section displayed a duration of 00:00, because start and end
  markers were emitted microseconds apart for instant commands
- the `task: [NAME] CMD` announcement lines were rendered outside the
  sections, because Logger.Errf bypassed the cmd-level wrapper

Fix by wrapping output at the task level via a new optional
[output.TaskWrapper] interface that GitLab implements. Task-scoped
writers are threaded via ctx so nested `task:` invocations produce
properly nested sections (GitLab supports this natively), and deps
running in parallel each get their own buffer with mutex-protected
flushes into the parent's buffer.

- `internal/output/output.go`: add TaskWrapper interface
- `internal/output/gitlab.go`: logic moved from WrapWriter to WrapTask;
  WrapWriter becomes passthrough; sync.Mutex around the buffer for
  concurrent flushes from parallel sub-task sections
- `task_output.go` (new): ctx plumbing + helpers kept out of task.go
- `task.go`: 7 lines of surgical edits — name the lambda's error
  return, wrap before the cmd loop, defer the closer with the final
  error, and swap the cmd announcement to `printCmdAnnouncement` which
  writes into the task-scoped stderr
2026-04-22 17:22:54 +02:00
2025-09-23 22:34:43 +00:00
2025-05-01 18:43:43 +01:00
2025-04-19 12:55:22 +01:00
2026-04-20 21:53:50 +02:00
2024-09-02 19:21:53 +00:00
2024-08-14 08:37:05 -05:00
2025-09-11 10:26:59 +01:00

Task: The Modern Task Runner

A fast, cross-platform build tool inspired by Make, designed for modern workflows.

InstallationGetting StartedDocsTwitterBlueskyMastodonDiscord

Gold Sponsors

Community Sponsors

S
Description
A task runner / simpler Make alternative written in Go
https://taskfile.dev/ Readme MIT 39 MiB
Languages
Go 84%
Vue 4.9%
Shell 4.7%
TypeScript 4.4%
PowerShell 1.4%
Other 0.5%