From abfa33c5186efb9dfb847a6cbaa86aefbfea09db Mon Sep 17 00:00:00 2001 From: William Chong Date: Mon, 4 May 2026 18:25:04 +0400 Subject: [PATCH 1/3] refactor: rename eventstore-macros to kurrentdb-macros The eventstore-macros crate name on crates.io is no longer under our control. Rename the internal proc-macro crate to kurrentdb-macros so we can publish it under a name we own. Reset the version to 0.0.1 since this is effectively a new crate on crates.io and update the publish workflow accordingly. Closes DEV-1680 --- .github/workflows/publish-macros.yml | 12 ++++++------ Cargo.toml | 2 +- {eventstore-macros => kurrentdb-macros}/Cargo.toml | 6 +++--- {eventstore-macros => kurrentdb-macros}/src/lib.rs | 0 kurrentdb/Cargo.toml | 2 +- kurrentdb/src/operations/mod.rs | 2 +- kurrentdb/src/options/append_to_stream.rs | 2 +- kurrentdb/src/options/batch_append.rs | 2 +- kurrentdb/src/options/delete_stream.rs | 2 +- kurrentdb/src/options/persistent_subscription.rs | 2 +- kurrentdb/src/options/projections.rs | 2 +- kurrentdb/src/options/read_all.rs | 2 +- kurrentdb/src/options/read_stream.rs | 2 +- kurrentdb/src/options/subscribe_to_all.rs | 2 +- kurrentdb/src/options/subscribe_to_stream.rs | 2 +- kurrentdb/src/options/tombstone_stream.rs | 2 +- 16 files changed, 22 insertions(+), 22 deletions(-) rename {eventstore-macros => kurrentdb-macros}/Cargo.toml (78%) rename {eventstore-macros => kurrentdb-macros}/src/lib.rs (100%) diff --git a/.github/workflows/publish-macros.yml b/.github/workflows/publish-macros.yml index bf329271..c710d7c5 100644 --- a/.github/workflows/publish-macros.yml +++ b/.github/workflows/publish-macros.yml @@ -1,4 +1,4 @@ -name: Publish eventstore-macros +name: Publish kurrentdb-macros on: workflow_dispatch: @@ -15,18 +15,18 @@ jobs: - name: Verify version is new run: | LOCAL=$(cargo metadata --no-deps --format-version 1 \ - | jq -r '.packages[] | select(.name=="eventstore-macros") | .version') - REMOTE=$(cargo search eventstore-macros --limit 1 \ - | sed -nE 's/^eventstore-macros = "([^"]+)".*/\1/p') + | jq -r '.packages[] | select(.name=="kurrentdb-macros") | .version') + REMOTE=$(cargo search kurrentdb-macros --limit 1 \ + | sed -nE 's/^kurrentdb-macros = "([^"]+)".*/\1/p') echo "local=$LOCAL remote=$REMOTE" if [ "$LOCAL" = "$REMOTE" ]; then - echo "Version $LOCAL is already published on crates.io. Bump eventstore-macros/Cargo.toml first." + echo "Version $LOCAL is already published on crates.io. Bump kurrentdb-macros/Cargo.toml first." exit 1 fi - uses: rust-lang/crates-io-auth-action@v1 id: auth - - run: cargo publish -p eventstore-macros + - run: cargo publish -p kurrentdb-macros env: CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} diff --git a/Cargo.toml b/Cargo.toml index a6e69054..9786f6e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,6 @@ members = [ "kurrentdb-extras", # internals - "eventstore-macros", + "kurrentdb-macros", "examples" ] diff --git a/eventstore-macros/Cargo.toml b/kurrentdb-macros/Cargo.toml similarity index 78% rename from eventstore-macros/Cargo.toml rename to kurrentdb-macros/Cargo.toml index e44e181c..c9bb2e31 100644 --- a/eventstore-macros/Cargo.toml +++ b/kurrentdb-macros/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "eventstore-macros" -version = "0.0.2" +name = "kurrentdb-macros" +version = "0.0.1" edition = "2021" license = "MIT" -description = "Extra KurrentDB gRPC client internal code generation features" +description = "Internal proc-macros for the KurrentDB Rust client" keywords = ["database", "eventsourcing", "eventstore", "kurrent", "grpc"] repository = "https://github.com/kurrent-io/KurrentDB-Client-Rust" categories = ["database", "api-bindings"] diff --git a/eventstore-macros/src/lib.rs b/kurrentdb-macros/src/lib.rs similarity index 100% rename from eventstore-macros/src/lib.rs rename to kurrentdb-macros/src/lib.rs diff --git a/kurrentdb/Cargo.toml b/kurrentdb/Cargo.toml index f1b14ca5..1613c56b 100755 --- a/kurrentdb/Cargo.toml +++ b/kurrentdb/Cargo.toml @@ -28,7 +28,7 @@ chrono = { version = "0.4", default-features = false, features = [ "serde", "now", ] } -eventstore-macros = { path = "../eventstore-macros", version = "0.0.2" } +kurrentdb-macros = { path = "../kurrentdb-macros", version = "0.0.1" } futures = "0.3" http = "1" hyper = { version = "1", features = ["client"] } diff --git a/kurrentdb/src/operations/mod.rs b/kurrentdb/src/operations/mod.rs index c9e7ca7f..82a9293d 100644 --- a/kurrentdb/src/operations/mod.rs +++ b/kurrentdb/src/operations/mod.rs @@ -1,4 +1,4 @@ -use eventstore_macros::{options, streaming}; +use kurrentdb_macros::{options, streaming}; use futures::stream::TryStreamExt; use std::time::SystemTime; use std::{collections::HashMap, time::Duration}; diff --git a/kurrentdb/src/options/append_to_stream.rs b/kurrentdb/src/options/append_to_stream.rs index 8c7e6429..b86a1fca 100644 --- a/kurrentdb/src/options/append_to_stream.rs +++ b/kurrentdb/src/options/append_to_stream.rs @@ -1,7 +1,7 @@ use crate::event_store::client::streams::append_req::options::ExpectedStreamRevision; use crate::private::Sealed; use crate::{EventData, StreamState}; -use eventstore_macros::options; +use kurrentdb_macros::options; options! { #[derive(Clone)] diff --git a/kurrentdb/src/options/batch_append.rs b/kurrentdb/src/options/batch_append.rs index 6ba44747..74a1f7d3 100644 --- a/kurrentdb/src/options/batch_append.rs +++ b/kurrentdb/src/options/batch_append.rs @@ -1,4 +1,4 @@ -use eventstore_macros::{options, streaming}; +use kurrentdb_macros::{options, streaming}; options! { #[derive(Clone, Default)] diff --git a/kurrentdb/src/options/delete_stream.rs b/kurrentdb/src/options/delete_stream.rs index 20282fd3..31eb355a 100644 --- a/kurrentdb/src/options/delete_stream.rs +++ b/kurrentdb/src/options/delete_stream.rs @@ -1,5 +1,5 @@ use crate::StreamState; -use eventstore_macros::options; +use kurrentdb_macros::options; options! { #[derive(Clone)] diff --git a/kurrentdb/src/options/persistent_subscription.rs b/kurrentdb/src/options/persistent_subscription.rs index 0315d50d..cbb03e0f 100644 --- a/kurrentdb/src/options/persistent_subscription.rs +++ b/kurrentdb/src/options/persistent_subscription.rs @@ -2,7 +2,7 @@ use crate::{ PersistentSubscriptionSettings, Position, StreamPosition, SubscriptionFilter, SystemConsumerStrategy, }; -use eventstore_macros::{options, streaming}; +use kurrentdb_macros::{options, streaming}; use std::time::Duration; options! { diff --git a/kurrentdb/src/options/projections.rs b/kurrentdb/src/options/projections.rs index 89035d0f..b2711ff6 100644 --- a/kurrentdb/src/options/projections.rs +++ b/kurrentdb/src/options/projections.rs @@ -1,4 +1,4 @@ -use eventstore_macros::options; +use kurrentdb_macros::options; options! { #[derive(Clone, Default)] diff --git a/kurrentdb/src/options/read_all.rs b/kurrentdb/src/options/read_all.rs index d8a72710..f1e8229a 100644 --- a/kurrentdb/src/options/read_all.rs +++ b/kurrentdb/src/options/read_all.rs @@ -1,5 +1,5 @@ use crate::{Position, ReadDirection, StreamPosition, SubscriptionFilter}; -use eventstore_macros::{options, streaming}; +use kurrentdb_macros::{options, streaming}; options! { #[derive(Clone)] diff --git a/kurrentdb/src/options/read_stream.rs b/kurrentdb/src/options/read_stream.rs index 8ff045ef..2d63bc44 100644 --- a/kurrentdb/src/options/read_stream.rs +++ b/kurrentdb/src/options/read_stream.rs @@ -1,5 +1,5 @@ use crate::{ReadDirection, StreamPosition}; -use eventstore_macros::{options, streaming}; +use kurrentdb_macros::{options, streaming}; options! { #[derive(Clone)] diff --git a/kurrentdb/src/options/subscribe_to_all.rs b/kurrentdb/src/options/subscribe_to_all.rs index e34faddc..8cb3a2cc 100644 --- a/kurrentdb/src/options/subscribe_to_all.rs +++ b/kurrentdb/src/options/subscribe_to_all.rs @@ -1,6 +1,6 @@ use crate::options::retry::RetryOptions; use crate::{Position, StreamPosition, SubscriptionFilter}; -use eventstore_macros::{options, streaming}; +use kurrentdb_macros::{options, streaming}; options! { #[derive(Clone)] diff --git a/kurrentdb/src/options/subscribe_to_stream.rs b/kurrentdb/src/options/subscribe_to_stream.rs index 98d18c34..c98c2b0c 100644 --- a/kurrentdb/src/options/subscribe_to_stream.rs +++ b/kurrentdb/src/options/subscribe_to_stream.rs @@ -1,6 +1,6 @@ use crate::StreamPosition; use crate::options::retry::RetryOptions; -use eventstore_macros::{options, streaming}; +use kurrentdb_macros::{options, streaming}; options! { #[derive(Clone)] diff --git a/kurrentdb/src/options/tombstone_stream.rs b/kurrentdb/src/options/tombstone_stream.rs index a611b7f0..725296d2 100644 --- a/kurrentdb/src/options/tombstone_stream.rs +++ b/kurrentdb/src/options/tombstone_stream.rs @@ -1,5 +1,5 @@ use crate::StreamState; -use eventstore_macros::options; +use kurrentdb_macros::options; options! { #[derive(Clone)] From b420bfbbefe2bd573182e08712e55872e004d1d8 Mon Sep 17 00:00:00 2001 From: William Chong Date: Tue, 5 May 2026 10:54:41 +0400 Subject: [PATCH 2/3] ci: publish kurrentdb-macros via API token instead of OIDC Switch the manual publish workflow from `rust-lang/crates-io-auth-action` (OIDC trusted publishing) to a `CARGO_REGISTRY_TOKEN` repository secret. The previous OIDC config was tied to an account we no longer have access to, so we publish under a different account using a plain API token. --- .github/workflows/publish-macros.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/publish-macros.yml b/.github/workflows/publish-macros.yml index c710d7c5..48270b29 100644 --- a/.github/workflows/publish-macros.yml +++ b/.github/workflows/publish-macros.yml @@ -7,8 +7,6 @@ jobs: publish: runs-on: ubuntu-latest environment: CRATES_IO_TOKEN - permissions: - id-token: write steps: - uses: actions/checkout@v4 @@ -24,9 +22,6 @@ jobs: exit 1 fi - - uses: rust-lang/crates-io-auth-action@v1 - id: auth - - run: cargo publish -p kurrentdb-macros env: - CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From 89059ddf8c78ea2a62fa5b3a37728b0120bfba80 Mon Sep 17 00:00:00 2001 From: William Chong Date: Tue, 5 May 2026 11:05:07 +0400 Subject: [PATCH 3/3] style: reorder kurrentdb_macros import to satisfy rustfmt --- kurrentdb/src/operations/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kurrentdb/src/operations/mod.rs b/kurrentdb/src/operations/mod.rs index 82a9293d..2f5ffd08 100644 --- a/kurrentdb/src/operations/mod.rs +++ b/kurrentdb/src/operations/mod.rs @@ -1,5 +1,5 @@ -use kurrentdb_macros::{options, streaming}; use futures::stream::TryStreamExt; +use kurrentdb_macros::{options, streaming}; use std::time::SystemTime; use std::{collections::HashMap, time::Duration};