diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b184fe6..c1b9ac6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -209,3 +209,22 @@ jobs: rustflags: "" - run: cargo install cargo-audit --locked - run: cargo audit --deny warnings + + version-consistency: + # Ensures version.txt (release-please source of truth) stays in sync + # with Cargo.toml workspace version. Catches release-please PRs that + # bump one but not the other. + name: version consistency + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v6 + - name: Check version.txt matches Cargo.toml workspace version + run: | + set -euo pipefail + CARGO_VERSION=$(grep -A1 'x-release-please-version' Cargo.toml | tail -1 | sed 's/.*"\(.*\)".*/\1/') + TXT_VERSION=$(cat version.txt | tr -d '[:space:]') + if [[ "$CARGO_VERSION" != "$TXT_VERSION" ]]; then + echo "::error::version.txt ($TXT_VERSION) does not match Cargo.toml workspace version ($CARGO_VERSION)" + exit 1 + fi diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d263350..fe89e76 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,13 +1,13 @@ { ".": "0.1.2", - "hyperdb-api-node": "0.1.1", + "hyperdb-api-node": "0.1.2", "hyperdb-mcp/npm": "0.1.2", - "hyperdb-mcp/npm/darwin-arm64": "0.1.1", - "hyperdb-mcp/npm/linux-x64-gnu": "0.1.1", - "hyperdb-mcp/npm/win32-x64-msvc": "0.1.1", - "hyperdb-api-node/npm/darwin-arm64": "0.1.1", - "hyperdb-api-node/npm/linux-arm64-gnu": "0.1.1", - "hyperdb-api-node/npm/linux-x64-gnu": "0.1.1", - "hyperdb-api-node/npm/linux-x64-musl": "0.1.1", - "hyperdb-api-node/npm/win32-x64-msvc": "0.1.1" + "hyperdb-mcp/npm/darwin-arm64": "0.1.2", + "hyperdb-mcp/npm/linux-x64-gnu": "0.1.2", + "hyperdb-mcp/npm/win32-x64-msvc": "0.1.2", + "hyperdb-api-node/npm/darwin-arm64": "0.1.2", + "hyperdb-api-node/npm/linux-arm64-gnu": "0.1.2", + "hyperdb-api-node/npm/linux-x64-gnu": "0.1.2", + "hyperdb-api-node/npm/linux-x64-musl": "0.1.2", + "hyperdb-api-node/npm/win32-x64-msvc": "0.1.2" } diff --git a/Cargo.lock b/Cargo.lock index 73d0156..733d888 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1811,7 +1811,7 @@ dependencies = [ [[package]] name = "hyperdb-api" -version = "0.1.1" +version = "0.1.2" dependencies = [ "arrow", "bytes", @@ -1832,7 +1832,7 @@ dependencies = [ [[package]] name = "hyperdb-api-core" -version = "0.1.1" +version = "0.1.2" dependencies = [ "arrow", "base64", @@ -1872,7 +1872,7 @@ dependencies = [ [[package]] name = "hyperdb-api-node" -version = "0.1.1" +version = "0.1.2" dependencies = [ "hyperdb-api", "napi", @@ -1884,7 +1884,7 @@ dependencies = [ [[package]] name = "hyperdb-api-salesforce" -version = "0.1.1" +version = "0.1.2" dependencies = [ "arrow", "base64", @@ -1905,7 +1905,7 @@ dependencies = [ [[package]] name = "hyperdb-bootstrap" -version = "0.1.1" +version = "0.1.2" dependencies = [ "anyhow", "clap", @@ -1923,7 +1923,7 @@ dependencies = [ [[package]] name = "hyperdb-mcp" -version = "0.1.1" +version = "0.1.2" dependencies = [ "arrow", "base64", @@ -3767,7 +3767,7 @@ dependencies = [ [[package]] name = "sea-query-hyperdb" -version = "0.1.1" +version = "0.1.2" dependencies = [ "sea-query", ] diff --git a/Cargo.toml b/Cargo.toml index 05af8fb..e6081c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ [workspace.package] # x-release-please-version -version = "0.1.1" +version = "0.1.2" edition = "2021" rust-version = "1.81" license = "MIT OR Apache-2.0" diff --git a/hyperdb-api-core/Cargo.toml b/hyperdb-api-core/Cargo.toml index a8831db..774c8cd 100644 --- a/hyperdb-api-core/Cargo.toml +++ b/hyperdb-api-core/Cargo.toml @@ -64,7 +64,8 @@ serde = { workspace = true } serde_json = { workspace = true } # Salesforce OAuth authentication (optional, via standalone crate) -hyperdb-api-salesforce = { path = "../hyperdb-api-salesforce", version = "=0.1.1", optional = true } +# x-release-please-version +hyperdb-api-salesforce = { path = "../hyperdb-api-salesforce", version = "=0.1.2", optional = true } # Arrow parsing for catalog operations (optional, used by authenticated_client) arrow = { version = "58.0", optional = true } diff --git a/hyperdb-api-node/npm/darwin-arm64/package.json b/hyperdb-api-node/npm/darwin-arm64/package.json index 87af42d..3dafc16 100644 --- a/hyperdb-api-node/npm/darwin-arm64/package.json +++ b/hyperdb-api-node/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "hyperdb-api-node-darwin-arm64", - "version": "0.1.1", + "version": "0.1.2", "os": [ "darwin" ], diff --git a/hyperdb-api-node/npm/darwin-x64/package.json b/hyperdb-api-node/npm/darwin-x64/package.json index 54e1f27..cda4beb 100644 --- a/hyperdb-api-node/npm/darwin-x64/package.json +++ b/hyperdb-api-node/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "hyperdb-api-node-darwin-x64", - "version": "0.1.1", + "version": "0.1.2", "os": [ "darwin" ], diff --git a/hyperdb-api-node/npm/linux-arm64-gnu/package.json b/hyperdb-api-node/npm/linux-arm64-gnu/package.json index d92f889..b0a053b 100644 --- a/hyperdb-api-node/npm/linux-arm64-gnu/package.json +++ b/hyperdb-api-node/npm/linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "hyperdb-api-node-linux-arm64-gnu", - "version": "0.1.1", + "version": "0.1.2", "os": [ "linux" ], diff --git a/hyperdb-api-node/npm/linux-x64-gnu/package.json b/hyperdb-api-node/npm/linux-x64-gnu/package.json index 3d0d0cf..832123c 100644 --- a/hyperdb-api-node/npm/linux-x64-gnu/package.json +++ b/hyperdb-api-node/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "hyperdb-api-node-linux-x64-gnu", - "version": "0.1.1", + "version": "0.1.2", "os": [ "linux" ], diff --git a/hyperdb-api-node/npm/linux-x64-musl/package.json b/hyperdb-api-node/npm/linux-x64-musl/package.json index 7241bc8..6c500e8 100644 --- a/hyperdb-api-node/npm/linux-x64-musl/package.json +++ b/hyperdb-api-node/npm/linux-x64-musl/package.json @@ -1,6 +1,6 @@ { "name": "hyperdb-api-node-linux-x64-musl", - "version": "0.1.1", + "version": "0.1.2", "os": [ "linux" ], diff --git a/hyperdb-api-node/npm/win32-x64-msvc/package.json b/hyperdb-api-node/npm/win32-x64-msvc/package.json index 67469dc..fa445d0 100644 --- a/hyperdb-api-node/npm/win32-x64-msvc/package.json +++ b/hyperdb-api-node/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "hyperdb-api-node-win32-x64-msvc", - "version": "0.1.1", + "version": "0.1.2", "os": [ "win32" ], diff --git a/hyperdb-api-node/package.json b/hyperdb-api-node/package.json index f830037..33a5bf9 100644 --- a/hyperdb-api-node/package.json +++ b/hyperdb-api-node/package.json @@ -1,6 +1,6 @@ { "name": "hyperdb-api-node", - "version": "0.1.1", + "version": "0.1.2", "description": "Node.js bindings for the Hyper database API, powered by napi-rs", "main": "index.js", "types": "index.d.ts", diff --git a/hyperdb-api/Cargo.toml b/hyperdb-api/Cargo.toml index d5bf9b3..cd13f04 100644 --- a/hyperdb-api/Cargo.toml +++ b/hyperdb-api/Cargo.toml @@ -13,7 +13,8 @@ categories = ["database"] autobenches = false [dependencies] -hyperdb-api-core = { path = "../hyperdb-api-core", version = "=0.1.1" } +# x-release-please-version +hyperdb-api-core = { path = "../hyperdb-api-core", version = "=0.1.2" } bytes = { workspace = true } thiserror = { workspace = true } tracing = { workspace = true } diff --git a/hyperdb-mcp/npm/darwin-arm64/package.json b/hyperdb-mcp/npm/darwin-arm64/package.json index f486aae..1d14ac3 100644 --- a/hyperdb-mcp/npm/darwin-arm64/package.json +++ b/hyperdb-mcp/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "hyperdb-mcp-darwin-arm64", - "version": "0.1.1", + "version": "0.1.2", "description": "HyperDB MCP server binary for macOS ARM64", "os": ["darwin"], "cpu": ["arm64"], diff --git a/hyperdb-mcp/npm/darwin-x64/package.json b/hyperdb-mcp/npm/darwin-x64/package.json index a46ced4..880ca7b 100644 --- a/hyperdb-mcp/npm/darwin-x64/package.json +++ b/hyperdb-mcp/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "hyperdb-mcp-darwin-x64", - "version": "0.1.1", + "version": "0.1.2", "description": "HyperDB MCP server binary for macOS x64", "os": ["darwin"], "cpu": ["x64"], diff --git a/hyperdb-mcp/npm/linux-x64-gnu/package.json b/hyperdb-mcp/npm/linux-x64-gnu/package.json index 207bbde..0be20ba 100644 --- a/hyperdb-mcp/npm/linux-x64-gnu/package.json +++ b/hyperdb-mcp/npm/linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "hyperdb-mcp-linux-x64-gnu", - "version": "0.1.1", + "version": "0.1.2", "description": "HyperDB MCP server binary for Linux x64 (glibc)", "os": ["linux"], "cpu": ["x64"], diff --git a/hyperdb-mcp/npm/win32-x64-msvc/package.json b/hyperdb-mcp/npm/win32-x64-msvc/package.json index ed17be7..c81d325 100644 --- a/hyperdb-mcp/npm/win32-x64-msvc/package.json +++ b/hyperdb-mcp/npm/win32-x64-msvc/package.json @@ -1,6 +1,6 @@ { "name": "hyperdb-mcp-win32-x64-msvc", - "version": "0.1.1", + "version": "0.1.2", "description": "HyperDB MCP server binary for Windows x64", "os": ["win32"], "cpu": ["x64"], diff --git a/hyperdb-mcp/src/ingest.rs b/hyperdb-mcp/src/ingest.rs index 074cad0..2b9702e 100644 --- a/hyperdb-mcp/src/ingest.rs +++ b/hyperdb-mcp/src/ingest.rs @@ -684,18 +684,23 @@ pub fn ingest_csv( // Write CSV to a temp file before starting the transaction (it's a pure // filesystem operation and doesn't need to be atomic with the DB work). // - // The filename mixes PID and a nanosecond timestamp so parallel tests - // (and parallel ingest calls from a multi-client MCP) don't race on - // the same path and produce `unable to read from external source` - // errors when one caller's COPY overlaps another's write/remove. - let temp_dir = std::env::temp_dir(); - let temp_path = temp_dir.join(format!( - "hyperdb_mcp_csv_{}_{}.csv", - std::process::id(), - std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .map_or(0, |d| d.as_nanos()) - )); + // Uses `tempfile::NamedTempFile` for OS-guaranteed unique paths — the + // previous PID+nanosecond scheme could collide on macOS where timer + // resolution is coarser, causing parallel tests to race on the same file. + // `into_temp_path()` closes the file handle immediately while retaining + // the auto-delete-on-drop guarantee. This is required on Windows where + // `hyperd` cannot open a file held by another process. + let temp_path = tempfile::Builder::new() + .prefix("hyperdb_mcp_csv_") + .suffix(".csv") + .tempfile() + .map_err(|e| { + McpError::new( + ErrorCode::InternalError, + format!("Failed to create temp CSV file: {e}"), + ) + })? + .into_temp_path(); std::fs::write(&temp_path, csv_text).map_err(|e| { McpError::new( ErrorCode::InternalError, @@ -724,8 +729,8 @@ pub fn ingest_csv( engine.execute_command(©_sql) }); - // Always clean up the temp file, success or failure. - let _ = std::fs::remove_file(&temp_path); + // `temp_path` (TempPath) auto-deletes the file when dropped at end of scope. + drop(temp_path); let row_count = row_count?; let elapsed = timer.elapsed_ms(); diff --git a/release-please-config.json b/release-please-config.json index c8d7a74..43cb5e5 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -28,6 +28,8 @@ "changelog-path": "CHANGELOG.md", "extra-files": [ "Cargo.toml", + "hyperdb-api-core/Cargo.toml", + "hyperdb-api/Cargo.toml", { "type": "json", "path": "hyperdb-mcp/npm/package.json", diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..d917d3e --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.1.2