Skip to content

release: v0.12.0 — migrate to famedly-zitadel-rust-client v0.12#164

Open
nikzen wants to merge 4 commits into
mainfrom
chore/migrate-zitadel-rust-client-v0.12
Open

release: v0.12.0 — migrate to famedly-zitadel-rust-client v0.12#164
nikzen wants to merge 4 commits into
mainfrom
chore/migrate-zitadel-rust-client-v0.12

Conversation

@nikzen

@nikzen nikzen commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Bump the Zitadel client from legacy zitadel-rust-client v0.3 to famedly-zitadel-rust-client v0.12 and migrate the e2e tests off the gRPC v1 API onto the v2 HTTP API, dropping the v1 dev-dependency feature that carried the remaining security advisories (cargo audit now clean).
  • Fix two error-handling regressions in src/zitadel.rs surfaced by running e2e against the v2 production code: the v2 client exposes Zitadel error codes (V3-DKcYh, PHONE-so0wa, COMMAND-ieJ2e) as a source in the error chain rather than in the top-level Display. Match against the full chain via {error:#} to restore the "user already exists" update path and the invalid-phone fallback in both import_user and update_user.
  • Add a ZitadelExt test helper trait and rewrite the e2e suite to use v2 idioms (Option semantics, human()/profile()/is_verified() accessors, login-name lookup, grants, IDP links).
  • Release v0.12.0: bump Cargo.toml/Cargo.lock and add a CHANGELOG.md entry.

Closes: https://famedly.atlassian.net/browse/FC-554

Bump the Zitadel client from the legacy zitadel-rust-client v0.3 to
famedly-zitadel-rust-client v0.12 and migrate the e2e test suite off the
gRPC v1 API onto the v2 HTTP API, dropping the v1 dev-dependency feature
that carried the remaining security advisories.

Fix two error-handling regressions in src/zitadel.rs surfaced by running
the e2e suite against the v2 production code: the v2 client exposes
Zitadel error codes (V3-DKcYh, PHONE-so0wa, COMMAND-ieJ2e) as a source in
the error chain rather than in the top-level Display. Match against the
full chain via `{error:#}` to restore the "user already exists" update
path and the invalid-phone fallback in both import_user and update_user.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nikzen
nikzen requested a review from a team as a code owner June 20, 2026 15:49
Co-authored-by: Cursor <cursoragent@cursor.com>
@nikzen nikzen changed the title chore(deps): migrate to famedly-zitadel-rust-client v0.12 release: v0.12.0 — migrate to famedly-zitadel-rust-client v0.12 Jun 20, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.22642% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.99%. Comparing base (13f740d) to head (21fc327).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/zitadel.rs 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #164      +/-   ##
==========================================
+ Coverage   91.37%   91.99%   +0.61%     
==========================================
  Files          10       10              
  Lines        1600     1648      +48     
==========================================
+ Hits         1462     1516      +54     
+ Misses        138      132       -6     
Files with missing lines Coverage Δ
src/lib.rs 90.85% <100.00%> (+11.00%) ⬆️
src/zitadel.rs 88.05% <85.71%> (+1.50%) ⬆️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13f740d...21fc327. Read the comment docs.

The pinned CI nightly denies these pedantic lints via `-D warnings`.

- Extract import/delete/update arms of `sync_users` into helper functions.
- Hoist test-local items (fixtures, helpers) to module scope, since the
  test macros emit statements before them, tripping items_after_statements.
- Split the long install-ids/UKT test bodies into seeding helpers and add
  `#![cfg(test)]` to install-ids.rs so expect-in-tests is allowed.

Co-authored-by: Cursor <cursoragent@cursor.com>

@sirewix sirewix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok on the surface, but there are so many changes in test code. If we want to verify everything it will take a lot of time

Comment thread Cargo.toml
uuid = { version = "1.10.0", features = ["v5"] }
wiremock = "0.6.2"
zitadel-rust-client = { git = "https://github.com/famedly/zitadel-rust-client", version = "0.3.0", default-features = false }
zitadel-rust-client = { git = "https://github.com/famedly/zitadel-rust-client", package = "famedly-zitadel-rust-client", version = "0.12", default-features = false }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the version from crates.io

Comment thread CHANGELOG.md

### Miscellaneous Tasks

- *(deps)* Migrate to famedly-zitadel-rust-client v0.12 and drop the v1 feature, resolving the remaining security advisories

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was only used in tests, so probably there was no real security issues

Comment thread src/zitadel.rs
// error code we match on below) as a source in the error chain,
// so we must inspect the full chain rather than just the
// top-level `Display`.
let error_chain = format!("{error:#}");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let error_chain = format!("{error:#}");
let error_chain = format!("{error:?}");

Comment thread src/zitadel.rs
// error chain, so we match against the whole chain.
// If the new phone number is invalid
if error.to_string().contains("PHONE-so0wa") {
if format!("{error:#}").contains("PHONE-so0wa") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if format!("{error:#}").contains("PHONE-so0wa") {
if format!("{error:?}").contains("PHONE-so0wa") {

Comment thread src/zitadel.rs
if let Err(error) = self.zitadel_client.remove_phone(zitadel_id).await {
// If the user didn't start out with a phone
if !error.to_string().contains("COMMAND-ieJ2e") {
if !format!("{error:#}").contains("COMMAND-ieJ2e") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if !format!("{error:#}").contains("COMMAND-ieJ2e") {
if !format!("{error:?}").contains("COMMAND-ieJ2e") {

Comment thread tests/install-ids.rs
@@ -1,5 +1,7 @@
//! E2E tests for the id installation script

#![cfg(test)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#![cfg(test)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants