Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ Breaking. `packdb-query` is retired in favour of `packdb`, whose command library
this repository now provides; its 0.2.x archives are unchanged. See
`crates/packdb-cli/COMPATIBILITY.md` for the contract and the migration table.

- The package is `packdb-cli`, a library with no executable. `packdb query sql`
replaces `packdb-query`; the `packdb` binary is assembled with the server.
- The package is `packdb-cli`. It builds the `packdb` client binary, and its
library (`Command`, `run`, `Io`) stays the shared API. `packdb query sql`
replaces `packdb-query`. `packdb` never starts a server and depends on no
server package; the single-node server is `packdb-server`, built from the
server repository. The test-only `packdb-cli-test-harness` is removed: its
process tests now run the real binary.
- Credentials never come from argument values: `--api-key-file`, `--token-file`
and `--basic-auth-file`, or `PACKDB_API_KEY`, `PACKDB_TOKEN`, `PACKDB_BASIC_AUTH`
and their `_FILE` forms. Two credentials are refused instead of the first
Expand Down
11 changes: 0 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

[workspace]
resolver = "3"
members = ["crates/packdb-cli", "crates/packdb-cli-test-harness"]
members = ["crates/packdb-cli"]

[workspace.package]
edition = "2024"
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# PackDB command library

`packdb-cli` is the command library behind `packdb`, PackDB's command-line
client. It implements `packdb query sql|promql|logql|traceql`, `packdb trace`,
`packdb-cli` builds `packdb`, PackDB's command-line client, and the command
library behind it. It implements `packdb query sql|promql|logql|traceql`, `packdb trace`,
`packdb doctor` (limited diagnostics), `packdb smoke-test`, `packdb support-bundle` and
`packdb usage-report`.

| Package | Scope |
| --- | --- |
| `packdb-cli` | The command library: arguments, credentials, output, completeness and exit codes |
| `packdb-cli-test-harness` | Test-only executable that runs the library as a process; never released |
| `packdb-cli` | The `packdb` binary and its command library: arguments, credentials, output, completeness and exit codes |

This repository ships no executable. The `packdb` binary that embeds the library
is assembled with the server. `packdb-query`, the binary of releases 0.2.0 to
0.2.4, is retired; its archives remain on
`packdb` is a client only. It never starts a server and depends on no server
package; the single-node server is `packdb-server`, built from the server
repository. `packdb-query`, the binary of releases 0.2.0 to 0.2.4, is retired;
its archives remain on
[GitHub Releases](https://github.com/packdb-oss/packdb-cli/releases) unchanged.

This workspace provides client-side commands. It does not implement the server
Expand Down
9 changes: 5 additions & 4 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ GitHub releases and crates.io publication are separate decisions; crates.io is p
cannot resolve from the registry, until `packdb-otel` and then `packdb-client` are
on crates.io. Do not attempt them in the other order.

This repository releases source only. The `packdb` binary that embeds the library
is built and released with the server; `packdb-query` binary archives of 0.2.0 to
0.2.4 stay on their GitHub Releases unchanged.
This repository releases source. The `packdb` client binary builds from it; how
`packdb` and `packdb-server` binaries are distributed is decided separately.
`packdb-query` binary archives of 0.2.0 to 0.2.4 stay on their GitHub Releases
unchanged.

## Private candidates

Expand All @@ -21,7 +22,7 @@ is built and released with the server; `packdb-query` binary archives of 0.2.0 t
3. Inspect `cargo package --list`. The package must include its README, LICENSE and
COMPATIBILITY.md, and exclude private data and internal-only source.
4. Dispatch `oss-candidate`. It reruns every gate on the exact commit, including
the test harness's process-level contract tests, and records the source archive,
the `packdb` binary's process-level contract tests, and records the source archive,
package and source inventories, dependency inventory, checksums and the SDK
revision it was built against.
5. Review the source archive, dependency inventory, checksums and release record. A
Expand Down
30 changes: 0 additions & 30 deletions crates/packdb-cli-test-harness/Cargo.toml

This file was deleted.

61 changes: 0 additions & 61 deletions crates/packdb-cli-test-harness/src/main.rs

This file was deleted.

16 changes: 9 additions & 7 deletions crates/packdb-cli/COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# `packdb` command contract

What the `packdb` client commands promise their callers. This library implements
them; the `packdb` binary that embeds it is assembled with the server. Until that
binary exists, the contract is tested through `packdb-cli-test-harness`, a
test-only executable that is never released.
them, and this crate's `packdb` binary runs them. `packdb` is a client only: the
single-node server is `packdb-server`, built from the server repository, and each
reports its own version.

Read as: anything in **The contract** changes only with a deliberate, documented
decision. Anything under **Not promised** may change without one.
Expand Down Expand Up @@ -463,10 +463,12 @@ refuses an answer whose declarations differ from these:
unavailable value reported as missing evidence and never as zero, a server without
the route, answers with a wrong schema, scope, period, omitted or negative value,
`401`, `403` and an unreachable server.
- `crates/packdb-cli-test-harness/tests/process.rs`: the same contract as a process
sees it, covering help, the refused secret argument, stdout/stderr separation,
exit codes, credential files, conflicts, a closed stdout (exit `8`), the PromQL,
trace and time-argument cases, `doctor` and `usage-report`.
- `crates/packdb-cli/tests/process.rs`: the same contract as the `packdb` binary
shows it, covering help for every command, `--version`, bare `packdb` exiting `2`
promptly without creating files, the refused secret argument, stdout/stderr
separation, exit codes, credential files, conflicts, a closed stdout (exit `8`),
help, `--version`, usage errors and bare `packdb` on an unwritable stream (exit `8`),
the PromQL, trace and time-argument cases, `doctor` and `usage-report`.
- `packdb-client`'s own tests cover the transport fallback rules, the query API
requests and error classification.

Expand Down
12 changes: 9 additions & 3 deletions crates/packdb-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "packdb-cli"
version = "0.2.4"
edition = "2024"
rust-version = "1.94.1"
description = "The command library behind the PackDB `packdb` command: queries and operator commands against a running server."
description = "PackDB's `packdb` command-line client and the command library behind it: queries and operator commands against a running server."
license = "Apache-2.0"
readme = "README.md"
keywords = ["packdb", "cli", "sql", "query"]
Expand All @@ -12,6 +12,12 @@ repository = "https://github.com/packdb-oss/packdb-cli"
# a separate reviewed allowlist change and release authorization.
publish = false

# The `packdb` client. The library stays the shared API: `Command`, `run` and
# `Io` are what the binary, and any other front end, call.
[[bin]]
name = "packdb"
path = "src/main.rs"

[dependencies]
# Enable the `sql` feature so the SQL client (including Arrow result
# formatting) is compiled in. Flight SQL transport is opt-in via the
Expand All @@ -33,14 +39,14 @@ serde_json = { version = "1", features = ["preserve_order"] }
# The support bundle's archive container and its temporary file.
tar = { version = "0.4", default-features = false }
tempfile = "3"
tokio = { version = "1.49", features = ["macros", "time"] }
tokio = { version = "1.49", features = ["macros", "rt", "time"] }
# The `smoke-test` run marker and trace and span identifiers.
uuid = { version = "1", features = ["v4"] }
# Compresses the support bundle.
zstd = { version = "0.14", default-features = false }

[dev-dependencies]
tokio = { version = "1.49", features = ["macros", "rt"] }
tokio = { version = "1.49", features = ["macros", "rt", "rt-multi-thread"] }
wiremock = "0.6"

[features]
Expand Down
13 changes: 7 additions & 6 deletions crates/packdb-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# `packdb-cli`

The command library behind `packdb`: queries, trace lookup, limited `doctor`
diagnostics, `smoke-test`, `support-bundle` and `usage-report` against a running
PackDB server.
`packdb`, PackDB's command-line client, and the command library behind it:
queries, trace lookup, limited `doctor` diagnostics, `smoke-test`,
`support-bundle` and `usage-report` against a running PackDB server.

This crate ships no executable. The `packdb` binary that embeds it is assembled
with the server. `packdb-query`, the binary of releases 0.2.0 to 0.2.4, is
retired; its released archives are unchanged.
The crate builds the `packdb` binary and exports the library it runs (`Command`,
`run`, `Io`). `packdb` never starts a server; the single-node server is
`packdb-server`, built from the server repository. `packdb-query`, the binary of
releases 0.2.0 to 0.2.4, is retired; its released archives are unchanged.

The supported surface — arguments, environment variables, output, completeness
and exit codes — is written down in [`COMPATIBILITY.md`](./COMPATIBILITY.md),
Expand Down
4 changes: 2 additions & 2 deletions crates/packdb-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
//! The command library behind `packdb`.
//!
//! [`Command`] is a clap subcommand set; [`run`] executes one against a running
//! PackDB server and returns its [`Exit`] status. The library ships no
//! executable: the `packdb` binary that embeds it is assembled with the server.
//! PackDB server and returns its [`Exit`] status. This crate's `packdb` binary
//! runs it; the library is the shared API for any other front end.
//! `COMPATIBILITY.md` is the supported contract: arguments, environment,
//! output and exit codes.

Expand Down
Loading
Loading