Repository navigation
feat: review held sessionize events through the api - #5468
Conversation
|
|
PR SummaryMedium Risk Overview List reads held and decided events from the DB writer (not the replica) and builds each row with Data layer gains batch confirm, locking, and subproject listing; the connectors worker now applies decisions in the same lock order. Suggestion rules expand project aliases (e.g. KubeCon→CNCF, Open Source Summit→TLF) and export Reviewed by Cursor Bugbot for commit 131f6f0. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
@mbani01 I'm starting review 1 of this pull request now (started 2026-11-27 16:11 UTC using review agent v0.1.34). This usually takes a few minutes. I'll update this comment with the summary when I'm done. If there's no summary here after about 45 minutes, the review stopped: push a new commit, or post a comment that begins with a mention of me followed by Hi Mouad BANI, thanks for the detailed description and the thorough tests. SummaryThis pull request adds the admin-only Decision✅ Approved with minor comments 🟡 1 minor 📝 Documentation gaps: none in this repository. See the reminder in Details. DetailsOverall impression: The change keeps to the repository's patterns: plain functions, the 🟡 Minor: 1 issue: Confirmation derives the catalogue link from evidence read before the event locks are taken Other reviewers and CI checks: Greptile and Copilot raised the same read-before-lock race. This review agrees and links it in the inline comment. No CI checks were visible on this commit at review time (the combined status was empty and pending). Branch protection and ruleset reads returned 403, so required checks could not be confirmed. Unread files: Documentation reminder: changed Rule files: read Questions, problems, or feedback: https://github.com/linuxfoundation/lfx-review-agent/issues |
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryAdds admin-only APIs to list, confirm, ignore, and restore held Sessionize events.
Both supplied previous findings are fixed. Neither thread has a supplied comment number. Reviews (5) · Last reviewed commit: "fix: connect the event mapping endpoints..." · Reviewed by Greptile |
There was a problem hiding this comment.
🟡 Changes recommended
Confirmation reads evidence before acquiring per-event locks, allowing a concurrent matcher refresh to pair stale catalogue suggestions with new evidence and confirm a project that is no longer suggested.
1 open issue
1 file not reviewed
pnpm-lock.yaml: Generated file
What changed in this PR
Adds the admin-only API for reviewing held Sessionize events, building on the existing suggestion and decision-storage layers to support the upcoming Event mapping page.
Changes:
- Adds list, bulk confirm, ignore, and restore endpoints with permission checks and request validation.
- Resolves suggestions against active subprojects and returns review states and counts.
- Adds transactional bulk confirmation, consistent event-key lock ordering, and supporting tests.
| File | Description |
|---|---|
| services/libs/data-access-layer/src/sessionize/index.ts | Adds bulk confirmation and shared event-key ordering. |
| services/libs/data-access-layer/src/sessionize/index.test.ts | Tests bulk rollback, duplicates, and subproject lookup. |
| services/libs/data-access-layer/src/segments/index.ts | Lists active subprojects with group names. |
| services/apps/connectors_worker/src/sessionizeEventMatching.ts | Sorts daily decisions by event key. |
| services/apps/connectors_worker/src/sessionizeEventMatching.test.ts | Verifies decision write ordering. |
| pnpm-lock.yaml | Records the backend connectors dependency. |
| backend/tsconfig.check.json | Adds the connectors project reference. |
| backend/src/security/permissions.ts | Defines admin-only review permissions. |
| backend/src/api/index.ts | Registers Event mapping routes. |
| backend/src/api/eventMapping/reviewRows.ts | Validates evidence and builds resolved review rows. |
| backend/src/api/eventMapping/reviewRows.test.ts | Tests suggestions, states, counts, and malformed evidence. |
| backend/src/api/eventMapping/index.ts | Wires the four review endpoints. |
| backend/src/api/eventMapping/eventSchema.ts | Defines shared event-reference validation. |
| backend/src/api/eventMapping/eventMappingRestore.ts | Restores eligible decisions to held status. |
| backend/src/api/eventMapping/eventMappingRestore.test.ts | Tests restore validation and permissions. |
| backend/src/api/eventMapping/eventMappingList.ts | Returns review rows and state counts. |
| backend/src/api/eventMapping/eventMappingList.test.ts | Tests list responses and access checks. |
| backend/src/api/eventMapping/eventMappingIgnore.ts | Records ignore decisions as the current user. |
| backend/src/api/eventMapping/eventMappingIgnore.test.ts | Tests ignore validation and permissions. |
| backend/src/api/eventMapping/eventMappingConfirm.ts | Validates and confirms batches with catalogue suggestions. |
| backend/src/api/eventMapping/eventMappingConfirm.test.ts | Tests confirmation inputs, conflicts, and permissions. |
| backend/src/api/eventMapping/eventMapping.fixture.ts | Provides shared handler-test fixtures. |
| backend/package.json | Adds the connectors workspace dependency. |
Review effort: Balanced
lfx-one
left a comment
There was a problem hiding this comment.
Approved with one minor comment: the confirm handler reads the evidence before it takes the per-event locks (details inline). No blocking, security or privacy findings.
Documentation
This pull request changes behavior that may also be described outside this repository, such as product pages or an external docs site. I can't read those, so please check them; the author and maintainers own those updates. Changed here:
GET /event-mapping(new route)POST /event-mapping/confirm(new route)POST /event-mapping/ignore(new route)POST /event-mapping/restore(new route)eventMappingReadandeventMappingEdit(new admin-only permissions)
|
@mbani01 I'm starting review 2 of this pull request now (started 2026-11-27 16:38 UTC using review agent v0.1.34). This usually takes a few minutes. I'll update this comment with the summary when I'm done. If there's no summary here after about 45 minutes, the review stopped: push a new commit, or post a comment that begins with a mention of me followed by Hi Mouad BANI, thanks for fixing the lock-order race so quickly and for adding tests that prove it. SummaryThese two new commits take the per-event locks before the confirm handler reads the evidence. They also add the agreed project name rules and a fallback to the name rule when a Cvent event's project is not in CDP. The code is clean and well tested, and I found no new problems. Decision✅ Approved DetailsOverall impression: The fix for the read-before-lock race is the right one. 👏 Nice work: You took the read-before-lock fix to the root by locking first, and you added a test that proves the ordering instead of just asserting it. Adding the PR description's "Locks before reads" note also helps the next reader. ✅ Resolved: Confirmation derived the catalogue link from evidence read before the event locks were taken. It is fixed in Other reviewers and CI checks: Greptile and Copilot raised only the lock-order issue, and it is now resolved. No CI checks were visible on this commit at review time: the combined status was empty and pending. Branch protection and ruleset reads returned 403, so required checks could not be confirmed. Unread files: Documentation reminder: changed Rule files: read Questions, problems, or feedback: https://github.com/linuxfoundation/lfx-review-agent/issues |
lfx-one
left a comment
There was a problem hiding this comment.
Approved. The read-before-lock race from review 1 is fixed: the confirm handler now takes the sorted per-event locks before it reads the evidence, with tests for the order and for a concurrent decision waiting on the lock. The new name rules and the name-rule fallback add no blocking, minor, security or privacy findings.
Documentation
This pull request changes behavior that may also be described outside this repository, such as product pages or an external docs site. I can't read those, so please check them; the author and maintainers own those updates. Changed here:
PROJECT_ALIASESname rules (new project alias rules, and a fallback to the name rule when a Cvent event's project is not in CDP)
There was a problem hiding this comment.
🟡 Changes recommended
The alias fallback treats ambiguous Cvent project matches as missing, allowing an incorrect project suggestion and catalogue link to be stored on confirmation.
1 open issue
1 resolved since last review
1 file not reviewed
pnpm-lock.yaml: Generated file
Review effort: Balanced
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e36c5ef. Configure here.
02a724b to
4330a04
Compare
Refs linuxfoundation/lfx-cdp-insights-ops#1158 Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Refs linuxfoundation/lfx-cdp-insights-ops#1158 Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Confirming passes the suggested event's catalogue source with its Cvent id, an empty project or source id no longer resolves to a subproject, and a bulk confirmation rejects duplicate events and sorts them with a proper comparison. Refs linuxfoundation/lfx-cdp-insights-ops#1158 Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Refs linuxfoundation/lfx-cdp-insights-ops#1158 Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Refs linuxfoundation/lfx-cdp-insights-ops#1158 Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Refs linuxfoundation/lfx-cdp-insights-ops#1158 Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
e36c5ef to
a8ce642
Compare
|
@mbani01 I'm starting review 3 of this pull request now (started 2026-11-27 16:54 UTC using review agent v0.1.34). This usually takes a few minutes. I'll update this comment with the summary when I'm done. If there's no summary here after about 45 minutes, the review stopped: push a new commit, or post a comment that begins with a mention of me followed by Hi Mouad BANI, thanks for rebasing onto SummaryThis push rebased the branch onto Decision✅ Approved DetailsOverall impression: The rebase rewrote history, so ✅ Resolved: Confirmation derived the catalogue link from evidence read before the event locks were taken (finding Other reviewers and CI checks: Copilot's alias-fallback comment is marked resolved on its side, and you replied on it. I agree that the case needs two active subprojects with one source id, and it only produces a suggestion that a person still confirms. Copilot's new comment asks for pg-promise connections instead of Unread files: Documentation reminder: no new items. Changed behaviors were named in my earlier reminders. Rule files: read Questions, problems, or feedback: https://github.com/linuxfoundation/lfx-review-agent/issues |
There was a problem hiding this comment.
🟡 Changes recommended
The new event-mapping endpoints extend the prohibited legacy Sequelize database path and need the prescribed connection executors while preserving the confirmation transaction.
1 open issue
1 resolved since last review
1 file not reviewed
pnpm-lock.yaml: Generated file
Review effort: Balanced
Refs linuxfoundation/lfx-cdp-insights-ops#1158 Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
|
@mbani01 A recent review was posted within the last 5 minutes: #5468 (comment). I won't re-review yet. Push another update after 5 minutes if you want another pass. |
There was a problem hiding this comment.
🔵 Needs a closer look
The acknowledged deadlock window between bulk confirmation and daily matching/deactivation warrants a DAL/worker code owner’s review of production contention and retry behavior.
No open issues 🎉
1 resolved since last review
1 file not reviewed
pnpm-lock.yaml: Generated file
Review effort: Balanced
The writer config now follows the backend's own credential choice: the shared user when it is set, else the api user. Refs linuxfoundation/lfx-cdp-insights-ops#1158 Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
There was a problem hiding this comment.
🔵 Needs a closer look
A code owner needs to assess the shared Sessionize DAL transaction and locking changes and accept the documented deadlock window between bulk confirmation and daily deactivation, as PostgreSQL runtime validation was not performed.
No open issues 🎉
1 file not reviewed
pnpm-lock.yaml: Generated file
Review effort: Balanced



What this adds
Third of four PRs for the review of held Sessionize events. It adds the internal, admin-only API behind the "Event mapping" page of the admin panel (the page is the next PR).
#5463, #5465 and #5467 are merged; this branch is rebased on
main.Refs linuxfoundation/lfx-cdp-insights-ops#1158
Endpoints
GET /event-mappingeventMappingReadPOST /event-mapping/confirmeventMappingEditPOST /event-mapping/ignoreeventMappingEditPOST /event-mapping/restoreeventMappingEditBoth permissions are for the admin role only. Bodies are validated with Zod and
validateOrThrow.Behaviour
suggestSessionizeMapping(from feat: keep nearby cvent events on held sessionize events #5463) on the stored evidence and resolves the suggested project against the active subprojects. Nothing about a suggestion is stored. A project that does not resolve to exactly one active subproject is shown as "project not in CDP".Other changes
@crowd/connectorsbecomes a backend dependency for one pure module. Importing it loadssuggestions.ts,matching.tsandnameSimilarity.tsonly: no Snowflake, spreadsheet or HTTP code.listActiveSubprojectsForMappingin the data-access layer returns the active subprojects with their project group name in one query.Files that need a code owner
services/libs/data-access-layer/src/sessionize/index.ts,services/libs/data-access-layer/src/segments/index.ts,backend/package.json,pnpm-lock.yaml.Deploy
No migration. Deploy the API and
connectors-worker.Tests
51 backend tests, 24 data-access-layer database tests, 311 connector tests and the worker tests pass. The database tests prove that a conflict on the third item of a bulk confirm rolls back the first two.
Known limits