Skip to content

feat: adds multitenant tests via pytest#1923

Merged
Vasilije1990 merged 13 commits intodevfrom
feature/cog-3536-multitenant-search-testing-automation
Dec 19, 2025
Merged

feat: adds multitenant tests via pytest#1923
Vasilije1990 merged 13 commits intodevfrom
feature/cog-3536-multitenant-search-testing-automation

Conversation

@hajdul88
Copy link
Collaborator

@hajdul88 hajdul88 commented Dec 18, 2025

Description

This PR changes the permission test in e2e tests to use pytest.

Introduces:

  • fixtures for the environment setup
  • one eventloop for all pytest tests
  • mocking for acreate_structured_output answer generation (for search)
  • Asserts in permission test (before we use the example only)

Acceptance Criteria

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Other (please specify):

Screenshots/Videos (if applicable)

Pre-submission Checklist

  • I have tested my changes thoroughly before submitting this PR
  • This PR contains minimal changes necessary to address the issue/feature
  • My code follows the project's coding standards and style guidelines
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if applicable)
  • All new and existing tests pass
  • I have searched existing PRs to ensure this change hasn't been submitted already
  • I have linked any relevant issues in the description
  • My commits have clear and descriptive messages

DCO Affirmation

I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.

Summary by CodeRabbit

  • New Features

    • Entity model now includes description and metadata fields for richer entity information and indexing.
  • Tests

    • Expanded and restructured permission tests covering multi-tenant and role-based access flows; improved test scaffolding and stability.
    • E2E test workflow now runs pytest with verbose output and INFO logs.
  • Bug Fixes

    • Access-tracking updates now commit transactions so access timestamps persist.
  • Chores

    • General formatting, cleanup, and refactoring across modules and maintenance scripts.

✏️ Tip: You can customize this high-level summary in your review settings.

@hajdul88 hajdul88 self-assigned this Dec 18, 2025
@pull-checklist
Copy link

pull-checklist bot commented Dec 18, 2025

Please make sure all the checkboxes are checked:

  • I have tested these changes locally.
  • I have reviewed the code changes.
  • I have added end-to-end and unit tests (if applicable).
  • I have updated the documentation and README.md file (if necessary).
  • I have removed unnecessary code and debug statements.
  • PR title is clear and follows the convention.
  • I have tagged reviewers or team members for feedback.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Walkthrough

Switches the e2e workflow to run pytest, adds description and metadata fields to the Entity model, normalizes formatting across several modules, adds a DB commit in access-tracking, refactors cleanup and summarization modules, and substantially rewrites permission tests to use pytest/asyncio fixtures and multi-tenant role checks.

Changes

Cohort / File(s) Change Summary
Workflow
\.github/workflows/e2e_tests.yml
Replaced direct Python script test invocation with pytest -v --log-level=INFO
Data model
cognee/modules/engine/models/Entity.py
Added description: str and metadata: dict = {"index_fields": ["name"]} fields; minor import/formatting tweaks
DB migration
alembic/versions/e1ec1dcb50b6_add_last_accessed_to_data.py
Reformatted header and literals; down_revision value updated; upgrade/downgrade logic preserved
Retrieval / Graph utils
cognee/modules/graph/utils/get_entity_nodes_from_triplets.py, cognee/modules/retrieval/chunks_retriever.py, cognee/modules/retrieval/graph_completion_retriever.py, cognee/modules/retrieval/summaries_retriever.py
Whitespace/quote normalization and minor blank-line cleanup; no behavioral changes
Access tracking
cognee/modules/retrieval/utils/access_tracking.py
Added session.commit() after executing the SQL update in _update_sql_records
Tasks / Summarization
cognee/tasks/cleanup/cleanup_unused_data.py, cognee/tasks/summarization/models.py
Refactored formatting and import ordering; removed leading blank line in summarization model; behavior preserved
Tests — Cleanup
cognee/tests/test_cleanup_unused_data.py
Reorganized imports and test scaffolding; core test flow unchanged
Tests — Permissions
cognee/tests/test_permissions.py
Major rewrite: added pytest/asyncio, AsyncMock/patch usage, helpers (_extract_dataset_id_from_cognify, _reset_engines_and_prune), fixtures (event_loop, permissions_example_env), and consolidated test_permissions_example_flow exercising multi-tenant and role-based permission flows with mocks

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus areas:
    • Inspect cognee/tests/test_permissions.py for asyncio fixture correctness, event loop lifecycle, and proper use of AsyncMock/patch for LLMGateway.acreate_structured_output.
    • Verify session.commit() in access_tracking._update_sql_records fits the intended transaction/session lifecycle and won't conflict with surrounding session management.
    • Check Entity.metadata default (mutable dict) usage for potential shared-mutable-state issues with ORM/serialization.

