You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: CLI - send invitation analytics events from zitadel invitation create and cancel - #2932
Closes#2859 for the CLI (ADR 086 §9). Stacked on #2929.
zitadel invitation create, including --replaces, sends invitation_created once the API confirms the create, with role (project_viewer, project_editor, project_admin; team_member later) and invitation_journey_id. It replaces the role/is_replace dimensions feat: CLI - add zitadel invitation create, list, get and cancel #2929 records.
zitadel invitation cancel sends invitation_cancelled with the same properties once the API confirms the cancel, per a dated amendment to ADR 086: without it a cancelled journey reads as one nobody opened. The cancel answers 204, so the command now reads the invitation before confirming; the question names who it is for and its role, and an accepted or expired invitation is refused before anything is asked. A declined invitation is removed without an event: its journey already ended with invitation_rejected.
BaseCommand.trackEvent sends a product event with the header and context every CLI event carries, behind the same consent gate.
product-analytics-events.yaml lists the CLI's two events as emitted, the console's invitation_created, invitation_accepted, invitation_rejected and invitation_cancelled as planned (Analytics: invitation events #2859), and the invitation_journey_id property.
catalog.test.ts holds every trackEvent call's properties to the catalog.
The telemetry docs page and apps/cli/AGENTS.md say when a command sends an event of its own.
Notes
The Vercel sink copies every event, so the catalog lists [mixpanel, vercel]. The copy keeps only the eight header keys, never the journey id. Restricting it to Mixpanel would need a sink filter.
Mixpanel is paused, so nothing reaches it until its region is fixed.
Hand-written commands over the invitations contract (#2849), in a new
Project administration help group. The link appears only in create's
output; telemetry records the role and whether it replaced one.
Refs #2858
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CLI loads commands from an explicit COMMANDS table, so the
invitation commands were unreachable and missing from the reference
and the docs. Adds the topic and its help group row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Implements the CLI half of #2859 (ADR 086 §9): after the API confirms a
create or replace, the command sends invitation_created with role and
invitation_journey_id through a new BaseCommand.trackEvent, replacing
the role/is_replace dimensions. The catalog lists the CLI event as
emitted and the console's three invitation events as planned, and a
catalog test holds every trackEvent call's properties to the catalog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ADR 086 gains a dated amendment: a cancelled journey ended at
invitation_created and read as one nobody opened. invitation cancel now
reads the invitation before confirming, names it in the question,
refuses one that is no longer pending, and sends invitation_cancelled
with role and invitation_journey_id after the delete. The catalog lists
it emitted for the CLI and planned for the console.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vitorbari
changed the title
feat: send invitation_created from zitadel invitation create
feat: send invitation analytics events from zitadel invitation create and cancel
Nov 10, 2026
vitorbari
changed the title
feat: send invitation analytics events from zitadel invitation create and cancel
feat: CLI - send invitation analytics events from zitadel invitation create and cancel
Nov 11, 2026
A dry run now answers with the request it would send. --replaces reads
the original first: an accepted one is refused before anything is
asked, and a replacement without --name keeps the original's name, as
the server does. The name prompt asks one question, and list gains a
unit test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dry run of invitation cancel <id> now reads nothing: the read that
names the invitation in the question moves into prepare. Also lists the
amendment in the ADR index, fixes the telemetry page's grammar, and
adds a changeset for the invitation events.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- create --dry-run answers before connecting or reading the original.
- cancel --dry-run needs the id instead of reading the pending list.
- The printed link and the picker's hints are escaped for the terminal.
- --name counts characters, as the API's maxLength does.
- The API reference's CLI samples spell invitation create and list
with their flags, and fall back to the api call for team invitations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A non-interactive run, like a dry run, now refuses an omitted id before
reading the pending list, so a down server cannot hide the missing
input. Regenerates the CLI README, which lacked the invitation commands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-ups and retries are { id, flags } suggestions, refusals take no
suggester, list declares --all's exclusion through relatedFlags, and its
page carries only the token. Regenerates the CLI README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adapt the invitation commands to main: the task-based help groups put
them under Users and access, the test fixtures moved to tests/fixtures,
and the invitation contract now names the path parameter invitation_id,
reports responded_by/responded_at and takes status as a list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…analytics
The server now deletes a declined invitation on cancel, so `invitation
cancel` accepts one too and sends invitation_cancelled only for a pending
invitation: a declined journey already ended with invitation_rejected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-list-contract
The invitation contract landed on main, so the API, ADR and generated
files take main's versions and this branch keeps only the CLI changes:
the list's default statuses and repeated --status, and the cancel picker
offering declined invitations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Cancellation telemetry relies on stale invitation status and can distort acceptance-rate metrics, while event emission and opt-out behavior lack runtime tests.
A list that found nothing drops its footer, so the empty message carries
the hint. The docs' sample for an unfiltered invitation list names every
status, since the command alone leaves accepted ones out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trackEvent sends the event with its properties and the command's context,
and nothing when telemetry is off. invitation cancel sends
invitation_cancelled once a pending invitation is cancelled, and none for
a declined one, a failed cancel, a dry run or a declined confirmation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The new invitation_created event lacks command-level tests for delivery timing, response properties, and non-emitting paths, while the release note misstates cancellation behavior for rejected invitations.
The new invitation_created emission has no command-level assertions: create.test.ts covers prompts, replacement and dry runs, while the catalog test checks only property names and the base-command tests invoke trackEvent directly. Add create-command tests verifying one event after a successful create and replacement, using the response's role and journey ID, and no event after a failed create, dry run or declined confirmation. This protects the delivery timing and replacement correlation that this PR introduces.
Clarify cancellation behavior in the release note
.changeset/cli-invitation-analytics.md:5
The release note says cancellation refuses every invitation that is no longer pending, but readCancellable explicitly allows rejected invitations, and the new integration test verifies their removal. It also implies every successful cancel sends an event, although rejected invitations deliberately send none. Please distinguish pending cancellations from declined-record removal so the published changelog describes the actual behavior.
The invitation analytics now stack on top of this branch instead of under
it, so this branch keeps only the list's default statuses and the cancel
flow: the read before the question, the refusal of an accepted or expired
invitation, and the picker offering declined ones.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restores the invitation analytics on top of the list and cancel-flow
branch, which now merges first: trackEvent, invitation_created and
invitation_cancelled, the catalog, the ADR 086 amendment and their tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #2929 — merge after it.
Summary
Closes #2859 for the CLI (ADR 086 §9). Stacked on #2929.
zitadel invitation create, including--replaces, sendsinvitation_createdonce the API confirms the create, withrole(project_viewer,project_editor,project_admin;team_memberlater) andinvitation_journey_id. It replaces therole/is_replacedimensions feat: CLI - add zitadel invitation create, list, get and cancel #2929 records.zitadel invitation cancelsendsinvitation_cancelledwith the same properties once the API confirms the cancel, per a dated amendment to ADR 086: without it a cancelled journey reads as one nobody opened. The cancel answers204, so the command now reads the invitation before confirming; the question names who it is for and its role, and an accepted or expired invitation is refused before anything is asked. A declined invitation is removed without an event: its journey already ended withinvitation_rejected.BaseCommand.trackEventsends a product event with the header and context every CLI event carries, behind the same consent gate.product-analytics-events.yamllists the CLI's two events asemitted, the console'sinvitation_created,invitation_accepted,invitation_rejectedandinvitation_cancelledasplanned(Analytics: invitation events #2859), and theinvitation_journey_idproperty.catalog.test.tsholds everytrackEventcall's properties to the catalog.apps/cli/AGENTS.mdsay when a command sends an event of its own.Notes
[mixpanel, vercel]. The copy keeps only the eight header keys, never the journey id. Restricting it to Mixpanel would need a sink filter.🤖 Generated with Claude Code