refactor: move Notion client to app/services/#945
refactor: move Notion client to app/services/#945muddlebee merged 5 commits intoTracer-Cloud:mainfrom
Conversation
|
cc : @VaibhavUpreti @rrajan94 PTAL! |
Greptile SummaryThis PR relocates the Notion API client from
Confidence Score: 4/5Safe to merge after adding the missing app/services/notion/init.py to keep the package consistent with the rest of the codebase. One P1 finding: the new app/services/notion/ directory is missing an init.py, diverging from every other service package and risking mypy and import-mode failures. Remaining findings are P2 (weak compatibility test assertion, undocumented convention change). Score is 4 pending the missing init file. app/services/notion/ — needs an init.py added to match the pattern of every other service sub-package. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["app.integrations.clients.notion\n__init__.py (compat shim)"] -->|re-exports| B["app.services.notion.client\nNotionClient / NotionConfig"]
C["tests/integrations/\ntest_notion_client.py"] -->|canonical import| B
C -->|compatibility import| A
D["Any existing caller\nusing old path"] -->|still works via| A
|
|
cc : @VaibhavUpreti @rrajan94 PTAL! |
yashksaini-coder
left a comment
There was a problem hiding this comment.
The code migration itself is solid — correct destination, shim pattern works, identity assertion in the compatibility test is the right approach. One doc fix needed before this merges.
.cursor/rules/integrations.mdc — incomplete directory tree
The PR removes the clients/ section from the diagram entirely, but app/integrations/clients/prefect/ still exists and was not migrated. A contributor (or AI coding assistant) reading these rules would incorrectly assume all clients now live under app/services/ and might put new work in the wrong place, or be confused when they encounter prefect.
Please update the tree in .cursor/rules/integrations.mdc to:
app/services/
├── grafana/ # Vendor-specific client packages
├── datadog/
├── s3_client.py # Single-file clients
└── vercel/
app/integrations/
├── clients/
│ └── prefect/ # Legacy location — new clients go in app/services/
├── opensre_mcp.py # MCP server implementation
└── ...
That's the only change needed. Everything else — the client move, the shim, the test update — is good to go.
|
@yashksaini-coder addressed the changes! |
|
@VaibhavUpreti @muddlebee PTAL! |
| ├── grafana/ # Vendor-specific client packages | ||
| ├── datadog/ | ||
| ├── s3_client.py # Single-file clients | ||
| └── vercel/ |
There was a problem hiding this comment.
just add a newline here like btw app/services/ and app/integrations/
app/services/
├── grafana/
├── datadog/
├── s3_client.py
└── vercel/
app/integrations/
├── clients/
│ └── prefect/ # Legacy location — new clients go in app/services/
├── opensre_mcp.py
└── ...
There was a problem hiding this comment.
resolve above then ready to merge
|
@muddlebee done ser! |
|
💜 One more reason the project grows. Thanks @gitsofaryan — your contribution just landed! 👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome. |
|
🚀 good going @gitsofaryan nice work so far |

Fixes #898
Describe the changes you have made in this PR -
Relocated the Notion API client to a more consistent location under
app/services/while ensuring backward compatibility for existing imports.app/integrations/clients/notion/client.pytoapp/services/notion/client.py.app/services/notion/__init__.pyto ensure the new directory is treated as a proper Python package and exports the client/config.app/integrations/clients/notion/__init__.pyto importNotionClientandNotionConfigfrom the new services path, preventing breakage for any code using the old package-level import.tests/integrations/test_notion_client.pyto use the new canonical path and strengthened the identity assertion in the compatibility test..cursor/rules/integrations.mdcto reflect the correct directory structure and instructions for new clients.Demo/Screenshot for feature changes and bug fixes -
Ran the Notion client tests locally:
Code Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?
If you used AI assistance:
Explain your implementation approach:
The move follows the established pattern of other service clients (Grafana, Datadog) already present in
app/services/. I addressed Greptile review findings by adding the missing__init__.pyin the new location and strengthening the compatibility test to use object identity assertions. Additionally, I updated the Cursor rules inintegrations.mdcto correctly document this pattern for future contributors.Checklist before requesting a review