https://github.com/cpg314/cargo-harbormaster
Export diagnostics from cargo check, cargo clippy and cargo nextest into the JSON message format expected by Phabricator's Harbormaster.
https://github.com/cpg314/cargo-harbormaster
cargo cargo-subcommand harbormaster phabricator rust
Last synced: 10 months ago
JSON representation
Export diagnostics from cargo check, cargo clippy and cargo nextest into the JSON message format expected by Phabricator's Harbormaster.
- Host: GitHub
- URL: https://github.com/cpg314/cargo-harbormaster
- Owner: cpg314
- License: apache-2.0
- Created: 2023-09-24T13:21:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-26T22:04:39.000Z (11 months ago)
- Last Synced: 2025-02-26T23:19:00.736Z (11 months ago)
- Topics: cargo, cargo-subcommand, harbormaster, phabricator, rust
- Language: Rust
- Homepage: https://c.pgdm.ch/code
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# cargo-harbormaster
Export diagnostics from `cargo check`, `cargo clippy` and [`cargo nextest`](https://nexte.st/) into the JSON message format expected by [Phabricator's Harbormaster](https://secure.phabricator.com/book/phabricator/article/harbormaster/).
This allows reporting errors and test results directly in Phabricator differentials.
See the [Harbormaster API documentation](https://secure.phabricator.com/conduit/method/harbormaster.sendmessage/). Note that the message generated by `cargo-harbormaster` uses the parameters format used by `arc` (see the example below; the parameters and API tokens are encoded in a single JSON message).
For `cargo nextest`, we rely on a regular expression to parse the output, as machine-readable output is [not supported yet](https://nexte.st/book/machine-readable.html#running-tests).
## Usage
```console
$ cargo clippy --message-format=json > clippy.json
$ cargo nextest 2 > nextest.log
$ export PHAB_TOKEN=...
$ params=$(cargo-harbormaster {PHID-...} --status pass --clippy-json clippy.json --nextest-stderr nextest.log)
$ curl -X POST https://{...}/api/harbormaster.sendmessage -d params="$params
```
## Command line arguments
```
Usage: cargo-harbormaster [OPTIONS] --token --status
Arguments:
Build PHID (PHID-...)
Options:
--workspace
Path to the rust workspace relative to the repository root
--token
Phabricator API token [env: PHAB_TOKEN=]
--status
Build status [possible values: abort, fail, pass, pause, restart, resume, work]
--clippy-json
Path to 'cargo clippy --message-format=json' output
--check-json
Path to 'cargo check --message-format=json' output
--nextest-stderr
Path to 'cargo nextest' stderr output
-h, --help
Print help
```