Skip to content

feat(sekoiaio): add custom status and verdict to trigger and action o…#2073

Open
alexandreLavenant wants to merge 1 commit intodevelopfrom
feat/sekoiaio/alerts/add-custom-status-verdict-update-get
Open

feat(sekoiaio): add custom status and verdict to trigger and action o…#2073
alexandreLavenant wants to merge 1 commit intodevelopfrom
feat/sekoiaio/alerts/add-custom-status-verdict-update-get

Conversation

@alexandreLavenant
Copy link
Contributor

@alexandreLavenant alexandreLavenant commented Mar 4, 2026

add custom status and verdict properties to trigger and action of the alert

Summary by Sourcery

New Features:

  • Include alert custom_status and verdict metadata in the alert trigger payload and alert actions responses/requests.

@alexandreLavenant alexandreLavenant requested review from a team and squioc March 4, 2026 16:56
@alexandreLavenant alexandreLavenant self-assigned this Mar 4, 2026
@alexandreLavenant alexandreLavenant added enhancement New feature or request python Pull requests that update python code labels Mar 4, 2026
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 4, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Expose alert custom_status and verdict fields in both the alert trigger payload and related alert actions so downstream consumers can access and manipulate these attributes.

ER diagram for alert, custom_status, and verdict

erDiagram
    ALERT {
        string id
        string created_at
        string urgency
    }

    STATUS {
        string uuid
        string name
    }

    CUSTOM_STATUS {
        string uuid
        string name
    }

    VERDICT {
        string uuid
        string name
    }

    ALERT ||--o| STATUS : has_status
    ALERT ||--o| CUSTOM_STATUS : has_custom_status
    ALERT ||--o| VERDICT : has_verdict
Loading

Class diagram for updated alert payload structure

classDiagram
    class AlertPayload {
        +string created_at
        +string urgency
        +object entity
    }

    class Status {
        +string name
        +string uuid
    }

    class CustomStatus {
        +string name
        +string uuid
    }

    class Verdict {
        +string name
        +string uuid
    }

    AlertPayload *-- Status : status
    AlertPayload *-- CustomStatus : custom_status
    AlertPayload *-- Verdict : verdict
Loading

File-Level Changes

Change Details Files
Include custom_status and verdict fields in the alert trigger output payload.
  • Extend the alert mapping in the trigger handler to add a custom_status object populated from alert.custom_status.label and alert.custom_status.uuid.
  • Extend the alert mapping in the trigger handler to add a verdict object populated from alert.verdict.label and alert.verdict.uuid.
Sekoia.io/sekoiaio/triggers/alerts.py
Update alert action definitions to support custom_status and verdict fields.
  • Adjust the get-an-alert action schema to expose the new custom_status and verdict fields in the alert representation.
  • Adjust the patch-an-alert action schema to allow reading/updating custom_status and verdict where supported by the backend.
Sekoia.io/action_get_an_alert.json
Sekoia.io/action_patch_an_alert.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The mapping for custom_status and verdict uses .get("label") while status uses .get("name"); if this is intentional due to the upstream schema, consider adding a brief code comment to clarify the difference and avoid future confusion.
  • The nested alert.get(..., {}).get(...) pattern is now repeated for status, custom_status, and verdict; consider extracting a small helper to build these {name, uuid} dicts to reduce repetition and make the structure easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The mapping for `custom_status` and `verdict` uses `.get("label")` while `status` uses `.get("name")`; if this is intentional due to the upstream schema, consider adding a brief code comment to clarify the difference and avoid future confusion.
- The nested `alert.get(..., {}).get(...)` pattern is now repeated for `status`, `custom_status`, and `verdict`; consider extracting a small helper to build these `{name, uuid}` dicts to reduce repetition and make the structure easier to maintain.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant