Add V2/Source hook for icinga-notifications-web#1369
Open
sukhwinder33445 wants to merge 8 commits into
Open
Conversation
ded5a93 to
c3c926f
Compare
c3c926f to
9f7ac77
Compare
7d02f46 to
680cc30
Compare
Contributor
|
I reduced the |
912ca23 to
f1465b1
Compare
497472d to
f027079
Compare
f027079 to
ee166d4
Compare
BastianLedererIcinga
previously requested changes
May 7, 2026
4da5fe6 to
bb489df
Compare
3c0a7e1 to
37d7a17
Compare
37d7a17 to
0e73027
Compare
nilmerg
reviewed
May 19, 2026
0e73027 to
476c960
Compare
nilmerg
requested changes
May 19, 2026
476c960 to
3adab77
Compare
effff0c to
bd7e1c0
Compare
nilmerg
requested changes
May 20, 2026
41e3c57 to
43d32f0
Compare
nilmerg
requested changes
May 21, 2026
76f44ab to
51b99f3
Compare
51b99f3 to
9c43f91
Compare
Decouple value suggestion logic into a standalone `Generator` instance. This allows callers to fetch column values without any `Suggestions` context. A plain `foreach` on the provider is enough. `ObjectSuggestions::fetchValueSuggestions` is reduced to a thin wrapper that resolves label-to-path input before delegating to the new class.
Moving the code to `QueryValuesProvider` does not seem helpful, as this covers a rare case that is not really necessary. To ensure consistency between the suggestions in the search bar and in `SourceHook`, this must be removed.
Remove the overwritten method `fetchFilterColumns` of `SearchControls` trait as this optimization is no longer necessary. Since the method is now only used within its own class, it can be made protected.
The code has been moved directly to the `QueryValuesProvider` class. `QueryValuesProvider`: Bypassing the ORM is no longer required. necessary and has been removed. The yield type must be an array containing at least the keys `search` and `label` for `searchSuggestion` to work. Previously these keys were created by wrapper classes.
Co-authored-by: Johannes Meyer <johannes.meyer@icinga.com>
- `assertValidCondition()`: prevent columns with wildcards other than a trailing [*]. - `enrichCondition()`: Remove trailing [*] as we usually do when rerendering the condition.
9c43f91 to
b38d2e8
Compare
All of his discussions are resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new
V2/Icinga2Sourcehook implementation to integrate with theV2/SourceHookinterface fromicinga-notifications-web.Supporting changes required by the hook:
QueryValuesProvider— Decouples value suggestion logic fromObjectSuggestionsinto a standalone Generator-based class. This allows the hook'sgetValueSuggestions()to reuse the same suggestion infrastructure without aSuggestionscontext.QueryColumnsProvider: AddsetShowRelationLabels()setter — Exposes the relation label display option so the hook can control it.QueryColumnsProvider: MakecollectFilterColumns()protected — No longer needs to be public; the override inSearchControlsthat called it statically is removed as the optimization it provided is no longer necessary.ObjectSuggestions: Remove label-to-path resolution for columns with spaces to ensure consistency between the suggestions in the search bar and suggestions provided by theIcinga2Source.resolves: #1365
Requires:
CustomvarFlat: Don't ingnore special chars when splitting #1375