Skip to content

add -v to sg lint when sg lint step is retried

Warren Gifford requested to merge devx/wbezuide/sg-lint-buildkite-retry into main

Created by: burmudar

Buildkite exposes an environment variable that counts how many times a step has been retried namely BUILDKITE_RETRY_COUNT. If retry_count > 0 then we add -v to sg lint

Closes #35887 (closed)

Test plan

Generated the pipeline with BUILDKITE_RETRY_COUNT

Without env var

$ go run ./enterprise/dev/ci/gen-pipeline.go | grep "sg lint" -A 4
          "label": ":pineapple::lint-roller: Run sg lint",
          "key": "pineapplelintrollerRunsglint",
          "command": [
            "./an \"./tr go run ./dev/sg lint -annotations go\""
          ],
          "timeout_in_minutes": "60",
          "env": {
            "ANNOTATE_OPTS": "true -t error",

With BUILDKITE_RETRY_COUNT = 0

$ BUILDKITE_RETRY_COUNT=0 go run ./enterprise/dev/ci/gen-pipeline.go | grep "sg lint" -A 4
          "label": ":pineapple::lint-roller: Run sg lint",
          "key": "pineapplelintrollerRunsglint",
          "command": [
            "./an \"./tr go run ./dev/sg lint -annotations go\""
          ],
          "timeout_in_minutes": "60",
          "env": {
            "ANNOTATE_OPTS": "true -t error",

With BUILDKITE_RETRY_COUNT=1

$ BUILDKITE_RETRY_COUNT=0 go run ./enterprise/dev/ci/gen-pipeline.go | grep "sg lint" -A 4
          "label": ":pineapple::lint-roller: Run sg lint",
          "key": "pineapplelintrollerRunsglint",
          "command": [
            "./an \"./tr go run ./dev/sg lint -annotations -v go\""
          ],
          "timeout_in_minutes": "60",
          "env": {
            "ANNOTATE_OPTS": "true -t error",

Merge request reports

Loading