Skip to content

Drop some superfluous Redis -> DB value mappings #964

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

yhabteab
Copy link
Member

@yhabteab yhabteab commented May 21, 2025

This PR is basically the same as Icinga/icinga2#10452 and removes the now superfluous Redis -> DB value mappings, and also makes the {host,service}_state.is_acknowledged column a simple boolenum and introduces a new is_sticky_acknowledgement column to indicate sticky acknowledgements.

Requires

@cla-bot cla-bot bot added the cla/signed label May 21, 2025
@yhabteab yhabteab requested a review from oxzi May 21, 2025 10:01
@yhabteab yhabteab force-pushed the streamline-redis-and-db-types branch from 9f60050 to 85b55ab Compare May 21, 2025 10:08
@oxzi oxzi added this to the 1.4.0 milestone May 21, 2025
@oxzi oxzi self-requested a review May 21, 2025 14:26
Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

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

First, thanks for this PR. In general, it looks good.

I went over the code - and its counterpart in Icinga 2 - multiple times and added some small comments.

Furthermore, I did some testing in a playground setup and clicking a non-sticky and a sticky in Icinga DB Web resulted in the expected data within the relation database.

MariaDB [icingadb]> select comment.text, is_acknowledged, is_sticky_acknowledgement  from service_state join comment on service_state.acknowledgement_comment_id = comment.id where is_acknowledged = 'y'\G
*************************** 1. row ***************************
                     text: F
          is_acknowledged: y
is_sticky_acknowledgement: n
*************************** 2. row ***************************
                     text: sticky F
          is_acknowledged: y
is_sticky_acknowledgement: y
2 rows in set (0.004 sec)

@yhabteab yhabteab force-pushed the streamline-redis-and-db-types branch from 85b55ab to ca18d4c Compare May 23, 2025 09:29
@yhabteab yhabteab requested a review from oxzi May 23, 2025 09:30
Copy link
Member

@oxzi oxzi 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 so far, thanks!

After this PR's counterpart against Icinga 2 was properly reviewed and merged, I would take another look. Consider this a soft approve.

However, my comment regarding the different column order in PostgreSQL remains; #964 (comment). I would like to hear some opinions if we should resolve this or treat this as an annoyance to be ignored.

@yhabteab yhabteab force-pushed the streamline-redis-and-db-types branch from ca18d4c to 3a20d8d Compare May 28, 2025 10:35
@yhabteab yhabteab force-pushed the streamline-redis-and-db-types branch 2 times, most recently from dd51836 to 7b2fd34 Compare May 30, 2025 10:29
@yhabteab yhabteab requested a review from julianbrost May 30, 2025 10:35
@yhabteab yhabteab force-pushed the streamline-redis-and-db-types branch 2 times, most recently from 5026371 to 7fdc513 Compare May 30, 2025 15:33
@oxzi oxzi added the area/migrate cmd/icingadb-migrate label Jun 4, 2025
@yhabteab yhabteab force-pushed the streamline-redis-and-db-types branch 2 times, most recently from d15e93d to 0b5af71 Compare June 4, 2025 12:30
@yhabteab yhabteab requested review from julianbrost and oxzi and removed request for julianbrost and oxzi June 4, 2025 12:32
@yhabteab yhabteab force-pushed the streamline-redis-and-db-types branch 2 times, most recently from 50f67f6 to 7cf3c9c Compare June 4, 2025 13:12
@yhabteab
Copy link
Member Author

yhabteab commented Jun 4, 2025

That was my final push :). So please have another look again!

@yhabteab yhabteab requested review from oxzi and julianbrost June 4, 2025 13:13
@yhabteab yhabteab force-pushed the streamline-redis-and-db-types branch from 7cf3c9c to c7da5ed Compare June 5, 2025 12:23
Icinga 2 sets now the `state_type` field to either `hard` or `soft`,
thus the mappings within the Icinga DB code is no longer needed.
@yhabteab yhabteab force-pushed the streamline-redis-and-db-types branch from c7da5ed to c6a569e Compare June 5, 2025 12:25
@yhabteab yhabteab force-pushed the streamline-redis-and-db-types branch from c6a569e to ea17fa4 Compare June 5, 2025 12:35
@yhabteab yhabteab requested a review from julianbrost June 5, 2025 13:22
Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

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

LGTM.

Went over the code another time, tested it together with Icinga 2 based on your other PR, tested updated icingadb-migrate command. Nothing fell apart. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/migrate cmd/icingadb-migrate cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants