Skip to content

New custom property support#2972

Draft
raviks789 wants to merge 7 commits intomasterfrom
dictionary-support
Draft

New custom property support#2972
raviks789 wants to merge 7 commits intomasterfrom
dictionary-support

Conversation

@raviks789
Copy link
Copy Markdown
Collaborator

@raviks789 raviks789 commented Apr 1, 2025

@cla-bot cla-bot Bot added the cla/signed label Apr 1, 2025
@raviks789 raviks789 force-pushed the dictionary-support branch 9 times, most recently from dd916d4 to f19501d Compare April 2, 2025 10:43
@raviks789 raviks789 force-pushed the dictionary-support branch 2 times, most recently from 2ddc75b to 3583514 Compare April 11, 2025 15:55
@raviks789 raviks789 force-pushed the dictionary-support branch 10 times, most recently from e818e3e to 3260c35 Compare May 14, 2025 15:29
@raviks789 raviks789 force-pushed the dictionary-support branch 8 times, most recently from 01bbc41 to e1fac6d Compare May 27, 2025 11:27
@raviks789 raviks789 force-pushed the dictionary-support branch 4 times, most recently from 83e5b92 to 5fcc055 Compare September 3, 2025 10:48
@raviks789 raviks789 force-pushed the dictionary-support branch 2 times, most recently from e82288c to 94e9225 Compare September 22, 2025 13:51
@raviks789 raviks789 force-pushed the dictionary-support branch 7 times, most recently from 6493a77 to 0807528 Compare September 26, 2025 08:53
@raviks789 raviks789 force-pushed the dictionary-support branch 5 times, most recently from afa36bc to 57bf362 Compare October 10, 2025 12:14
@raviks789 raviks789 force-pushed the dictionary-support branch 2 times, most recently from 4c6962e to 7aba001 Compare March 11, 2026 15:11
@nilmerg
Copy link
Copy Markdown
Member

nilmerg commented Apr 16, 2026

Unfortunately, I had to revert automatic form element escaping in ipl-html: Icinga/ipl-html#196

So you have to protect against invalid form element names here on your own. A viable and easy alternative might be hashing the names using md5.

@raviks789
Copy link
Copy Markdown
Collaborator Author

raviks789 commented Apr 17, 2026

Unfortunately, I had to revert automatic form element escaping in ipl-html: Icinga/ipl-html#196

So you have to protect against invalid form element names here on your own. A viable and easy alternative might be hashing the names using md5.

Thanks for the info! However, the implementation has changed since then and custom variable names are no longer used as form element names. Hence, reverting those changes will not affect this PR.

raviks789 and others added 7 commits April 17, 2026 14:37
Introduce a first-class DirectorProperty concept that extends the existing
data-fields model with rich, structured variable types. Custom variables can
now be defined globally under a new "Custom Variables" section and assigned
to Icinga objects (hosts, services, commands, etc.).

Supported types: string, number, boolean, fixed-array, dynamic-array,
datalist-strict, datalist-non-strict, fixed-dictionary, and
dynamic-dictionary (one level of nesting allowed).

Key changes:
  - DirectorProperty object with CRUD, inheritance, and apply-for rule support
  - New form elements: Dictionary, DictionaryItem, NestedDictionary,
    NestedDictionaryItem, ArrayElement, IplBoolean
  - CustomvarController for managing global property definitions
  - VariablesController for per-object variable assignment
  - BasketSnapshotCustomVariableResolver for basket import/export of properties
  - REST API: IcingaObjectHandler extended to expose and accept structured vars
  - IcingaConfigHelper: renders dictionaries/arrays to valid Icinga 2 DSL
  - CustomVarRenderer updated for icingadb hook display
  - DB migration upgrade_192.sql: new director_property and related tables
  - CLI: MigrateCommand for migrating legacy vars to properties;
    HostsCommand for bulk host custom variable management
Constraints follow the pattern `<table>_<column>`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants