Skip to content
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

Add setmembers summyary line to TemplateUsageTable #2378

Merged
merged 5 commits into from
Sep 21, 2023

Conversation

raviks789
Copy link
Collaborator

@raviks789 raviks789 commented Aug 17, 2021

Services under service set is shown under setmembers of TemplateUsageTable. And objects shows only services which do not belong to service set. This must solve the inconsistent number of objects problem.

ref/IP/33703

@cla-bot cla-bot bot added the cla/signed label Aug 17, 2021
@raviks789 raviks789 changed the title Add service_set_id is null condition to objects in ServiceTemplateU… Add service_set_id is null condition to objects in ServiceTemplateUsageTable.php Aug 17, 2021
@raviks789 raviks789 force-pushed the fix/service-template-usage-table branch from d4c2985 to 84682a8 Compare August 17, 2021 14:51
@raviks789 raviks789 changed the title Add service_set_id is null condition to objects in ServiceTemplateUsageTable.php Remove service_set_id is null condition to objects in ObjectTableService.php Aug 17, 2021
Copy link
Contributor

@Thomas-Gelf Thomas-Gelf left a comment

Choose a reason for hiding this comment

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

Hi @raviks789,

showing Services belonging to Service Sets in the "Single Services" list is not a fix for the problem you encountered. The problem is, that the "Usage summary" table doesn't provide a row for Service Templates used by Services in a Set.

ServiceTemplateUsageTable already shows a related (commented) section. However, this has been never been implemented. The following pieces are missing:

  • a route/table showing you such services in a filtered way, together with der Service Set
  • an extension to TemplateUsageTable, allowing inheriting classes to tweak the underlying query

Best,
Thomas

@Thomas-Gelf
Copy link
Contributor

NB: forget what I wrote about TemplateUsageTable, it already allows to tweak the query. To fix the numbers for single Services, use:

'objects' => $this->getSummaryLine('object', 'o.service_set_id IS NULL'),

To add Service Set members, use:

'setmembers' => $this->getSummaryLine('object', 'o.service_set_id IS NOT NULL'),

Then it should look as follows:

director_template_usage_set_members

To then complete the task, a quick attempt could be adding the possibility to filter the Service Set list by "used service template".

@raviks789 raviks789 changed the title Remove service_set_id is null condition to objects in ObjectTableService.php Add setmembers summyary line to TemplateUsageTable Aug 19, 2021
@raviks789 raviks789 removed the request for review from lazyfrosch September 23, 2021 09:28
@raviks789 raviks789 force-pushed the fix/service-template-usage-table branch 2 times, most recently from 071ec41 to 1e86760 Compare September 30, 2021 15:26
@Thomas-Gelf Thomas-Gelf added this to the 1.10.0 milestone May 19, 2022
@Thomas-Gelf Thomas-Gelf modified the milestones: 1.10.0, next Jun 20, 2022
@Thomas-Gelf Thomas-Gelf modified the milestones: next, v1.11.0 May 10, 2023
@Thomas-Gelf
Copy link
Contributor

Cannot be merged yet:

  • merge conflict is easy to resolve
  • new table predates branches, it does not support them - which is tricky, but a hard requirement right now
  • 'objects' summary line needs o.host_id IS NOT NULL
  • table needs to ignore services bound to hosts (host_id IS NOT NULL)
  • summary count still does not match table count, probably because on of them counts the services used in our sets, and the other one shows services of sets assigned to single hosts

@Thomas-Gelf Thomas-Gelf modified the milestones: v1.11.0, next Jul 19, 2023
@raviks789 raviks789 force-pushed the fix/service-template-usage-table branch 3 times, most recently from 15ba1f8 to 8f53620 Compare July 21, 2023 10:00
@raviks789 raviks789 force-pushed the fix/service-template-usage-table branch 4 times, most recently from 4f354fe to 6f27ffe Compare August 7, 2023 08:43
@raviks789 raviks789 force-pushed the fix/service-template-usage-table branch 5 times, most recently from ee9a35f to b65b9d3 Compare September 21, 2023 09:40
@Thomas-Gelf Thomas-Gelf modified the milestones: next, v1.11.0 Sep 21, 2023
raviks789 and others added 5 commits September 21, 2023 14:52
`'setmembers' => $this->getSummaryLine('object', 'o.service_set_id IS NOT NULL AND o.host_id IS NOT NULL'),` is added to TemplateUsageTable
and `objects` is set to ` $this->getSummaryLine('object', 'o.service_set_id IS NULL')`. Subsequently, ObjectTableSetMembers
is added which is used in `setmembersAction` in `TemplateController`. `ObjectTableSetMembers` uses service set name or service name
as search columns.
The host or service objects require retrieve the imports column. This
makes it possible to filter them based on templates when a director
branch is active.
…ches

Icinga objects must be filterable based on templates when a director branch is active.
… branches`

`TemplateUsageTable`, `ApplyRulesTable`, `ObjectsTableSetmembers` and `TemplatesTable` are
made compatible with `director branches`.
@Thomas-Gelf Thomas-Gelf force-pushed the fix/service-template-usage-table branch from c15bd84 to 6b419b3 Compare September 21, 2023 12:52
@Thomas-Gelf Thomas-Gelf merged commit 7426e65 into master Sep 21, 2023
13 checks passed
@Thomas-Gelf Thomas-Gelf deleted the fix/service-template-usage-table branch September 21, 2023 12:57
@Thomas-Gelf
Copy link
Contributor

Merged, thank you! Disclaimer: I didn't test it at all ;-)

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.

3 participants