Skip to content

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.

feat(events): report project creation with the id minted for it (#7074)

João Moura9e9a8577becc
diff --git a/docs/edge/ar/telemetry.mdx b/docs/edge/ar/telemetry.mdx
index 3e04bddc2..cdea46640 100644
--- a/docs/edge/ar/telemetry.mdx
+++ b/docs/edge/ar/telemetry.mdx
@@ -59,6 +59,7 @@ os.environ['OTEL_SDK_DISABLED'] = 'true'
| نعم | بيانات تنفيذ الاختبار | تشمل: مفتاح ومعرّف الطاقم المُولّد عشوائياً، عدد التكرارات، اسم النموذج المستخدم، درجة الجودة (عدد عشري)، وقت التنفيذ (بالثواني). كلها غير شخصية. |
| نعم | بيانات دورة حياة المهمة | تشمل: أوقات الإنشاء وبدء/انتهاء التنفيذ، معرّفات الطاقم والمهمة. مخزنة كنطاقات مع طوابع زمنية. لا بيانات شخصية. |
| نعم | سمات LLM | تشمل: الاسم، model_name، model، top_k، temperature، واسم فئة LLM. كلها بيانات تقنية غير شخصية. |
+| نعم | إنشاء مشروع باستخدام CLI الخاص بـ CrewAI | تشمل: أن مشروعًا جديدًا أُنشئ عبر `crewai create`، ونوعه (`crew` أو `json_crew` أو `flow`)، ومعرّف المشروع الذي تم توليده لهذا المشروع الجديد وكُتب في ملف `pyproject.toml` الخاص به. وهو معرّف المشروع الجديد نفسه، ويُسجَّل بشكل منفصل عن `project_id` الخاص بالمجلد الذي شُغّل منه الأمر — وقد يختلفان. لا اسم مشروع، ولا محتويات ملفات، ولا شيفرة. لا بيانات شخصية. |
| نعم | محاولة نشر الطاقم باستخدام CLI الخاص بـ CrewAI | تشمل: حقيقة إجراء النشر ومعرّف الطاقم، وما إذا كان يحاول سحب السجلات، وما إذا بدأ النشر من أمر CLI أو من واجهة التشغيل TUI. لا تُسجَّل محتويات المشروع أو الطاقم. لا توجد بيانات شخصية. |
| نعم | بيئة التنفيذ | تشمل: مساعد البرمجة بالذكاء الاصطناعي الذي يشغّل العملية إن وُجد (واحد من قائمة ثابتة مثل `claude_code` أو `codex` أو `cursor` أو `unknown`)، ومكان تشغيل العملية (واحد من قائمة ثابتة مثل `ci` أو `container` أو `serverless` أو `interactive`)، و`project_id` من ملف `pyproject.toml` عند ضبطه. يتحقق الاكتشاف فقط مما إذا كانت متغيرات البيئة المعروفة مضبوطة، ولا يقرأ قيمها أبدًا. لا بيانات شخصية. |
| نعم | إشارات دورة حياة التدفق | تشمل: بدء التدفق، وما إذا اكتمل أو فشل، وما إذا فشلت إحدى طرقه، وما إذا توقف مؤقتًا لانتظار إدخال أو ملاحظات بشرية، وما إذا كان البدء تشغيلًا مستأنفًا، وما إذا فشل دور محادثة، ومدة تشغيل التدفق، وما إذا كان التدفق مما تشغّله CrewAI داخليًا أو مما كتبته أنت. ويُسجَّل اسم التدفق، كما هو الحال بالفعل لإنشاء التدفق وتنفيذه. وعند فشل تدفق أو إحدى طرقه، يُسجَّل **اسم فئة** الاستثناء (مثل `TimeoutError`) لتشخيص الأعطال — ولا تُسجَّل أبدًا رسالة الخطأ، التي قد تحتوي على مطالبات أو مخرجات النموذج أو مسارات ملفات أو بيانات اعتماد. ولا تُسجَّل أبدًا أسماء الطرق أو حالة التدفق. لا توجد بيانات شخصية. |
diff --git a/docs/edge/en/telemetry.mdx b/docs/edge/en/telemetry.mdx
index b05dccf5d..ccef2712b 100644
--- a/docs/edge/en/telemetry.mdx
+++ b/docs/edge/en/telemetry.mdx
@@ -59,6 +59,7 @@ own tracer provider, which is independent of the one described here.
| Yes | Test Execution Data | Includes: crew's randomly generated key and ID, number of iterations, model name used, quality score (float), execution time (in seconds). All non-personal. |
| Yes | Task Lifecycle Data | Includes: creation and execution start/end times, crew and task identifiers. Stored as spans with timestamps. No personal data. |
| Yes | LLM Attributes | Includes: name, model_name, model, top_k, temperature, and class name of the LLM. All technical, non-personal data. |
+| Yes | Project Creation using crewAI CLI | Includes: that a new project was scaffolded by `crewai create`, which kind it was (`crew`, `json_crew` or `flow`), and the project ID minted for that new project and written into its own `pyproject.toml`. That is the new project's own ID, recorded separately from the `project_id` of the directory the command was run from — the two can differ. No project name, no file contents, no code. No personal data. |
| Yes | Crew Deployment attempt using crewAI CLI | Includes: The fact a deploy is being made and crew id, whether it's trying to pull logs, and whether the deploy was started from a CLI command or from the run TUI. No project or crew contents. No personal data. |
| Yes | Execution Environment | Includes: which AI coding assistant is running the process, if any (one of a fixed list such as `claude_code`, `codex`, `cursor`, or `unknown`), where the process runs (one of a fixed list such as `ci`, `container`, `serverless`, `interactive`), and the `project_id` from your `pyproject.toml` when one is configured. Detection reads only whether known environment variables are set, never their values. No personal data. |
| Yes | Flow Lifecycle Signals | Includes: that a flow started, whether it completed or failed, whether one of its methods failed, whether it paused for human input or feedback, whether the start was a resumed run, whether a conversation turn failed, how long the flow ran, and whether the flow is one CrewAI runs internally or one you wrote. The flow name is recorded, as it already is for flow creation and execution. When a flow or one of its methods fails, the **class name** of the exception is recorded (for example `TimeoutError`) so that failures can be diagnosed — never the error message, which can contain prompts, model output, file paths or credentials. Method names and flow state are never recorded. No personal data. |
diff --git a/docs/edge/ko/telemetry.mdx b/docs/edge/ko/telemetry.mdx
index 0c58f3fb4..4ffd857a7 100644
--- a/docs/edge/ko/telemetry.mdx
+++ b/docs/edge/ko/telemetry.mdx
@@ -57,6 +57,7 @@ provider로 등록하지 않습니다. 이를 통해 양방향이 분리됩니
| 예 | 테스트 실행 데이터 | crew의 랜덤 생성 키와 ID, 반복 횟수, 사용된 모델명, 품질 점수(실수), 실행 시간(초 단위)이 포함됩니다. 모두 비개인 정보입니다. |
| 예 | 작업 라이프사이클 데이터 | 생성 및 실행 시작/종료 시각, crew 및 작업 식별자가 포함됩니다. 타임스탬프를 포함한 span으로 저장됩니다. 개인 정보 없음. |
| 예 | LLM 속성 | LLM의 이름, model_name, 모델, top_k, temperature 및 클래스명이 포함됩니다. 모두 기술적이고 비개인 정보입니다. |
+| 예 | crewAI CLI를 통한 프로젝트 생성 | 포함 항목: `crewai create`로 새 프로젝트가 생성되었다는 사실, 그 종류(`crew`, `json_crew` 또는 `flow`), 그리고 그 새 프로젝트에 발급되어 해당 프로젝트의 `pyproject.toml`에 기록된 프로젝트 ID. 이는 새 프로젝트 자체의 ID이며, 명령을 실행한 디렉터리의 `project_id`와는 별개로 기록됩니다 — 두 값은 다를 수 있습니다. 프로젝트 이름, 파일 내용, 코드는 기록되지 않습니다. 개인 정보 없음. |
| 예 | crewAI CLI를 통한 Crew 배포 시도 | 포함 항목: 배포가 시도되고 있다는 사실과 crew id, 로그를 가져오려고 하는지 여부, 그리고 배포가 CLI 명령에서 시작되었는지 실행 TUI에서 시작되었는지 여부. 프로젝트나 crew의 내용은 기록되지 않습니다. 개인 정보 없음. |
| 예 | 실행 환경 | 포함: 프로세스를 실행 중인 AI 코딩 어시스턴트(있는 경우, `claude_code`, `codex`, `cursor`, `unknown` 등 고정 목록 중 하나), 프로세스가 실행되는 위치(`ci`, `container`, `serverless`, `interactive` 등 고정 목록 중 하나), 그리고 `pyproject.toml`에 설정된 경우 `project_id`. 감지는 알려진 환경 변수의 설정 여부만 확인하며 값은 읽지 않음. 개인 데이터 없음. |
| 예 | Flow 라이프사이클 신호 | 포함 항목: flow의 시작, 완료 또는 실패 여부, 해당 메서드의 실패 여부, 사람의 입력이나 피드백을 위해 일시 중지되었는지 여부, 해당 시작이 재개된 실행이었는지 여부, 대화 턴의 실패 여부, flow 실행 시간, 그리고 해당 flow가 CrewAI가 내부적으로 실행하는 것인지 사용자가 작성한 것인지 여부. flow 이름은 flow 생성 및 실행에서와 마찬가지로 기록됩니다. flow 또는 해당 메서드가 실패하면 장애 진단을 위해 예외의 **클래스 이름**(예: `TimeoutError`)이 기록되며, 프롬프트·모델 출력·파일 경로·자격 증명이 포함될 수 있는 오류 메시지는 절대 기록되지 않습니다. 메서드 이름과 flow 상태는 절대 기록되지 않습니다. 개인 정보 없음. |
diff --git a/docs/edge/pt-BR/telemetry.mdx b/docs/edge/pt-BR/telemetry.mdx
index ce6129fa6..84b37286f 100644
--- a/docs/edge/pt-BR/telemetry.mdx
+++ b/docs/edge/pt-BR/telemetry.mdx
@@ -59,6 +59,7 @@ por meio do próprio tracer provider, que é independente do descrito aqui.
| Sim | Dados de Execução de Testes | Inclui: chave e ID aleatórias do crew, número de iterações, nome do modelo usado, score de qualidade (float), tempo de execução (em segundos). Tudo não pessoal. |
| Sim | Dados do Ciclo de Vida da Tarefa | Inclui: horários de criação, início/fim de execução, identificadores de crew e tarefa. Armazenado como spans com timestamps. Sem dados pessoais. |
| Sim | Atributos do LLM | Inclui: nome, model_name, model, top_k, temperatura e nome da classe do LLM. Todos técnicos, sem dados pessoais. |
+| Sim | Criação de Projeto pelo CLI do crewAI | Inclui: o fato de um novo projeto ter sido criado por `crewai create`, de qual tipo ele é (`crew`, `json_crew` ou `flow`) e o ID de projeto gerado para esse novo projeto e gravado no `pyproject.toml` dele. É o ID do próprio projeto novo, registrado separadamente do `project_id` do diretório de onde o comando foi executado — os dois podem diferir. Sem nome de projeto, sem conteúdo de arquivos, sem código. Sem dados pessoais. |
| Sim | Tentativa de Deploy do Crew pelo CLI do crewAI | Inclui: O fato de um deploy estar sendo realizado e o crew id, se está tentando buscar logs, e se o deploy foi iniciado por um comando do CLI ou pela TUI de execução. Não inclui conteúdo do projeto ou do crew nem dados pessoais. |
| Sim | Ambiente de Execução | Inclui: qual assistente de código com IA está executando o processo, se houver (um de uma lista fixa como `claude_code`, `codex`, `cursor` ou `unknown`), onde o processo é executado (um de uma lista fixa como `ci`, `container`, `serverless`, `interactive`) e o `project_id` do seu `pyproject.toml` quando houver um configurado. A detecção lê apenas se variáveis de ambiente conhecidas estão definidas, nunca seus valores. Sem dados pessoais. |
| Sim | Sinais de Ciclo de Vida do Flow | Inclui: que um flow iniciou, se foi concluído ou falhou, se um de seus métodos falhou, se pausou para entrada ou feedback humano, se o início foi uma execução retomada, se um turno de conversa falhou, quanto tempo o flow executou, e se o flow é um que a CrewAI executa internamente ou um que você escreveu. O nome do flow é registrado, como já é para criação e execução de flow. Quando um flow ou um de seus métodos falha, o **nome da classe** da exceção é registrado (por exemplo `TimeoutError`) para permitir o diagnóstico de falhas — nunca a mensagem de erro, que pode conter prompts, saída do modelo, caminhos de arquivo ou credenciais. Nomes de métodos e estado do flow nunca são registrados. Nenhum dado pessoal. |
diff --git a/lib/cli/src/crewai_cli/create_crew.py b/lib/cli/src/crewai_cli/create_crew.py
index 334c398f2..d398d20bc 100644
--- a/lib/cli/src/crewai_cli/create_crew.py
+++ b/lib/cli/src/crewai_cli/create_crew.py
@@ -3,6 +3,7 @@ import shutil
import sys
import click
+from crewai_core.telemetry import Telemetry
import tomli
from crewai_cli.constants import ENV_VARS, MODELS
@@ -322,7 +323,10 @@ def create_crew(
if not parent_folder:
# Minted at creation so the project has a stable identity from run one.
- get_or_create_project_id(folder_path / "pyproject.toml")
+ project_id = get_or_create_project_id(folder_path / "pyproject.toml")
+ # Emitted only here, not in the parent_folder branch: that branch adds a crew to
+ # an existing project, which is not an acquisition and mints no id.
+ Telemetry().project_created_span("crew", project_id)
initialize_if_git_available(folder_path)
click.secho(f"Crew {name} created successfully!", fg="green", bold=True)
diff --git a/lib/cli/src/crewai_cli/create_flow.py b/lib/cli/src/crewai_cli/create_flow.py
index 8345c95f4..eb5797230 100644
--- a/lib/cli/src/crewai_cli/create_flow.py
+++ b/lib/cli/src/crewai_cli/create_flow.py
@@ -33,7 +33,9 @@ def create_flow(name: str, *, declarative: bool = False) -> None:
_create_python_flow(name, class_name, folder_name, project_root)
# Minted at creation so the project has a stable identity from run one.
- get_or_create_project_id(project_root / "pyproject.toml")
+ project_id = get_or_create_project_id(project_root / "pyproject.toml")
+ # After the mint, unlike flow_creation_span above, which fires before the id exists.
+ telemetry.project_created_span("flow", project_id)
initialize_if_git_available(project_root)
click.secho(f"Flow {name} created successfully!", fg="green", bold=True)
diff --git a/lib/cli/src/crewai_cli/create_json_crew.py b/lib/cli/src/crewai_cli/create_json_crew.py
index d3aa74102..ccbefa5df 100644
--- a/lib/cli/src/crewai_cli/create_json_crew.py
+++ b/lib/cli/src/crewai_cli/create_json_crew.py
@@ -9,6 +9,7 @@ import sys
from typing import Any
import click
+from crewai_core.telemetry import Telemetry
from rich.console import Console
from rich.text import Text
@@ -971,7 +972,8 @@ def create_json_crew(
# Minted at creation so the project has a stable identity from run one.
# This is the default `crewai create crew` path, not just --classic.
- get_or_create_project_id(folder_path / "pyproject.toml")
+ project_id = get_or_create_project_id(folder_path / "pyproject.toml")
+ Telemetry().project_created_span("json_crew", project_id)
initialize_if_git_available(folder_path)
click.echo()
diff --git a/lib/crewai-core/src/crewai_core/telemetry.py b/lib/crewai-core/src/crewai_core/telemetry.py
index be33c6fb8..913f20e8b 100644
--- a/lib/crewai-core/src/crewai_core/telemetry.py
+++ b/lib/crewai-core/src/crewai_core/telemetry.py
@@ -408,6 +408,35 @@ class Telemetry:
self._safe_telemetry_procedure(_operation)
+ def project_created_span(self, kind: str, project_id: str | None) -> None:
+ """Records that the CLI scaffolded a new project.
+
+ Acquisition was previously only observable from a project's first *run*, which
+ misses every project created and never run and dates the rest to the wrong day.
+
+ ``created_project_id`` rather than ``project_id``: the ``project_id`` stamped on
+ every span by ``CommonAttributesSpanProcessor`` is read from the *current
+ working directory* and cached for the life of the process, so at scaffold time it
+ describes the directory the command was run from - not the project just minted a
+ line earlier. Two different things must not share one attribute name.
+
+ Args:
+ kind: What was scaffolded - "crew", "json_crew" or "flow".
+ project_id: The id just minted for the new project. Empty string when
+ minting failed, matching the convention for the common attribute.
+ """
+ from crewai_core.version import get_crewai_version
+
+ def _operation() -> None:
+ tracer = self.provider.get_tracer(TRACER_NAME)
+ span = tracer.start_span("Project Created")
+ self._add_attribute(span, "crewai_version", get_crewai_version())
+ self._add_attribute(span, "kind", kind)
+ self._add_attribute(span, "created_project_id", project_id or "")
+ close_span(span)
+
+ self._safe_telemetry_procedure(_operation)
+
def flow_creation_span(self, flow_name: str) -> None:
"""Records the creation of a new flow."""
from crewai_core.version import get_crewai_version
diff --git a/lib/crewai/tests/cli/test_project_created_span.py b/lib/crewai/tests/cli/test_project_created_span.py
new file mode 100644
index 000000000..e241840fc
--- /dev/null
+++ b/lib/crewai/tests/cli/test_project_created_span.py
@@ -0,0 +1,191 @@
+"""Scaffolding a project must be observable, and carry the id it just minted.
+
+Acquisition was only observable from a project's first *run*. That misses every project
+created and never run, and dates the rest to the wrong day. All three scaffolding paths
+already mint a `project_id` into the new `pyproject.toml`; none of them reported it, and
+two of them emitted no telemetry at all.
+
+Lives here rather than in `lib/cli/tests/` because `lib/cli/tests/` is not run by any
+workflow, while this directory is part of the required job.
+"""
+
+from typing import Any
+from unittest.mock import patch
+
+from click.testing import CliRunner
+from crewai_core.telemetry import Telemetry
+from opentelemetry.sdk.trace.export import SimpleSpanProcessor, SpanExportResult
+from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter
+import pytest
+
+
+class _NullExporter:
+ """Stands in for the OTLP exporter so no test attempts a real export."""
+
+ def export(self, spans: Any) -> SpanExportResult:
+ return SpanExportResult.SUCCESS
+
+ def shutdown(self) -> None:
+ pass
+
+ def force_flush(self, timeout_millis: int = 30000) -> bool:
+ return True
+
+
+def recorded_spans(monkeypatch):
+ """Spans emitted by a live Telemetry, captured from its own provider.
+
+ Telemetry has to be genuinely enabled: when it is disabled, `__init__` returns before
+ building `self.provider` at all, so every assertion here would pass vacuously against
+ a non-recording span.
+
+ Enabling it is exactly what makes the exporter swap mandatory. `__init__` wires a
+ `BatchSpanProcessor` around the real `SafeOTLPSpanExporter`, pointed at the production
+ collector, so without `_NullExporter` these synthetic `Project Created` spans -- with
+ invented `created_project_id` values -- are POSTed to it for real. `--block-network`
+ does not prevent that: it is function-scoped and only swaps `socket.connect`, which a
+ background batch thread outlives. Same reason `_register_shutdown_handlers` is
+ suppressed and the provider is shut down in `finally`: otherwise each test leaves an
+ atexit hook and an exporter thread behind.
+
+ Follows `telemetry_with_exporter` in tests/telemetry/test_tracer_isolation.py; the
+ patch target is `crewai_core` because that is where this Telemetry comes from.
+ """
+ monkeypatch.setattr(Telemetry, "_instance", None)
+ monkeypatch.setattr(Telemetry, "_register_shutdown_handlers", lambda self: None)
+ for var in ("OTEL_SDK_DISABLED", "CREWAI_DISABLE_TELEMETRY", "CREWAI_DISABLE_TRACKING"):
+ monkeypatch.setenv(var, "false")
+ monkeypatch.setattr(
+ "crewai_core.telemetry.SafeOTLPSpanExporter",
+ lambda **_kwargs: _NullExporter(),
+ )
+
+ telemetry = Telemetry()
+ assert telemetry.ready, "telemetry must be live or these assertions prove nothing"
+ exporter = InMemorySpanExporter()
+ telemetry.provider.add_span_processor(SimpleSpanProcessor(exporter))
+
+ try:
+ yield telemetry, exporter
+ finally:
+ telemetry.provider.shutdown()
+ Telemetry._instance = None
+
+
+def test_project_created_span_carries_kind_and_the_minted_id(recorded_spans):
+ telemetry, exporter = recorded_spans
+
+ telemetry.project_created_span("crew", "proj-abc123")
+
+ span = next(s for s in exporter.get_finished_spans() if s.name == "Project Created")
+ assert span.attributes["kind"] == "crew"
+ assert span.attributes["created_project_id"] == "proj-abc123"
+
+
+def test_the_minted_id_does_not_reuse_the_project_id_attribute(recorded_spans):
+ """`project_id` and `created_project_id` mean different things and must stay separate.
+
+ `CommonAttributesSpanProcessor` stamps `project_id` on every span from
+ `get_project_id()`, which reads the *current working directory* and is cached for the
+ life of the process. During `crewai create` that is the directory the command was run
+ from, not the project being created. Writing the minted id into the same attribute
+ would silently give one column two meanings.
+ """
+ telemetry, exporter = recorded_spans
+
+ telemetry.project_created_span("flow", "proj-new")
+
+ span = next(s for s in exporter.get_finished_spans() if s.name == "Project Created")
+ assert span.attributes["created_project_id"] == "proj-new"
+ assert span.attributes.get("project_id") != "proj-new", (
+ "the minted id must not overwrite the cwd-derived project_id"
+ )
+
+
+def test_a_failed_mint_records_an_empty_string_not_a_missing_key(recorded_spans):
+ """`get_or_create_project_id` returns None when pyproject is missing or unwritable.
+
+ Empty rather than absent, matching the convention established for the common
+ `project_id` attribute: absent means an old client that never sent the key at all,
+ which is a different fact from a client that sent it and had nothing to report.
+ """
+ telemetry, exporter = recorded_spans
+
+ telemetry.project_created_span("crew", None)
+
+ span = next(s for s in exporter.get_finished_spans() if s.name == "Project Created")
+ assert span.attributes["created_project_id"] == ""
+ assert "created_project_id" in span.attributes
+
+
+SCAFFOLDERS = [
+ ("crew", "crewai_cli.create_crew", "create_crew", {"skip_provider": True}),
+ (
+ "json_crew",
+ "crewai_cli.create_json_crew",
+ "create_json_crew",
+ {"skip_provider": True},
+ ),
+ ("flow", "crewai_cli.create_flow", "create_flow", {}),
+]
+
+
+ ("kind", "module", "func_name", "kwargs"),
+ SCAFFOLDERS,
+ ids=[s[0] for s in SCAFFOLDERS],
+)
+def test_each_scaffolder_reports_the_id_it_minted(
+ kind, module, func_name, kwargs, monkeypatch
+):
+ """The span must carry the value the mint returned, which pins the ordering.
+
+ Asserting on the minted value rather than merely that the span was emitted is what
+ makes this a test of ordering: a span emitted before the mint could not carry it.
+ `create_flow` already emitted `flow_creation_span` *before* minting, so this is a
+ real mistake to guard against and not a hypothetical one.
+ """
+ import importlib
+
+ # The product's own non-interactive mode. `create_json_crew` otherwise runs an agent
+ # wizard that reads stdin; this is the supported way to skip it rather than a stub.
+ monkeypatch.setenv("CREWAI_DMN", "1")
+
+ mod = importlib.import_module(module)
+ func = getattr(mod, func_name)
+
+ with CliRunner().isolated_filesystem():
+ with (
+ patch.object(mod, "get_or_create_project_id", return_value="proj-minted"),
+ patch.object(mod, "Telemetry") as telemetry_cls,
+ ):
+ func("demo_project", **kwargs)
+
+ telemetry_cls.return_value.project_created_span.assert_called_once_with(
+ kind, "proj-minted"
+ )
+
+
+def test_adding_a_crew_to_an_existing_project_is_not_an_acquisition():
+ """`create_crew(parent_folder=...)` adds a crew to a project that already exists.
+
+ It mints no id and must emit no creation span, or every added crew would be counted
+ as a newly acquired project.
+ """
+ from crewai_cli import create_crew as module
+
+ with CliRunner().isolated_filesystem():
+ module.create_folder_structure("host_project")
+ with (
+ patch.object(module, "get_or_create_project_id") as mint,
+ patch.object(module, "Telemetry") as telemetry_cls,
+ ):
+ module.create_crew(
+ "extra_crew", skip_provider=True, parent_folder="host_project"
+ )
+
+ assert not mint.called, "the parent_folder branch must not mint a new id"
+ assert not telemetry_cls.return_value.project_created_span.called, (
+ "adding a crew to an existing project must not be reported as a new project"
+ )