Skip to content

feat: Add AI activity plugins plus HubSpot and Notion user activity ingestion#2

Open
irfanuddinahmad wants to merge 82 commits into
mainfrom
feature/hubspot-notion-plugins
Open

feat: Add AI activity plugins plus HubSpot and Notion user activity ingestion#2
irfanuddinahmad wants to merge 82 commits into
mainfrom
feature/hubspot-notion-plugins

Conversation

@irfanuddinahmad

@irfanuddinahmad irfanuddinahmad commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Summary
This PR adds five activity-focused integrations across AI and collaboration tooling.

It extends Claude, Codex, and Cursor to normalize AI usage and review-related events into the shared ai_activities domain model. It also introduces new HubSpot and Notion plugins that collect user activity events and write them into a new shared user_activities domain table for daily activity reporting.

Main Changes
Added unified AI activity support for Claude, Codex, and Cursor, including interface type, suggestions, acceptances, commit/PR creation, token usage, and cost fields where supported.
Extended Codex coverage to include code review and code review response activity in addition to usage analytics.
Added new HubSpot and Notion plugins with connection APIs, scope APIs, scope-config APIs, blueprint support, polling collectors, and optional webhook ingestion.
Added owner/user enrichment for HubSpot and Notion so activity records can resolve user email/display-name data before conversion.
Added the shared user_activities domain table and related migrations.
Added user-project mapping APIs/services for project-scoped access and admin visibility.
Added config UI registration and connection forms for HubSpot and Notion.
Added and updated Grafana dashboards for AI adoption, token usage, code review, cost/billing, commit attribution, HubSpot activity, Notion activity, combined HubSpot/Notion activity, and admin access views.

Why
This work gives DevLake a consistent reporting layer for two adjacent needs:

AI engineering activity across Claude, Codex, and Cursor through one normalized domain model.
Collaboration and business-user activity across HubSpot and Notion through one normalized domain model.

@irfanuddinahmad
irfanuddinahmad force-pushed the feature/hubspot-notion-plugins branch 2 times, most recently from 6f43704 to e775a64 Compare April 14, 2026 10:25
@irfanuddinahmad irfanuddinahmad changed the title feat: added Hubspot and Notion plugins feat: added AI, Hubspot and Notion plugins Apr 14, 2026
raza-bukhari and others added 30 commits April 29, 2026 20:24
- Scope ConvertActivity delete + cursor to OccurredAfter/Before window
- Propagate loadSalesforceUserMap errors instead of silent fallback
- Parse expires_in from OAuth response with 60s safety buffer
- Add MaxUsers cap and count logging to user collection
- MergeFromRequest returns errors.Error
- Add unit tests for grouping, OAuth parsing, and user SOQL
feat: Added test coverage dashboard for GitHub
feat: added Salesforce user activity plugin
Save Connection now merges plugin initialValues with form values through a whitelisted helper, matching Test Connection behavior on create and preventing required defaults (e.g. GitHub's endpoint and authMethod) from being dropped on save.
- Extract the merge into buildConnectionSavePayload, which picks only known connection fields so unexpected initialValues keys don't leak into the payload.
- Document the intentional handleSave/handleTest asymmetry on the update path.
- Add unit tests covering default preservation, explicit overrides (including empty string and false), undefined initialValues, empty values, undefined-override semantics, and unsupported-key dropping.
- Add test infrastructure: tsconfig.test.json, npm test script, .test-dist gitignore entry.
- Single-source CONNECTION_FORM_FIELDS in payload.ts; SAVE_CONNECTION_FIELDS is now form fields + an explicit plugin-defaults list.
- Make the test npm script cross-platform and discover tests via glob.
- Add a yarn test step to the config-ui CI workflow.
- Annotate helper return type; clarify the handleSave/handleTest asymmetry comment.
fix: include default connection values on save
Stop wiping App/token secrets on update and re-validate masked values against the existing connection.
* Prevent stuck loading and stale pagination in data scope picker
* Add explicit Select All that loads all scopes before selecting
* Show selected scopes as chips without opening a second dropdown
* Keep Blueprint detail visible while refresh runs after save
…pe-loading-issue

fix(github): Fix blueprint data scope selection UX
…er-default

fix(github): stop default project blueprints limiting historical sync
…ord-support

Configure Grafana SMTP for password reset emails and forgot password flow
When a blueprint's time_after was cleared (set to NULL) and a Full Sync
was triggered, SubtaskStateManager was silently restoring the old cutoff
from _devlake_subtask_states via a nil-fallback, causing collection to
remain limited to the previous 6-month window instead of fetching all
available history.

Two-part fix:
1. NewSubtaskStateManager: skip the preState.TimeAfter fallback when
   FullSync is true, so nil TimeAfter on a full sync means "no cutoff".
2. Close(): always write TimeAfter (even nil) on full-sync completes, so
   the stored cutoff is cleared and subsequent incremental runs are not
   restricted to the old date.

Updated the test case that was asserting the buggy fallback behavior.
…ull sync

Same bug as SubtaskStateManager: github_graphql uses CollectorStateManager
which writes to _devlake_collector_latest_state. When FullSync was triggered
with no syncPolicy.TimeAfter, the stored cutoff was restored via the nil
fallback, and Close() left it in the DB for the next run.

Applied identical two-part fix:
1. Skip the state.TimeAfter fallback when syncPolicy.FullSync is true.
2. Always write TimeAfter (even nil) in Close() so the stale cutoff is
   cleared from _devlake_collector_latest_state after a full sync.

Updated the test case asserting the buggy fallback behavior.
…es-stored-time-after

fix(github): full sync no longer inherits stale time_after cutoff
…failure

fix(github): refactor issue handling in CollectIssues function
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.

3 participants