Configuration
The unentropy.json file configures which metrics to track, storage options, and quality gate thresholds. This reference covers all configuration options.
File Location
Section titled “File Location”Place unentropy.json in your project root directory:
Basic Structure
Section titled “Basic Structure”Metrics
Section titled “Metrics”The metrics object defines which metrics to track. Each key is a unique metric identifier.
Metric Configuration
Section titled “Metric Configuration”Fields
Section titled “Fields”Metric ID (Object Key)
Section titled “Metric ID (Object Key)”Type: string
Required: Yes
Pattern: ^[a-z0-9-]+$ (lowercase alphanumeric with hyphens)
Length: 1-64 characters
The object key serves as the unique metric identifier. Used in:
- Database storage
- Quality gate threshold references
- Report displays
Examples: coverage, bundle-size, test-loc
Type: string
Required: No
Reference a built-in metric template. Inherits default properties like description, unit, and command.
Available templates:
coverage- Test coverage percentage (supports--type line|branch|function)loc- Lines of codesize- File/bundle sizebuild-time- Build durationtest-time- Test durationdependencies-count- Dependency count
See Metrics Guide for details.
Type: string
Required: No
Max length: 256 characters
Display name for reports and charts. Defaults to the metric ID if omitted.
Type: "numeric" or "label"
Required: Yes (unless using $ref)
Determines how values are stored and visualized:
- numeric: Parsed as numbers, displayed as line charts
- label: Stored as strings, displayed as bar charts
description
Section titled “description”Type: string
Required: No
Max length: 256 characters
Human-readable explanation shown in reports.
command
Section titled “command”Type: string
Required: Yes
Max length: 1024 characters
Shell command to execute for collecting this metric. The command’s stdout is captured and parsed based on the metric type.
@collect shortcuts (faster, in-process execution):
@collect loc <path>- Count lines of code@collect size <path>- Calculate file size@collect coverage-lcov <path> [--type line|branch|function]- Extract LCOV coverage@collect coverage-clover <paths...> [--type line|branch|function]- Extract and merge Clover XML coverage@collect coverage-cobertura <paths...> [--type line|branch|function]- Extract and merge Cobertura XML coverage
Type: string
Required: No
Max length: 10 characters
Display unit for numeric metrics. Used for formatting in reports.
Valid units:
percent- Displays as87.5%integer- Displays as1,234bytes- Displays as1.5 MB(auto-scales)duration- Displays as1m 30s(auto-scales)decimal- Displays as3.14
Metric Limits
Section titled “Metric Limits”- Minimum metrics: 1
- Maximum metrics: 50
- Metric ID length: 1-64 characters
- Command timeout: 30 seconds (configurable per-metric)
Command Execution
Section titled “Command Execution”Commands run with these environment variables:
| Variable | Description | Example |
|---|---|---|
UNENTROPY_COMMIT_SHA | Current git commit | a3f5c2b... |
UNENTROPY_BRANCH | Current git branch | main |
UNENTROPY_RUN_ID | GitHub Actions run ID | 1234567890 |
UNENTROPY_RUN_NUMBER | GitHub Actions run number | 42 |
UNENTROPY_ACTOR | User who triggered run | dependabot[bot] |
UNENTROPY_METRIC_KEY | Current metric ID | coverage |
UNENTROPY_METRIC_TYPE | Current metric type | numeric |
Execution rules:
- Runs in repository root directory
- Uses
/bin/shshell environment - Stdout is captured and parsed
- Stderr is logged (doesn’t fail metric)
- Exit code ignored (only output matters)
Storage
Section titled “Storage”Configure where metrics data is stored.
Artifact Storage (Default)
Section titled “Artifact Storage (Default)”Or omit the storage block entirely—artifact storage is the default.
Options:
- artifactName: Artifact name (default:
unentropy-metrics) - branch: Branch to search (default: current branch)
S3 Storage
Section titled “S3 Storage”S3 credentials are provided as GitHub Action inputs, not in the config file:
See Storage Guide for setup details.
Local Storage
Section titled “Local Storage”Database stored at ./unentropy.db in your project directory. Use for local development only (doesn’t persist in CI).
Quality Gate
Section titled “Quality Gate”Configure thresholds to enforce on pull requests.
Basic Quality Gate
Section titled “Basic Quality Gate”Quality Gate Mode
Section titled “Quality Gate Mode”Controls how threshold violations are handled:
Modes:
off- Disabled (no evaluation)soft- Evaluates and posts comments, never fails build (default)hard- Fails build when thresholds violated
Thresholds
Section titled “Thresholds”Array of threshold rules for metrics:
Threshold Fields
Section titled “Threshold Fields”metric
Section titled “metric”Type: string
Required: Yes
Metric ID to evaluate. Must match a metric key in the metrics object.
Type: string
Required: Yes
Comparison mode:
min- Metric must not drop below targetmax- Metric must not exceed targetno-regression- Metric must not decrease from baselinedelta-max-drop- Metric can increase, but not more thanmaxDropPercentpercentage
target
Section titled “target”Type: number
Required: Yes (for min and max modes)
Threshold value. Meaning depends on mode:
min/max: Absolute value
Not used for no-regression or delta-max-drop modes.
maxDropPercent
Section titled “maxDropPercent”Type: number
Required: Yes (only for delta-max-drop mode)
Maximum allowed percentage increase (e.g., 5 = 5% max increase).
See Quality Gates Guide for examples.
Report
Section titled “Report”Configure the appearance and layout of generated HTML reports.
Report Theming
Section titled “Report Theming”Control the visual appearance of your reports with built-in themes or custom palettes.
report.theme
Section titled “report.theme”Type: string | object
Default: "lattice"
Select a built-in palette or provide custom color overrides.
Built-in palettes:
| Value | Description |
|---|---|
"lattice" | Cool blue accent (default) |
"flux" | Warm amber accent |
"halftone" | Purple accent |
"specimen" | Green accent |
Custom palette (object with dark and/or light keys):
Available CSS variables for custom palettes:
| Variable | Used for |
|---|---|
--bg | Page background |
--surface | Card backgrounds |
--surface-card | Elevated card surfaces |
--border | Default borders |
--border-soft | Subtle dividers |
--text | Primary text |
--text-dim | Secondary text |
--text-muted | Placeholder/disabled text |
--accent | Highlights and links |
--up | Positive trend indicators |
--down | Negative trend indicators |
--warn | Warning states |
Each value must be a 7-character hex color (e.g., #1c2230). Omitted variables fall back to Lattice defaults.
report.mode
Section titled “report.mode”Type: "auto" | "light" | "dark"
Default: "auto"
Control how the report selects between light and dark palettes.
| Value | Behavior |
|---|---|
"auto" | Emits both palettes; prefers-color-scheme selects at runtime |
"light" | Locks to light palette; emits only light CSS variables |
"dark" | Locks to dark palette; emits only dark CSS variables |
Report Layout
Section titled “Report Layout”Organize metrics into named sections and combine related metrics on a single chart.
report.sections
Section titled “report.sections”Type: SectionConfig[]
Required: No
Define named, visually separated groups of charts. When absent, the report uses a flat layout with all metrics displayed in definition order.
Each section contains:
Section Fields
Section titled “Section Fields”| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Section header text (max 256 characters) |
description | string | No | Subtitle shown below the header |
charts | ChartConfig[] | Yes | Charts to render, in display order |
Chart Configuration
Section titled “Chart Configuration”| Field | Type | Required | Description |
|---|---|---|---|
metrics | string | string[] | Yes | Metric ID(s) to plot. Array plots multiple metrics on one chart. |
title | string | No | Custom chart title. Defaults to metric name(s) when omitted. |
Single-metric chart:
Multi-metric chart:
Metrics with different units or scales automatically receive dual Y-axes. A legend identifies each series and can be clicked to toggle visibility.
Report Validation
Section titled “Report Validation”- Unknown
themestring → warning logged, falls back to"lattice" - Custom theme with partial variables → missing variables filled from Lattice defaults
- Invalid
modevalue → validation error at config load time - Invalid hex format in custom theme → validation error at config load time
- Empty
sectionsarray → validation error (remove the block or define at least one section) - Unknown
metricsreferences in charts → silently omitted from the report - Metrics not referenced in any chart → omitted from the report with no warning
Complete Example
Section titled “Complete Example”Validation
Section titled “Validation”Validate your configuration locally:
Common validation errors:
Invalid Metric ID
Section titled “Invalid Metric ID”Invalid Metric Type
Section titled “Invalid Metric Type”Empty Command
Section titled “Empty Command”Missing Required Fields
Section titled “Missing Required Fields”Empty Report Sections
Section titled “Empty Report Sections”Empty Section Charts
Section titled “Empty Section Charts”Invalid Report Mode
Section titled “Invalid Report Mode”Invalid Theme Value
Section titled “Invalid Theme Value”Related Resources
Section titled “Related Resources”- Metrics Guide - Metric configuration examples
- Quality Gates Guide - Threshold setup
- Storage Guide - Storage configuration
- CLI Reference - Validation commands