Possibly related PRs

Suggested reviewers

  • pazone
  • lxobr
  • hajdul88

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 65.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: adds multitenant tests via pytest' directly reflects the main objective of the PR: refactoring permission tests to use pytest with multitenant capabilities.
Description check ✅ Passed The PR description covers key changes (pytest migration, fixtures, mocking) and completes most template sections including Type of Change and Pre-submission Checklist, though Acceptance Criteria lacks specific verification instructions.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/cog-3536-multitenant-search-testing-automation

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3bc3f63 and 2c4f9b0.

📒 Files selected for processing (1)
  • alembic/versions/e1ec1dcb50b6_add_last_accessed_to_data.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • alembic/versions/e1ec1dcb50b6_add_last_accessed_to_data.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (23)
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test adding of label for data in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test dataset database deletion in Cognee
  • GitHub Check: End-to-End Tests / Test using different async databases in parallel in Cognee
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: Basic Tests / Run Simple Examples BAML
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hajdul88 hajdul88 marked this pull request as draft December 18, 2025 16:33
@hajdul88 hajdul88 changed the title feat: adds multitenant tests via pytest feat: adds multitenant tests via pytest (WIP) Dec 18, 2025
@hajdul88 hajdul88 marked this pull request as ready for review December 19, 2025 10:39
@hajdul88 hajdul88 changed the title feat: adds multitenant tests via pytest (WIP) feat: adds multitenant tests via pytest Dec 19, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cognee/modules/engine/models/Entity.py (1)

10-10: Replace mutable default value with a factory or None.

Using a mutable default value ({"index_fields": ["name"]}) creates a shared dict across all instances of the Entity class. If any instance modifies this dict, the change affects all instances, leading to subtle bugs.

🔎 Recommended fix using default_factory

If this class uses Pydantic or dataclasses, use a factory:

+from pydantic import Field
+
 class Entity(DataPoint):
     name: str
     is_a: Optional[EntityType] = None
     description: str
-    metadata: dict = {"index_fields": ["name"]}
+    metadata: dict = Field(default_factory=lambda: {"index_fields": ["name"]})

Alternatively, if using plain classes, initialize in __init__:

 class Entity(DataPoint):
     name: str
     is_a: Optional[EntityType] = None
     description: str
-    metadata: dict = {"index_fields": ["name"]}
+    metadata: dict = None
+    
+    def __init__(self, **kwargs):
+        super().__init__(**kwargs)
+        if self.metadata is None:
+            self.metadata = {"index_fields": ["name"]}
🧹 Nitpick comments (4)
cognee/modules/graph/utils/get_entity_nodes_from_triplets.py (1)

1-12: Consider adding a docstring for documentation completeness.

Per coding guidelines, undocumented function definitions are considered incomplete. A brief docstring would clarify the function's purpose and return type.

🔎 Proposed docstring
 def get_entity_nodes_from_triplets(triplets):
+    """
+    Extracts unique entity nodes from a list of graph triplets.
+
+    Parameters:
+    -----------
+        triplets: A list of triplet objects, each containing node1 and node2 attributes.
+
+    Returns:
+    --------
+        list: A list of dictionaries, each containing an 'id' key with the node's string ID.
+    """
     entity_nodes = []
     seen_ids = set()
cognee/tests/test_cleanup_unused_data.py (1)

161-165: Consider removing the exit() call for pytest compatibility.

The exit(0 if success else 1) pattern is more typical for direct script execution rather than pytest tests. When run via pytest (as indicated by the CI workflow changes), the __main__ block won't execute. Consider removing this block or simplifying it to just asyncio.run(test_textdocument_cleanup_with_sql()) if direct execution is needed.

cognee/tests/test_permissions.py (2)

58-65: Consider using default pytest-asyncio event loop behavior.

The custom event_loop fixture is non-standard and can complicate test execution. Modern pytest-asyncio (0.21.1) handles event loop management automatically with scope="module" if needed. Unless there's a specific reason for manual loop management, consider removing this fixture and relying on pytest-asyncio's default behavior.

Alternative: Use pytest-asyncio's built-in scope

Remove the custom event_loop fixture and configure pytest-asyncio scope via marks if needed:

pytestmark = pytest.mark.asyncio(scope="module")

Or in pytest.ini / pyproject.toml:

[tool.pytest.ini_options]
asyncio_mode = "auto"

26-30: Add docstrings to functions per coding guidelines.

Helper functions and the test function lack docstrings. Per the project's coding guidelines, undocumented function definitions are considered incomplete and should include a short summary.

As per coding guidelines: "As a general rule, undocumented function definitions and class definitions in the project's Python code are assumed incomplete."

Also applies to: 33-55, 90-212

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb444ca and 72dae0f.

📒 Files selected for processing (12)
  • .github/workflows/e2e_tests.yml (1 hunks)
  • alembic/versions/e1ec1dcb50b6_add_last_accessed_to_data.py (1 hunks)
  • cognee/modules/engine/models/Entity.py (1 hunks)
  • cognee/modules/graph/utils/get_entity_nodes_from_triplets.py (1 hunks)
  • cognee/modules/retrieval/chunks_retriever.py (2 hunks)
  • cognee/modules/retrieval/graph_completion_retriever.py (1 hunks)
  • cognee/modules/retrieval/summaries_retriever.py (1 hunks)
  • cognee/modules/retrieval/utils/access_tracking.py (1 hunks)
  • cognee/tasks/cleanup/cleanup_unused_data.py (1 hunks)
  • cognee/tasks/summarization/models.py (0 hunks)
  • cognee/tests/test_cleanup_unused_data.py (1 hunks)
  • cognee/tests/test_permissions.py (1 hunks)
💤 Files with no reviewable changes (1)
  • cognee/tasks/summarization/models.py
🧰 Additional context used
📓 Path-based instructions (6)
.github/**

⚙️ CodeRabbit configuration file

.github/**: * When the project is hosted on GitHub: All GitHub-specific configurations, templates, and tools should be found in the '.github' directory tree.

  • 'actionlint' erroneously generates false positives when dealing with GitHub's ${{ ... }} syntax in conditionals.
  • 'actionlint' erroneously generates incorrect solutions when suggesting the removal of valid ${{ ... }} syntax.

Files:

  • .github/workflows/e2e_tests.yml
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Use 4-space indentation in Python code
Use snake_case for Python module and function names
Use PascalCase for Python class names
Use ruff format before committing Python code
Use ruff check for import hygiene and style enforcement with line-length 100 configured in pyproject.toml
Prefer explicit, structured error handling in Python code

Files:

  • alembic/versions/e1ec1dcb50b6_add_last_accessed_to_data.py
  • cognee/modules/retrieval/utils/access_tracking.py
  • cognee/modules/retrieval/summaries_retriever.py
  • cognee/modules/engine/models/Entity.py
  • cognee/tests/test_permissions.py
  • cognee/modules/graph/utils/get_entity_nodes_from_triplets.py
  • cognee/modules/retrieval/chunks_retriever.py
  • cognee/tasks/cleanup/cleanup_unused_data.py
  • cognee/modules/retrieval/graph_completion_retriever.py
  • cognee/tests/test_cleanup_unused_data.py

⚙️ CodeRabbit configuration file

**/*.py: When reviewing Python code for this project:

  1. Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the priority in mind, do still consider improvements to clarity when relevant.
  2. As a general guideline, consider the code style advocated in the PEP 8 standard (excluding the use of spaces for indentation) and evaluate suggested changes for code style compliance.
  3. As a style convention, consider the code style advocated in CEP-8 and evaluate suggested changes for code style compliance.
  4. As a general guideline, try to provide any relevant, official, and supporting documentation links to any tool's suggestions in review comments. This guideline is important for posterity.
  5. As a general rule, undocumented function definitions and class definitions in the project's Python code are assumed incomplete. Please consider suggesting a short summary of the code for any of these incomplete definitions as docstrings when reviewing.

Files:

  • alembic/versions/e1ec1dcb50b6_add_last_accessed_to_data.py
  • cognee/modules/retrieval/utils/access_tracking.py
  • cognee/modules/retrieval/summaries_retriever.py
  • cognee/modules/engine/models/Entity.py
  • cognee/tests/test_permissions.py
  • cognee/modules/graph/utils/get_entity_nodes_from_triplets.py
  • cognee/modules/retrieval/chunks_retriever.py
  • cognee/tasks/cleanup/cleanup_unused_data.py
  • cognee/modules/retrieval/graph_completion_retriever.py
  • cognee/tests/test_cleanup_unused_data.py
cognee/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Use shared logging utilities from cognee.shared.logging_utils in Python code

Files:

  • cognee/modules/retrieval/utils/access_tracking.py
  • cognee/modules/retrieval/summaries_retriever.py
  • cognee/modules/engine/models/Entity.py
  • cognee/tests/test_permissions.py
  • cognee/modules/graph/utils/get_entity_nodes_from_triplets.py
  • cognee/modules/retrieval/chunks_retriever.py
  • cognee/tasks/cleanup/cleanup_unused_data.py
  • cognee/modules/retrieval/graph_completion_retriever.py
  • cognee/tests/test_cleanup_unused_data.py
cognee/{modules,infrastructure,tasks}/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Co-locate feature-specific helpers under their respective package (modules/, infrastructure/, or tasks/)

Files:

  • cognee/modules/retrieval/utils/access_tracking.py
  • cognee/modules/retrieval/summaries_retriever.py
  • cognee/modules/engine/models/Entity.py
  • cognee/modules/graph/utils/get_entity_nodes_from_triplets.py
  • cognee/modules/retrieval/chunks_retriever.py
  • cognee/tasks/cleanup/cleanup_unused_data.py
  • cognee/modules/retrieval/graph_completion_retriever.py
cognee/tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

cognee/tests/**/*.py: Place Python tests under cognee/tests/ organized by type (unit, integration, cli_tests)
Name Python test files test_*.py and use pytest.mark.asyncio for async tests

Files:

  • cognee/tests/test_permissions.py
  • cognee/tests/test_cleanup_unused_data.py
cognee/tests/*

⚙️ CodeRabbit configuration file

cognee/tests/*: When reviewing test code:

  1. Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the priority in mind, do still consider improvements to clarity when relevant.
  2. As a general guideline, consider the code style advocated in the PEP 8 standard (excluding the use of spaces for indentation) and evaluate suggested changes for code style compliance.
  3. As a style convention, consider the code style advocated in CEP-8 and evaluate suggested changes for code style compliance, pointing out any violations discovered.
  4. As a general guideline, try to provide any relevant, official, and supporting documentation links to any tool's suggestions in review comments. This guideline is important for posterity.
  5. As a project rule, Python source files with names prefixed by the string "test_" and located in the project's "tests" directory are the project's unit-testing code. It is safe, albeit a heuristic, to assume these are considered part of the project's minimal acceptance testing unless a justifying exception to this assumption is documented.
  6. As a project rule, any files without extensions and with names prefixed by either the string "check_" or the string "test_", and located in the project's "tests" directory, are the project's non-unit test code. "Non-unit test" in this context refers to any type of testing other than unit testing, such as (but not limited to) functional testing, style linting, regression testing, etc. It can also be assumed that non-unit testing code is usually written as Bash shell scripts.

Files:

  • cognee/tests/test_permissions.py
  • cognee/tests/test_cleanup_unused_data.py
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
Repo: topoteretes/cognee PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:45:09.996Z
Learning: Applies to cognee/tests/**/*.py : Place Python tests under cognee/tests/ organized by type (unit, integration, cli_tests)
Learnt from: CR
Repo: topoteretes/cognee PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:45:09.996Z
Learning: Applies to cognee/tests/**/*.py : Name Python test files test_*.py and use pytest.mark.asyncio for async tests
📚 Learning: 2024-11-18T12:54:36.758Z
Learnt from: 0xideas
Repo: topoteretes/cognee PR: 233
File: .github/workflows/test_cognee_llama_index_notebook.yml:0-0
Timestamp: 2024-11-18T12:54:36.758Z
Learning: In the `.github/workflows/test_cognee_llama_index_notebook.yml` workflow, it's acceptable to remove the `--all-extras` flag from `poetry install` to reduce costs by not installing unnecessary dependencies.

