chore: add public API alerting#4089
Conversation
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
2 similar comments
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Pull request overview
Adds targeted Slack alerting for Public API 409 Conflict errors (to support manual remediation of conflicting identities), and extends the shared Slack library with a dedicated channel + webhook mapping.
Changes:
- Added
SlackChannel.CDP_LFX_SELF_SERVE_ALERTSto route LFX self-serve conflict alerts separately. - Mapped the new channel to
CDP_LFX_SELF_SERVE_ALERTS_SLACK_WEBHOOK_URL. - Updated the Public API
errorHandlerto detectConflictErrorand send a Slack notification on 409s.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| services/libs/slack/src/types.ts | Adds a new SlackChannel enum value for LFX self-serve conflict alerting. |
| services/libs/slack/src/channels.ts | Adds env var mapping for the new channel (but currently introduces a TypeScript typing error). |
| backend/src/api/public/middlewares/errorHandler.ts | Sends a Slack notification when a ConflictError occurs in the public API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
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 2edd497. Configure here.
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
…ting Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
…ting Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
d71925b to
df80762
Compare

Issue reported by the LF SS team: https://linuxfoundation.atlassian.net/browse/LFXV2-1578?focusedCommentId=111986&sourceType=mention. The 409 error is thrown when the LF SS api tries to query our API for 2 identities that belong to different users. For now we want to fix these profiles manually. This will be given to the data quality team.
This pull request enhances error handling and alerting for the public API by introducing a new Slack alert channel specifically for conflict errors (HTTP 409). It also updates the Slack integration to support this new channel. The most important changes are grouped below:
Error Handling Improvements:
ConflictErrorin the public API'serrorHandlermiddleware, which now sends a Slack notification to the newCDP_LFX_SELF_SERVE_ALERTSchannel when a conflict occurs, providing request and error details.ConflictErrorfrom@crowd/common.Slack Integration Updates:
CDP_LFX_SELF_SERVE_ALERTSinSlackChannelto support targeted alerting.CDP_LFX_SELF_SERVE_ALERTSchannel, using its corresponding environment variable for the webhook URL.Note
Medium Risk
Adds new behavior in the public API error middleware to emit Slack alerts on
409 Conflict, and introduces a new Slack channel/env var dependency that could cause missing-config warnings or noisy alerting if conflicts are frequent.Overview
Adds targeted Slack alerting for public API
409 Conflictresponses:errorHandlernow special-casesConflictError, logs a warning, and sends a notification to the newSlackChannel.CDP_LFX_SELF_SERVE_ALERTSincluding request details and optional error context.Extends
ConflictErrorto accept an optionalcontextobject and updatesresolveMemberByIdentitiesto attach the conflictingmemberIds, and updates the Slack library to include the new channel plus its webhook env var mapping.Reviewed by Cursor Bugbot for commit 2bce00f. Bugbot is set up for automated code reviews on this repo. Configure here.