Skip to content

feat: add Octolens keyword-mapping DAL (CM-1834) - #4891

Merged
themarolt merged 2 commits into
mainfrom
feat/CM-1834-octolens-dal
Oct 6, 2026
Merged

themarolt merged 2 commits into
mainfrom
feat/CM-1834-octolens-dal

Conversation

@themarolt

Copy link
Copy Markdown
Contributor

Summary

Data access for Octolens ingestion: DAL functions over the octolensKeywordMappings table
added in CM-1833. Second half of the original CM-1834 unit — the platform enums and mention
activity type shipped already in #4889.

Changes

  • services/libs/data-access-layer/src/octolens/: findOctolensKeywordMapping,
    listOctolensKeywordMappings, addOctolensKeywordMapping, removeOctolensKeywordMapping
  • Barrel-exported from the package's index.ts
  • Colocated index.test.ts covering find/list/add/remove, including the
    (integrationId, keywordId) unique-constraint conflict

Type of change

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

JIRA ticket

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

Signed-off-by: Uroš Marolt <uros@marolt.me>
…-dal

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

cursor Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
New, read/write-isolated DAL with tests; no changes to auth or existing integration flows beyond exporting new APIs.

Overview
Adds a new Octolens data-access module so ingestion can persist which Octolens keywords map to which segments per integration.

The module exposes find, list, add, and remove helpers against integration."octolensKeywordMappings", keyed by integrationId and Octolens keywordId, with list results ordered by keyword. The package barrel re-exports ./octolens. Colocated Vitest coverage exercises happy paths, integration-scoped listing, duplicate (integrationId, keywordId) rejection, and idempotent delete when nothing matches.

Reviewed by Cursor Bugbot for commit c26fe1c. 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

🟢 Approval recommended

The DAL matches the table constraints, uses established query patterns, and has adequate integration coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Adds the Octolens keyword-mapping DAL with tested CRUD operations and package exports.

Changes:

  • Adds find, list, add, and remove functions.
  • Covers CRUD behavior and unique-constraint conflicts.
  • Exports the Octolens DAL publicly.
File Description
src/​octolens/​index.ts Implements keyword-mapping queries.
src/​octolens/​index.test.ts Tests query behavior and constraints.
src/​index.ts Exports the Octolens module.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@themarolt
themarolt requested review from epipav and gaspergrom October 6, 2026 09:05

@gaspergrom gaspergrom 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.

LGTM. Column names and types in the queries match the CM-1833 migration, and the (integrationId, keywordId) unique constraint backs both the find lookup and the duplicate-insert test. Tests cover find, list, add, remove, and the conflict case.

@themarolt
themarolt merged commit 5adb70f into main Oct 6, 2026
16 checks passed
@themarolt
themarolt deleted the feat/CM-1834-octolens-dal branch October 6, 2026 09:35
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