Applied to files:

  • .github/workflows/e2e_tests.yml
📚 Learning: 2025-11-24T16:45:09.996Z
Learnt from: CR
Repo: topoteretes/cognee PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:45:09.996Z
Learning: Applies to cognee/tests/**/*.py : Place Python tests under cognee/tests/ organized by type (unit, integration, cli_tests)

Applied to files:

  • .github/workflows/e2e_tests.yml
📚 Learning: 2025-11-24T16:45:09.996Z
Learnt from: CR
Repo: topoteretes/cognee PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:45:09.996Z
Learning: Applies to cognee/tests/**/*.py : Name Python test files test_*.py and use pytest.mark.asyncio for async tests

Applied to files:

  • cognee/tests/test_permissions.py
📚 Learning: 2025-12-02T10:37:24.255Z
Learnt from: hajdul88
Repo: topoteretes/cognee PR: 1832
File: cognee/tasks/memify/get_triplet_datapoints.py:169-179
Timestamp: 2025-12-02T10:37:24.255Z
Learning: In cognee/tasks/memify/get_triplet_datapoints.py, the triplet embeddable_text format intentionally includes arrow separators (`-›`) even when text components might be empty, as this format was agreed upon by the team. The empty text check is considered acceptable even though it's technically unreachable.

Applied to files:

  • cognee/modules/graph/utils/get_entity_nodes_from_triplets.py
📚 Learning: 2024-11-13T14:55:05.912Z
Learnt from: 0xideas
Repo: topoteretes/cognee PR: 205
File: cognee/tests/unit/processing/chunks/chunk_by_paragraph_test.py:7-7
Timestamp: 2024-11-13T14:55:05.912Z
Learning: When changes are made to the chunking implementation in `cognee/tasks/chunks`, the ground truth values in the corresponding tests in `cognee/tests/unit/processing/chunks` need to be updated accordingly.

Applied to files:

  • cognee/modules/retrieval/chunks_retriever.py
📚 Learning: 2024-10-16T07:06:28.669Z
Learnt from: borisarzentar
Repo: topoteretes/cognee PR: 144
File: cognee/tasks/chunking/query_chunks.py:1-17
Timestamp: 2024-10-16T07:06:28.669Z
Learning: The `query_chunks` function in `cognee/tasks/chunking/query_chunks.py` is used within the `search` function in `cognee/api/v1/search/search_v2.py`.

Applied to files:

  • cognee/modules/retrieval/chunks_retriever.py
🧬 Code graph analysis (6)
cognee/modules/retrieval/utils/access_tracking.py (3)
cognee/modules/data/models/Data.py (1)
  • Data (12-61)
cognee/modules/graph/cognee_graph/CogneeGraph.py (2)
  • CogneeGraph (18-240)
  • project_graph_from_db (121-201)
cognee/modules/graph/cognee_graph/CogneeGraphElements.py (3)
  • get_skeleton_edges (73-74)
  • get_destination_node (137-138)
  • get_source_node (134-135)
cognee/modules/retrieval/summaries_retriever.py (1)
cognee/modules/retrieval/utils/access_tracking.py (1)
  • update_node_access_timestamps (18-45)
cognee/tests/test_permissions.py (6)
cognee/context_global_variables.py (1)
  • backend_access_control_enabled (74-83)
cognee/api/v1/search/routers/get_search_router.py (1)
  • search (76-144)
cognee/modules/users/exceptions/exceptions.py (1)
  • PermissionDeniedError (41-48)
cognee/modules/users/methods/get_user.py (1)
  • get_user (10-25)
cognee/modules/users/permissions/methods/authorized_give_permission_on_datasets.py (1)
  • authorized_give_permission_on_datasets (9-35)
