Skip to content

refactor: update alerts approach to newest splunk approach #1668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from

Conversation

rohanm-crest
Copy link
Contributor

@rohanm-crest rohanm-crest commented Mar 30, 2025

Issue number: ADDON-78947

PR Type

What kind of change does this PR introduce?

  • Feature
  • Bug Fix
  • Refactoring (no functional or API changes)
  • Documentation Update
  • Maintenance (dependency updates, CI, etc.)

Summary

Changes

Introduce new Splunk approaches to create custom alerts actions.

User experience

Users can see the new Splunk based component for custom alerts actions.

Checklist

If an item doesn't apply to your changes, leave it unchecked.

Review

  • self-review - I have performed a self-review of this change according to the development guidelines
  • Changes are documented. The documentation is understandable, examples work (more info)
  • PR title and description follows the contributing principles
  • meeting - I have scheduled a meeting or recorded a demo to explain these changes (if there is a video, put a link below and in the ticket)

Tests

See the testing doc.

  • Unit - tests have been added/modified to cover the changes
  • Smoke - tests have been added/modified to cover the changes
  • UI - tests have been added/modified to cover the changes
  • coverage - I have checked the code coverage of my changes (see more)

Demo/meeting:

Reviewers are encouraged to request meetings or demos if any part of the change is unclear

@pull-request-size pull-request-size bot added size/M and removed size/S labels Mar 30, 2025
@rohanm-crest rohanm-crest changed the title refactor: updated alerts into new splunk refactor: update alerts approach to newest splunk approach Mar 31, 2025
@pull-request-size pull-request-size bot added size/L and removed size/M labels Mar 31, 2025
@pull-request-size pull-request-size bot added size/M and removed size/L labels Mar 31, 2025
@pull-request-size pull-request-size bot added size/L and removed size/M labels Apr 17, 2025
Copy link

github-actions bot commented May 2, 2025

Code Coverage 🎉

Type PR Develop Change Status
Line Coverage 87.89% 87.84% 0.05% 🟢 Increased
Branch Coverage 81.48% 81.33% 0.15% 🟢 Increased

@rohanm-crest rohanm-crest marked this pull request as ready for review May 5, 2025 07:54
@rohanm-crest rohanm-crest requested a review from a team as a code owner May 5, 2025 07:54
Copy link
Contributor

@soleksy-splunk soleksy-splunk left a comment

Choose a reason for hiding this comment

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

Looks good, just please add expand_ctrl_props(param) props as for textarea etc. there might be some additional props in TAs that will modify entities.

Can we extend config everything to have those modifications in final build like maxLength for text area

type="text"
name="action.{{ mod_alert.short_name }}.param.{{ param.name }}"
id="{{ mod_alert.short_name }}_{{ param.name }}"
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we add {{ expand_ctrl_props(param) }}

<splunk-radio-input
name="action.{{ mod_alert.short_name }}.param.{{ param.name }}"
id="{{ mod_alert.short_name }}_{{ param.name }}"
value="{{ param.default_value }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we add {{ expand_ctrl_props(param) }}

<textarea
name="action.{{ mod_alert.short_name }}.param.{{ param.name }}"
id="{{ mod_alert.short_name }}_{{ param.name }}"
></textarea>
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we add {{ expand_ctrl_props(param) }} it might be useful for other text area properties like max length

https://www.w3schools.com/tags/att_textarea_maxlength.asp

b"".join(actual_file_lines)
if actual_file_lines and isinstance(actual_file_lines[0], bytes)
else b""
)
Copy link
Contributor

Choose a reason for hiding this comment

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

nice catch, I assume here was issue, right?
As before there was comparision of the same variables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yess, now it would be checking the bytes so that extra whitespace issue will resolved.

@rohanm-crest
Copy link
Contributor Author

No further requirement.
Hence, closing this ticket.

@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants