Skip to content

buildnote.json ​

The buildnote.json file configures the Buildnote CLI. It defines how the CLI collects and reports test results and build artifacts.

File Location ​

Place the configuration file in your project root, named either:

  • .buildnote.json (preferred)
  • buildnote.json (alternative)

You can also point the CLI at a different path with the --config argument.

buildnote --config path/to/config.json command <options>

Configuration ​

json
{
  "collect": {
    ...
  },
  "report": {
    ...
  },
  "guardrails": {
    ...
  }
}
  • collect: Configuration for data collection (see Collectors)
  • report: Configuration for reporting outputs (see Reporters)
  • guardrails: Policies run by buildnote guardrails (see the Guardrails reference)

Collectors ​

The collect section defines how the CLI gathers events and artifacts.

Test Results ​

Configures which test result formats the CLI collects.

json
{
  "collect": {
    "junit": {...},
    "qt": {...},
    "dart": {...},
    "nunit": {...},
    "ctrf": {...},
    "xunit": {...},
    "testng": {...},
    "robot": {...},
    "cucumber": {...},
    "trx": {...},
    "otr": {...}
  }
}

The following test collectors are available:

Example

json
{
  "enabled": true,
  "include": [
    "**/pattern.xml"
  ],
  "exclude": [
    "**/build/*"
  ],
  "metadata": {
    "some-constant": "value",
    "some-expression": "{{env.USER}}"
  }
}

Properties:

  • enabled (boolean): Enable/disable this collector
  • include (string[]): Glob patterns for files to include
  • exclude (string[]): Glob patterns for files to exclude
  • metadata (object): Additional key-value metadata. Supports expressions.

Files ​

Collects any files you choose as build artifacts:

json
{
  "collect": {
    "files": {
      ...
    }
  }
}
json
{
  "files": {
    "enabled": true,
    "include": [
      "./documentation/**/*",
      "**/*.png",
      "**/*.svg",
      "**/*.md"
    ],
    "exclude": [
      "**/node_modules",
      "**/.gradle"
    ],
    "metadata": {
      "foo.bar": "{{env.USER}}"
    }
  }
}

Events ​

Collects Buildnote event files.

json
{
  "collect": {
    "events": {
      ...
    }
  }
}
json
{
  "events": {
    "enabled": true,
    "include": [
      "**/buildnote-*-events.ndjson"
    ]
  }
}

Metadata ​

Global metadata that is added to all collected data:

json
{
  "collect": {
    "metadata": {
      "modified user": "User is {{env.USER}}"
    }
  }
}

Reporters ​

The report section configures where reports go and what format they use.

json
{
  "report": {
    "slack": {...},
    "discord": {...},
    "github": {...},
    "html": {...},
    "template": {...}
  }
}

Properties:

  • slack - Sends a Slack notification
  • discord - Sends a Discord notification
  • github - Creates a step summary and an issue comment in GitHub
  • html - Writes the report as an HTML file
  • template - The template used for the report

Slack ​

json
{
  "slack": {
    "enabled": true,
    "condition": "{{successful || failed}}",
    "url": "{{env.SLACK_WH}}",
    "title": "E2E test {{status}}",
    "titleUrl": "{{source.url}}",
    "template": {
      "components": [
        ...
      ]
    }
  }
}

Properties:

  • enabled (boolean): Enable/disable reporter
  • condition (string, optional): Boolean expression to conditionally enable (e.g., "{{successful || failed}}")
  • url (string): Slack webhook URL
  • title (string, optional): Notification title
  • titleUrl (string, optional): URL for the title link
  • template (object, optional): Template configuration with components

Discord ​

json
{
  "discord": {
    "enabled": true,
    "condition": "{{successful || failed}}",
    "url": "{{env.DISCORD_WH}}",
    "title": "E2E test {{status}}",
    "titleUrl": "{{source.url}}",
    "template": {
      "components": [
        ...
      ]
    }
  }
}

Properties:

  • enabled (boolean): Enable/disable reporter
  • condition (string, optional): Boolean expression to conditionally enable (e.g., "{{successful || failed}}")
  • url (string): Discord webhook URL
  • title (string, optional): Notification title
  • titleUrl (string, optional): URL for the title link
  • template (object, optional): Template configuration with components

GitHub ​

json
{
  "github": {
    "enabled": true,
    "condition": "{{successful}}",
    "token": "{{env.GITHUB_TOKEN}}",
    "commentEnabled": true,
    "commentUpdates": true,
    "commentTitle": "Test Results",
    "commentTitleUrl": "{{source.url}}",
    "template": {
      "components": [
        ...
      ]
    }
  }
}

Properties:

  • enabled (boolean): Enable/disable reporter
  • condition (string, optional): Boolean expression to conditionally enable (e.g., "{{successful || failed}}")
  • token (string, optional): GitHub token
  • commentEnabled (boolean, default: true): Enable PR/commit comments
  • commentUpdates (boolean, default: true): Update existing comments instead of creating new ones
  • commentTitle (string, optional): Comment title
  • commentTitleUrl (string, optional): URL for the comment title
  • template (object, optional): Template configuration with components

HTML ​

json
{
  "html": {
    "enabled": true,
    "outputFile": "build/htmlreps/report.html",
    "template": {
      "components": [
        ...
      ]
    }
  }
}

Properties:

  • enabled (boolean): Enable/disable reporter
  • condition (string, optional): Boolean expression to conditionally enable (e.g., "{{successful || failed}}")
  • outputFile (string): Path for the output HTML file
  • template (object, optional): Template configuration with components

Template ​

The template object defines the report structure:

json
{
  "template": {
    "components": [
      {
        "type": "testSummary"
      },
      {
        "type": "section",
        "title": "Details",
        "collapsible": true,
        "components": [
          {
            "type": "tagSummary"
          },
          {
            "type": "tests"
          }
        ]
      }
    ]
  }
}

If you don't specify a template, the CLI uses the default one.

Components ​

Components define the structure and content of a report. You list them in the template.components array.

markdown ​

Renders markdown content:

json
{
  "type": "markdown",
  "text": "# hello\n\n- one list\n- 2 list\n\n---\n\ntext content"
}

Properties:

  • text (string): Markdown content. Supports template variables.

alert ​

Displays an alert message with a severity level:

json
{
  "type": "alert",
  "severity": "warning",
  "text": "Some important message"
}

Properties:

  • severity (enum): note, tip, important, warning, caution
  • text (string): Alert message. Supports template variables.

testSummary ​

Displays a summary of test results:

json
{
  "type": "testSummary"
}

tagSummary ​

Displays a summary grouped by tags:

json
{
  "type": "tagSummary"
}

tests ​

Lists detailed test results:

json
{
  "type": "tests"
}

section ​

Groups components into a section that can be collapsed:

json
{
  "type": "section",
  "title": "More details...",
  "collapsible": true,
  "collapsed": true,
  "components": [
    {
      "type": "testSummary"
    },
    {
      "type": "tests"
    }
  ]
}

Properties:

  • title (string): Section title. Supports template variables.
  • collapsible (boolean, default: false): Whether the section can be collapsed
  • collapsed (boolean, default: true): Initial collapsed state
  • components (array): Child components

property ​

Displays a custom property, optionally compared against a baseline:

number ​

json
{
  "type": "property",
  "name": "Code Coverage",
  "valueType": "number",
  "format": "0.00'%'",
  "value": {
    "ref": "{{ref}}",
    "org": "my-org",
    "project": "my-project",
    "module": "my-module",
    "build": "build-id"
  },
  "baseline": {
    "ref": "main",
    "module": "my-module",
    "expectedTrend": "up",
    "tolerance": 0.05
  }
}
  • name (string): Property display name
  • valueType: "number"
  • format (string, optional): Number format pattern
  • value (object, optional): Query configuration for property value
    • org (string, optional): Organization ID
    • project (string, optional): Project ID
    • module (string, optional): Module ID
    • build (string, optional): Build ID
    • ref (string, optional): Commit reference
  • baseline (object, optional): Query configuration for baseline comparison
    • org (string, optional): Organization ID
    • project (string, optional): Project ID
    • module (string, optional): Module ID
    • build (string, optional): Build ID
    • ref (string, optional): Commit reference
    • expectedTrend (enum, optional): up, down, same
    • tolerance (number, optional): Acceptable variance threshold

Number Format Patterns

SymbolLocationMeaning
0NumberDigit - always shows a digit, using zero if necessary
#NumberDigit - shows a digit if present, otherwise nothing
.NumberDecimal separator or monetary decimal separator
-NumberMinus sign
,NumberGrouping separator or monetary grouping separator
ENumberSeparates mantissa and exponent in scientific notation
;Subpattern boundarySeparates positive and negative subpatterns
%Prefix or suffixMultiply by 100 and show as percentage
‰ (\u2030)Prefix or suffixMultiply by 1000 and show as per mille
¤ (\u00A4)Prefix or suffixCurrency sign, replaced by currency symbol
'Prefix or suffixUsed to quote special characters in prefix or suffix

Common Format Examples

Format PatternValueOutputDescription
"0.00"123.4123.40Always 2 decimal places
"#.##"123.4123.4Up to 2 decimal places
"#,##0"12345671,234,567Grouping separator
"#,##0.00"1234.51,234.50Grouping + 2 decimals
"0.00'%'"0.8560.86%Quoted percent symbol
"0.00'%'"85.685.60%Display as-is with %
"#,##0.##'%'"85.67885.68%Grouping + decimals + %
"0.00E0"12341.23E3Scientific notation
"#,##0.00;(#,##0.00)"-1234.5(1,234.50)Negative in parentheses
"¤#,##0.00"1234.5$1,234.50Currency symbol
"'$'#,##0.00"1234.5$1,234.50Literal dollar sign

Quoting Special Characters

Use single quotes ' to include literal text in the format pattern:

  • "0.00'%'" - Literal percent sign
  • "'USD '#,##0.00" - Literal "USD " prefix
  • "#,##0' units'" - Literal " units" suffix

string ​

json
{
  "type": "property",
  "name": "Another property",
  "valueType": "string",
  "value": {
    "ref": "{{ref}}"
  }
}
  • name (string): Property display name
  • valueType: "string"
  • value (object, optional): Query configuration for property value
    • org (string, optional): Organization ID
    • project (string, optional): Project ID
    • module (string, optional): Module ID
    • build (string, optional): Build ID
    • ref (string, optional): Commit reference

Complete Example ​

The example below is a complete buildnote.json that uses all the available features.

Click to see full example
json
{
  "collect": {
    "junit": {
      "enabled": true,
      "include": [
        "**/TEST-*.xml"
      ],
      "metadata": {
        "test-user": "{{env.USER}}"
      }
    },
    "files": {
      "enabled": true,
      "include": [
        "./documentation/**/*",
        "**/*.png",
        "**/*.svg",
        "**/*.md"
      ],
      "exclude": [
        "**/node_modules",
        "**/.gradle"
      ]
    }
  },
  "report": {
    "discord": {
      "enabled": true,
      "url": "{{env.DISCORD_WH}}",
      "condition": "{{successful || failed}}",
      "title": "E2E test {{status}} - {{env.GITHUB_WORKFLOW}}"
    },
    "github": {
      "enabled": true
    },
    "html": {
      "enabled": true,
      "outputFile": "build/htmlreps/report.html"
    },
    "template": {
      "components": [
        {
          "type": "markdown",
          "text": "# Build Report\n\nStatus: {{status}}"
        },
        {
          "type": "testSummary"
        },
        {
          "type": "section",
          "title": "More details",
          "collapsible": true,
          "components": [
            {
              "type": "alert",
              "severity": "note",
              "text": "Important information"
            },
            {
              "type": "tagSummary"
            },
            {
              "type": "tests"
            }
          ]
        }
      ]
    }
  }
}

Buildnote Limited
Registered in England and Wales, Reg: 16140412