cognee/infrastructure/databases/vector/create_vector_engine.py (1)
  • create_vector_engine (11-150)
cognee/tasks/cleanup/cleanup_unused_data.py (4)
cognee/infrastructure/databases/graph/get_graph_engine.py (1)
  • get_graph_engine (10-24)
cognee/modules/data/models/Data.py (1)
  • Data (12-61)
cognee/shared/logging_utils.py (2)
  • get_logger (212-224)
  • error (207-207)
cognee/modules/users/methods/get_default_user.py (1)
  • get_default_user (13-38)
cognee/modules/retrieval/graph_completion_retriever.py (1)
cognee/modules/retrieval/utils/access_tracking.py (1)
  • update_node_access_timestamps (18-45)
cognee/tests/test_cleanup_unused_data.py (2)
cognee/modules/data/models/Data.py (1)
  • Data (12-61)
cognee/tasks/cleanup/cleanup_unused_data.py (1)
  • cleanup_unused_data (27-92)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (202)
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test adding of label for data in Cognee
  • GitHub Check: End-to-End Tests / Test dataset database deletion in Cognee
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: Basic Tests / Run Simple Examples BAML
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test adding of label for data in Cognee
  • GitHub Check: End-to-End Tests / Test dataset database deletion in Cognee
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: Basic Tests / Run Simple Examples BAML
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test adding of label for data in Cognee
  • GitHub Check: End-to-End Tests / Test dataset database deletion in Cognee
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test adding of label for data in Cognee
  • GitHub Check: End-to-End Tests / Test dataset database deletion in Cognee
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test adding of label for data in Cognee
  • GitHub Check: End-to-End Tests / Test dataset database deletion in Cognee
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test adding of label for data in Cognee
  • GitHub Check: End-to-End Tests / Test dataset database deletion in Cognee
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test adding of label for data in Cognee
  • GitHub Check: End-to-End Tests / Test dataset database deletion in Cognee
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test adding of label for data in Cognee
  • GitHub Check: End-to-End Tests / Test dataset database deletion in Cognee
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test adding of label for data in Cognee
  • GitHub Check: End-to-End Tests / Test dataset database deletion in Cognee
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test adding of label for data in Cognee
  • GitHub Check: End-to-End Tests / Test dataset database deletion in Cognee
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: CLI Tests / CLI Integration Tests
🔇 Additional comments (6)
.github/workflows/e2e_tests.yml (1)

291-291: LGTM - pytest invocation aligns with test framework migration.

The change correctly switches from direct Python script execution to pytest, enabling proper fixture support and test discovery. The -v and --log-level=INFO flags are appropriate for CI visibility. Based on learnings, this follows the project convention for naming test files test_*.py and using pytest for async tests.

cognee/modules/retrieval/summaries_retriever.py (1)

58-60: LGTM - Formatting improves readability.

The added blank lines provide visual separation around the update_node_access_timestamps call, which is consistent with the formatting style applied across other retriever modules in this PR.

cognee/modules/retrieval/graph_completion_retriever.py (1)

151-153: LGTM - Consistent formatting.

The whitespace normalization around the update_node_access_timestamps call maintains consistency with the formatting style applied to other retriever modules in this PR.

cognee/modules/retrieval/utils/access_tracking.py (1)

87-88: LGTM! Transaction commit properly added.

The addition of await session.commit() ensures the SQL update is persisted. This is necessary for SQLAlchemy 2.0 async sessions and is correctly placed within the async context manager.

alembic/versions/e1ec1dcb50b6_add_last_accessed_to_data.py (1)

1-51: LGTM! Formatting normalization only.

The changes are purely stylistic (single quotes to double quotes). The migration logic for adding/removing the last_accessed column remains functionally identical.

cognee/modules/engine/models/Entity.py (1)

9-9: No code changes needed. All existing Entity instantiations throughout the codebase already provide the required description field. The concern about breaking existing code is not supported by evidence from the codebase.

Likely an incorrect or invalid review comment.

@Vasilije1990 Vasilije1990 merged commit 16cf955 into dev Dec 19, 2025
132 checks passed
@Vasilije1990 Vasilije1990 deleted the feature/cog-3536-multitenant-search-testing-automation branch December 19, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants