Skip to content

feat: add octolensKeywordMappings table (CM-1833) - #4888

Merged
themarolt merged 3 commits into
mainfrom
feat/CM-1833-octolens-keyword-mapping-table
Oct 2, 2026
Merged

themarolt merged 3 commits into
mainfrom
feat/CM-1833-octolens-keyword-mapping-table

Conversation

@themarolt

Copy link
Copy Markdown
Contributor

Summary

Adds the table that maps an Octolens keyword to the CDP segment it should route mentions
into, so a single global Octolens poll can fan out across thousands of projects.

Changes

  • New migration: octolensKeywordMappings (integrationId, segmentId, keywordId,
    keyword, timestamps; unique on (integrationId, keywordId))

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Performance improvement
  • Chore / dependency update
  • Documentation

JIRA ticket

https://linuxfoundation.atlassian.net/browse/CM-1833

Signed-off-by: Uroš Marolt <uros@marolt.me>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 17:49
@cursor

cursor Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Schema-only migration adding a new mapping table with standard FK constraints; no runtime or auth logic in this PR.

Overview
Adds a new integration.octolensKeywordMappings table so each Octolens keyword can be tied to a CDP segment for routing mentions from a shared poll.

Rows store integrationId, segmentId, keywordId, and keyword, with createdAt/updatedAt, FK to public.integrations (cascade on delete) and public.segments, and a unique constraint on (integrationId, keywordId).

Reviewed by Cursor Bugbot for commit 352ceb0. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The integration foreign key prevents deleting integrations that have mappings unless cascading deletion is added.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds persistence for routing Octolens keyword mentions to CDP segments.

Changes:

  • Adds keyword-to-segment mappings scoped by integration.
  • Enforces unique integration/keyword pairs.
File Description
V1790929179__octolens-keyword-mappings.sql Creates the Octolens keyword mapping table.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread backend/src/database/migrations/V1790929179__octolens-keyword-mappings.sql Outdated
…M-1833)

Signed-off-by: Uroš Marolt <uros@marolt.me>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 17:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The migration must be renamed with a version greater than all existing migrations.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (1)

Copilot AI balanced review requested due to automatic review settings October 2, 2026 17:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The migration is correctly ordered, preserves referential integrity, and matches the stated schema requirements.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@themarolt
themarolt merged commit a817769 into main Oct 2, 2026
14 checks passed
@themarolt
themarolt deleted the feat/CM-1833-octolens-keyword-mapping-table branch October 2, 2026 19:44
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