A way to remove annotations from a build

Being able to completely clear a specific annotation from a build (perhaps by context) would be useful. Currently, I can:

  • update the body of the annotation to be almost empty (but not completely due to validation)
  • change the status of the annotation (by providing no body to the CLI command)

But I can’t completely get rid of the annotation box, it seems.

steps:
  - commands:
      - echo "hello" | buildkite-agent annotate --context foo
      - echo -n "" | buildkite-agent annotate --style default --context foo # works, but only changes style, not body
      - echo "" | buildkite-agent annotate --context foo || echo "fails with An annotation body is required"
      - echo -n " " | buildkite-agent annotate --context foo || echo "fails with An annotation body is required"
      - echo -n "&nbsp;" | buildkite-agent annotate --context foo # <- works, but leaves annotation in place

Having a buildkite-agent annotate --context foo --clear would be fantastic.

An example of when I want to remove an annotation is: I’m annotating planned Terraform changes on a build, but someone else applies them, so on a step-retry the changes disappeared. I’d prefer to remove the annotation, but currently I have to leave it and rewrite it to say “(deleted)”, basically.

Hi @dominics, that’s a good idea! I’ll see what we can do.