buildkite / feedback

Got feedback? Please let us know!
https://buildkite.com
25 stars 24 forks source link

When an annotation is appended to, the markdown is not re-processed. #391

Closed petemounce closed 6 years ago

petemounce commented 6 years ago

Context: https://buildkite-community.slack.com/archives/C02T53V9H/p1525792493000374

Tried

Pipeline has several steps that run in parallel.

pre-command hook that does roughly:

echo "* some bullet point" >> annotation.md
cat annotation | buildkite-agent annotate --context build-logs --style info --append

Expected

Annotation gets appended to, creating a list with one rendered bullet per step, creating

* some bullet point
* some bullet point
* some bullet point

Actual

Annotation gets appended to, but markdown is not re-rendered inside web-UI, creating

* some bullet point*some bullet point*some bullet point

Notes

I tried echo -e, adding \n at beginning/end of echo commands - no difference in outcome.

Agent 3.1.1

ticky commented 6 years ago

Hmm, it looks like Markdown is indeed processed, however, the Buildkite Agent trims whitespace, and when appending we do not put line break in between, meaning it’s impossible to put a line break in between annotation chunks.

I’ll look into what we can do to fix this. :)

petemounce commented 6 years ago

Would it be reasonable to read STDIN via bufio's line reader instead of ioutil?

keithpitt commented 6 years ago

I think I'd be just OK with removing the whitespace trimming from the agent altogether! It probably does more harm than good (and this is a good example). I'd happily accept a PR @petemounce :)

petemounce commented 6 years ago

Pretty sure this is fixed via buildkite/agent#766.

ngocpea commented 2 years ago

Not sure if right place, but i noticed this issue is still present when using --append.