Kiwi

Kiwi for Bitbucket Pipelines

Report check results from Bitbucket Pipelines to a run's Verify step with a checker key.

  • Posts named check results over HTTP with a checker key. The key can report only the checks you choose in one project.
  • Checks reserved for CI accept results only from a checker key.
  • Records each result against the candidate under review. A pass counts toward Verify; a fail means the run needs rework.
  • Records a retried report once.
  • Kiwi does not start pipelines or read their logs. It records the results your pipeline sends.

Set up

Store your checker key as a secured repository variable named KIWI_CHECKER_KEY and add report-kiwi-check.sh from the setup guide to your repository.

This bitbucket-pipelines.yml runs your tests, then reports the tests-pass check as pass or fail:

image: node:22-bookworm

pipelines:
  custom:
    kiwi:
      - variables:
          - name: KIWI_RUN_ID
            description: Kiwi run ID
      - step:
          name: Test
          script:
            - npm ci && npm test
          after-script:
            - |
              apt-get update && apt-get install -y --no-install-recommends jq uuid-runtime
              if [ "$BITBUCKET_EXIT_CODE" = 0 ]; then status=pass; else status=fail; fi
              ./report-kiwi-check.sh tests-pass "$status" "https://bitbucket.org/$BITBUCKET_REPO_FULL_NAME/pipelines/results/$BITBUCKET_BUILD_NUMBER"

Run the kiwi custom pipeline with the Kiwi run ID. The report runs in after-script, so a failed report does not change the step's result.

Replace tests-pass with the check ID from your plan.