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

core: Report names rather than ids in affinity conflicts #542

Merged
merged 1 commit into from Jul 25, 2022

Conversation

mz-pdm
Copy link
Member

@mz-pdm mz-pdm commented Jul 20, 2022

When an affinity conflict occurs, the hosts or VMs participating in
the conflict are reported by their ids. This is accurate but not very
user friendly, especially in the web UI dialog. Let’s report the
conflicting entities by their names instead.

We must retrieve the names from the corresponding DAOs. In theory,
AffinityGroup’s should contain entity names corresponding to the ids,
but this doesn’t hold and the names are often missing there.

Due to the DAO access, AffinityValidator.checkAffinityGroupConflicts
can no longer be static. And because AffinityValidator is a
singleton, it cannot be used in tests as it is (AFAICT). That means
we have to mock AffinityValidator.checkAffinityGroupConflicts in some
tests and give up on testing that method there.

Bug-Url: https://bugzilla.redhat.com/1991622

@mz-pdm
Copy link
Member Author

mz-pdm commented Jul 20, 2022

It works but I need to get rid of NullPointerException's in tests.

@mz-pdm
Copy link
Member Author

mz-pdm commented Jul 21, 2022

Tests fixed.

@mz-pdm mz-pdm marked this pull request as ready for review July 21, 2022 19:18
@mz-pdm
Copy link
Member Author

mz-pdm commented Jul 22, 2022

Good catches, less code is always good :-), thanks, fixed.

Copy link
Collaborator

@ljelinkova ljelinkova left a comment

Choose a reason for hiding this comment

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

I agree, lets continue :-)

@ljelinkova
Copy link
Collaborator

/ost

When an affinity conflict occurs, the hosts or VMs participating in
the conflict are reported by their ids.  This is accurate but not very
user friendly, especially in the web UI dialog.  Let’s report the
conflicting entities by their names instead.

We must retrieve the names from the corresponding DAOs.  In theory,
AffinityGroup’s should contain entity names corresponding to the ids,
but this doesn’t hold and the names are often missing there.

Due to the DAO access, AffinityValidator.checkAffinityGroupConflicts
can no longer be static.  And because AffinityValidator is a
singleton, it cannot be used in tests as it is (AFAICT).  That means
we have to mock AffinityValidator.checkAffinityGroupConflicts in some
tests and give up on testing that method there.

Bug-Url: https://bugzilla.redhat.com/1991622
@ahadas
Copy link
Member

ahadas commented Jul 25, 2022

/ost

@ahadas ahadas merged commit 139d368 into oVirt:master Jul 25, 2022
@mz-pdm mz-pdm deleted the affinity-names# branch August 9, 2022 08:08
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.

None yet

4 participants