Skip to content

chore(deps): migrate to famedly-zitadel-rust-client v0.12 - #164

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

chore(deps): migrate to famedly-zitadel-rust-client v0.12#164
nikzen wants to merge 1 commit into
mainfrom
chore/migrate-zitadel-rust-client-v0.12

Conversation

@nikzen

@nikzen nikzen commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates the Zitadel client dependency from famedly-zitadel-rust-client v0.3.0 to v0.12 (currently pinned to 0.12.2 in Cargo.lock), dropping the legacy v1 API feature. This resolves the remaining security advisories on the old dependency line.

Client version status

  • Cargo.toml requires version = "0.12"; Cargo.lock resolves to v0.12.2 (commit 2feabec).
  • v0.12.2 is the latest v0.12.x release upstream. Newer v0.13.x exists (breaking: reqwest_middleware-based client constructor, new update method, create_invite_code), but is intentionally not part of this migration.
  • All APIs this tool uses (create_human_user, add_user_grant, set_user_metadata, search_user_grants, list_users, Token) are unchanged between v0.12.2 and v0.13.1; v0.13's create_invite_code is not yet adopted here — the follow-up fix (fix: Send first-login invitations to provisioned users (FP-295) #166) ships its own raw-HTTP invitation extension, which can migrate to the native method in a later dependency bump.

What changed

  • (deps) Migrate to famedly-zitadel-rust-client v0.12, drop the v1 feature
  • (zitadel) Match Zitadel error codes across the full v2 error chain, restoring the "user already exists" update path and the invalid-phone fallback
  • (tests) Migrate the e2e suite from the gRPC v1 client to the v2 HTTP API

Merge notes

GitHub currently reports this PR as CONFLICTING/DIRTY with main, but the conflicts are confined to version-marker lines:

  • CHANGELOG.md — main gained the 0.11.3 entry; branch carries 0.12.0 on top of 0.11.2
  • Cargo.toml / Cargo.lockversion = "0.11.3" vs 0.12.0 and the dependency lines above
  • src/lib.rs auto-merges; the UKT no-users fix (#65c0759) and the new import_source_user helper touch disjoint regions

Resolution direction: keep the branch's 0.12.0 version and v0.12 dependency, keep main's 0.11.3 entry above 0.12.0 in the changelog (or reorder by date), take main's UKT change in Cargo.lock.

@nikzen
nikzen requested a review from a team as a code owner June 20, 2026 15:49
@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
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.82759% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.90%. Comparing base (01ac2ef) to head (0eb029c).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/zitadel.rs 85.71% 2 Missing ⚠️
src/sources/ldap.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #164      +/-   ##
==========================================
+ Coverage   91.02%   93.90%   +2.88%     
==========================================
  Files          10       10              
  Lines        1604     1657      +53     
==========================================
+ Hits         1460     1556      +96     
+ Misses        144      101      -43     
Files with missing lines Coverage Δ
src/bin/migrate.rs 99.53% <ø> (+2.76%) ⬆️
src/config.rs 99.20% <ø> (ø)
src/lib.rs 91.62% <100.00%> (+11.89%) ⬆️
src/sources/ldap.rs 94.42% <80.00%> (-0.92%) ⬇️
src/zitadel.rs 95.91% <85.71%> (+9.36%) ⬆️

... and 1 file 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 01ac2ef...0eb029c. Read the comment docs.

@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 Outdated
Comment thread CHANGELOG.md Outdated
Comment thread src/zitadel.rs Outdated
Comment thread src/zitadel.rs Outdated
Comment thread src/zitadel.rs Outdated
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)]

@nikzen nikzen Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Keeping #![cfg(test)]: without it the pinned-nightly clippy run (cargo clippy --workspace --all-targets -- -D warnings) fails this target with four clippy::expect_used errors, because the crate-level lint config in Cargo.toml warns on expect_used and CI runs with -D warnings. The attribute keeps the whole file out of the non-test compilation of the test target (the same pattern is already used in tests/e2e.rs and tests/common/mod.rs).

@nikzen nikzen changed the title release: v0.12.0 — migrate to famedly-zitadel-rust-client v0.12 fix: Send first-login invitations to provisioned users (FP-295) Sep 11, 2026
@nikzen
nikzen force-pushed the chore/migrate-zitadel-rust-client-v0.12 branch from 6c1a44a to 21fc327 Compare September 11, 2026 15:29
@nikzen nikzen changed the title fix: Send first-login invitations to provisioned users (FP-295) chore(deps): migrate to famedly-zitadel-rust-client v0.12 Sep 11, 2026
@nikzen
nikzen added this pull request to stack #167 September 11, 2026 15:39
nikzen added a commit that referenced this pull request Sep 12, 2026
- Depend on famedly-zitadel-rust-client from crates.io instead of the git
  repository
- Drop the security-advisory claim from the changelog, as the legacy v1
  client was only used in tests
- Match error codes with {error:?} instead of {error:#}
nikzen added a commit that referenced this pull request Sep 12, 2026
- Depend on famedly-zitadel-rust-client from crates.io instead of the git
  repository
- Drop the security-advisory claim from the changelog, as the legacy v1
  client was only used in tests
- Match error codes with {error:?} instead of {error:#}
@nikzen
nikzen force-pushed the chore/migrate-zitadel-rust-client-v0.12 branch from 30d2951 to 6ee42a8 Compare September 12, 2026 06:50
Replace the legacy zitadel-rust-client v0.3 (gRPC v1 API) with
famedly-zitadel-rust-client v0.12 (v2 HTTP API) from crates.io:

- Resolve the remaining security advisories on the old dependency line
- Match Zitadel error codes across the full v2 error chain, restoring
  the "user already exists" update path and the invalid-phone fallback
- Migrate the e2e suite from the gRPC v1 client to the v2 HTTP API
- Merge main (UKT no-users fix, v0.11.3 release)
- Address PR #164 review comments (crates.io dependency, changelog,
  {error:?} error matching)
- Fix formatting and an ldap3 drive! macro lint for the new CI nightly
  (nightly-2026-09-07)
@nikzen
nikzen force-pushed the chore/migrate-zitadel-rust-client-v0.12 branch from 6ee42a8 to 0eb029c Compare September 12, 2026 07:08
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