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 Host Check Selection Domain logic #1524

Merged
merged 2 commits into from
Jun 19, 2023
Merged

Conversation

nelsonkopliku
Copy link
Member

@nelsonkopliku nelsonkopliku commented Jun 14, 2023

Description

This PR adds a new command Trento.Domain.Commands.SelectHostChecks, which allows the selection of host checks within the host aggregate. Upon execution, the command triggers the emission of the Trento.Domain.Events.HostChecksSelected event, leading to a change in the state.

We're deferring updating cluster related command/event pair related to check selection
Trento.Domain.Commands.SelectChecks/Trento.Domain.Events.ChecksSelected.
Not much for the command, but mainly for the event.

How was this tested?

Automated tests.

@nelsonkopliku nelsonkopliku force-pushed the host-checks-selection-domain branch 4 times, most recently from 02b0e06 to e62ec9e Compare June 15, 2023 07:07
@nelsonkopliku nelsonkopliku added enhancement New feature or request user story elixir Pull requests that update Elixir code labels Jun 15, 2023
@nelsonkopliku nelsonkopliku force-pushed the host-checks-selection-domain branch from e62ec9e to c723433 Compare June 15, 2023 07:36
@EMaksy EMaksy force-pushed the host-checks-selection-domain branch from b83c54c to 33d5606 Compare June 15, 2023 15:24
@nelsonkopliku nelsonkopliku force-pushed the host-checks-selection-domain branch from 33d5606 to fc32b7e Compare June 15, 2023 15:53
@nelsonkopliku nelsonkopliku marked this pull request as ready for review June 15, 2023 15:54
Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

One change then we can merge 👍

test/trento/domain/host/host_test.exs Outdated Show resolved Hide resolved
@nelsonkopliku nelsonkopliku force-pushed the host-checks-selection-domain branch from fc32b7e to 5f1e790 Compare June 16, 2023 13:26
Copy link
Member

@EMaksy EMaksy left a comment

Choose a reason for hiding this comment

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

Hey thanks for all --> LGTM :D

@nelsonkopliku nelsonkopliku force-pushed the host-checks-selection-domain branch from 5f1e790 to d16a90e Compare June 16, 2023 15:36
%Host{host_id: nil},
%SelectHostChecks{}
) do
{:error, :host_not_registered}
Copy link
Member Author

@nelsonkopliku nelsonkopliku Jun 16, 2023

Choose a reason for hiding this comment

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

I added this clause to keep the domain consistent.
However, this will be likely replaced by what has been implemented in deregistration

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, it will cause conflicts

%Host{host_id: nil},
%SelectHostChecks{}
) do
{:error, :host_not_registered}
Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, it will cause conflicts

Co-authored-by: Eugen Maksymenko <eugen.maksymenko@suse.com>
@nelsonkopliku nelsonkopliku force-pushed the host-checks-selection-domain branch from d16a90e to e2a161a Compare June 19, 2023 08:10
Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: Eugen Maksymenko <eugen.maksymenko@suse.com>
@nelsonkopliku nelsonkopliku force-pushed the host-checks-selection-domain branch from e2a161a to 37d424b Compare June 19, 2023 08:40
@nelsonkopliku nelsonkopliku merged commit 005a81c into main Jun 19, 2023
@nelsonkopliku nelsonkopliku deleted the host-checks-selection-domain branch June 19, 2023 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elixir Pull requests that update Elixir code enhancement New feature or request user story
Development

Successfully merging this pull request may close these issues.

4 participants