@pacia/cli
v1.1.0
Published
Fault-tolerant CI reporting for Pacia engineering intelligence
Readme
@pacia/cli
CI reporting for Pacia engineering intelligence. The package exposes the
pacia executable and is intended to be run without a repository-local
dependency:
See the complete CLI reference for setup, all parameters, CI variable detection, publishing, and maintenance steps.
npx --yes @pacia/cli@latest coverage reportPacia uses one organization-wide PACIA_API_KEY across all shared pipelines.
Each run must explicitly pass --repository and --provider; authorization
identity is never inferred from provider-specific CI variables.
Pull request coverage
Generate an Istanbul/Vitest JSON summary, then report it from the PR test job:
- script: >
yarn test:coverage
--coverage.reporter=json-summary
--reporter=junit
--outputFile=reports/junit.xml
displayName: Run tests with coverage
- script: >
npx --yes @pacia/cli@latest coverage report
--module "${{ parameters.appName }}"
--repository "${{ parameters.repositoryName }}"
--provider "${{ parameters.repositoryProvider }}"
displayName: Report PR coverage to Pacia
continueOnError: true
env:
PACIA_API_KEY: $(PACIA_API_KEY)Azure Pipelines build ID, commit SHA, source branch, and pull request number are detected automatically. A PR report updates only that pull request's total line coverage percentage. It does not store the full report or create a historical branch snapshot.
Full branch snapshots
On a protected branch such as main or master, generate both summary and
full JSON output and opt into artifact storage:
- script: >
yarn test:coverage
--coverage.reporter=json-summary
--coverage.reporter=json
displayName: Run branch tests with full coverage
- script: >
npx --yes @pacia/cli@latest coverage report
--module "${{ parameters.appName }}"
--repository "${{ parameters.repositoryName }}"
--provider "${{ parameters.repositoryProvider }}"
--branch "$(Build.SourceBranchName)"
--full-report coverage/coverage-final.json
displayName: Store full branch coverage in Pacia
env:
PACIA_API_KEY: $(PACIA_API_KEY)This stores the standard line, statement, function, and branch totals in the database for trend queries. The complete JSON report is stored at a relative path shaped as:
<organization>/<repository>/<branch>/<yyyy-mm-dd>/<build>-<module>.jsonThe API stores reports in its local data/coverage-reports folder. Pacia's
deployment scripts preserve this folder between releases. COVERAGE_REPORTS_DIR
can optionally override the location.
Options
Run pacia coverage report --help for the complete list. PACIA_API_KEY is
preferred, but --api-key is available for pipeline systems that cannot map a
secret to an environment variable.
The CLI always writes progress and a final result to the pipeline log. A successful upload ends with:
[pacia] SUCCESS: Reported customer-portal coverage: 80.00% linesReporting failures are non-fatal by default, including API downtime, timeouts, invalid responses, missing files, invalid JSON, and missing API keys:
[pacia] WARNING: Coverage upload failed (503)
[pacia] SUCCESS: Coverage reporting is non-blocking; the pipeline will continue.Use --strict only when a reporting failure should stop the pipeline.
