Skip to content

feat: add support for shortdesc, tags and examples in searchbnf.conf#1977

Open
Benni0 wants to merge 8 commits into
splunk:developfrom
Benni0:develop
Open

feat: add support for shortdesc, tags and examples in searchbnf.conf#1977
Benni0 wants to merge 8 commits into
splunk:developfrom
Benni0:develop

Conversation

@Benni0

@Benni0 Benni0 commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

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

Added support for additional config parameters of searchbnf.conf. This PR allows to specify shortdesc, tags and examples for each custom search command. This parameters are used to display the command description in search assistant.

Changes

Added the parameters shortdesc, tags and examples for custom search command to the schema and modified the generator and the template for searchbnf.conf to support these parameters.

User experience

Now the user can specify the parameters shortdesc, tags and examples in the globalConfig.json which provides the ability to enhance the information displayed in the search assistant.

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

@Benni0

Benni0 commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

Hi @kkedziak-splunk,
how can we proceed here?
I hope the features from my pull requests make sense to you?
The errors from the CI test seems to be not affected by my changes.

@kkedziak-splunk kkedziak-splunk 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.

Review Summary

Overall a clean and well-structured PR that adds shortdesc, tags, and examples support to searchbnf.conf generation. Good test coverage for the new fields.

Issues found:

  1. Typo in schema description (schema.json): "Short description or the custom search command" should be "Short description of the custom search command".

  2. Template trailing newline (searchbnf_conf.template): The file is missing a final newline. This can cause issues with some tooling and linters.

  3. Doc grammar (custom_search_commands.md): "Each search command can have multiple examples, which are shown displayed in the search assistant" — "shown displayed" is redundant.

  4. Validator warning message could be improved (global_config_validator.py): The warning message says "but attributes required for 'searchbnf.conf' is defined which is not required" — now that there are more attributes (shortdesc, tags, examples), consider updating to plural: "are defined which are not required".

  5. No test for empty examples array edge case: There is no test verifying behavior when examples is an explicitly empty array [] in the config. The existing test covers omitted examples but not empty array.

Good work overall — the schema additions, template changes, and test coverage are solid.

"shortdesc": {
"type": "string",
"description": "Short description or the custom search command, used as shortdesc in searchbnf.conf"
},

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.

Typo: "Short description or the custom search command" should be "Short description **of** the custom search command".

example{{ loop.index }} = {{ example["search"] }}
comment{{ loop.index }} = {{ example["comment"] }}
{% endfor -%}
{% endfor -%} No newline at end of file

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.

Missing final newline at end of file. This can cause issues with some tools and linters. Consider adding a trailing newline.

Each search command can have multiple examples, which are shown displayed in the search assistant. The Compact mode, only shows the first example. In the Full mode, the top three examples are displayed.

For example:

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.

Grammar: "which are shown displayed" is redundant. Should be either "which are shown in the search assistant" or "which are displayed in the search assistant".

@Benni0

Benni0 commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi @kkedziak-splunk,
thank you for your feedback!
I've made some updates in order to fix the mentioned issues. Can you please recheck?

To avoid unnecessary merge conflicts I want to merge the updates from this pull request in the next pull request (#1979) before fixing the issues there. For this, I'll wait until this pull request is ready to be merged. Is that OK for you?

@Benni0 Benni0 requested a review from kkedziak-splunk April 3, 2026 20:28
@Benni0

Benni0 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi @kkedziak-splunk,
do you have feedback for this pull request?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants