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

Send filesystem type to Wanda #2126

Merged
merged 7 commits into from
Jan 11, 2024
Merged

Send filesystem type to Wanda #2126

merged 7 commits into from
Jan 11, 2024

Conversation

dottorblaster
Copy link
Contributor

@dottorblaster dottorblaster commented Dec 22, 2023

Description

Sending filesystem type to Wanda when selecting checks for a cluster, and during an execution request.

How was this tested?

Jest tests added, Elixir tests added

@dottorblaster dottorblaster added the enhancement New feature or request label Dec 22, 2023
@dottorblaster dottorblaster self-assigned this Dec 22, 2023
@dottorblaster dottorblaster marked this pull request as ready for review December 28, 2023 13:09
@dottorblaster dottorblaster force-pushed the fs-type-ascs branch 2 times, most recently from 3be197a to da2866f Compare December 29, 2023 16:06
Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

The end result could work, however my main concern is about the discrepancy between the domain and what we are modeling, connected also to the implicitness when interacting with the catalog api.

Let's get more feedback.

@@ -43,11 +47,12 @@ export function ClusterDetailsPage() {
target_type: TARGET_CLUSTER,
cluster_type: type,
ensa_version: ensaVersion,
filesystem_type: filesystemType,
Copy link
Member

Choose a reason for hiding this comment

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

ensa_version and filesystem_type are only relevant when clusterType is ascs_ers.
Here we are sending everything regardless of the context (ie ensa version/fs type sent along on a hana cluster).

It is true that some information would be ignored during query because they do not apply to a cluster type (ie ensa version very likely won't have any effect on hana checks), but I personally find it a bit confusing, inconsistent and too implicit.

We usually tend to prefer explicitness over implicitness.

assets/js/state/selectors/cluster.test.js Outdated Show resolved Hide resolved
@@ -34,6 +35,9 @@ export function ClusterDetailsPage() {
const lastExecution = useSelector(getLastExecution(clusterID));

const ensaVersion = useSelector((state) => getEnsaVersion(state, clusterID));
const filesystemType = useSelector((state) =>
Copy link
Member

@nelsonkopliku nelsonkopliku Jan 8, 2024

Choose a reason for hiding this comment

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

We do know from our domain that a filesystemType only makes sense in the context of an ascs/ers cluster and that there is no such thing like filesystemType to be considered in a non ascs/ers context.

However in all non ascs/ers scenarios (ie hana) filesystemType would end up being mixed_fs_types.

The problem, imho, is not that a variable gets a value, but that this way we're modeling something that has no correspondence in our domain. I believe we are not properly considering cluster type here.


I am aware that at the end whatever value filesystemType gets it would just be sent down to the catalog api and eventually, in the correct scenario, very likely, ignored by wanda. But as mentioned in the other comment I am not a fan of that either.

@nelsonkopliku
Copy link
Member

Another note: we are not sending the filesystem type (nor ensa version) to wanda during execution. Only in catalog loading

@dottorblaster
Copy link
Contributor Author

@nelsonkopliku thanks for all the comments, I'll follow up to them once we have ENSA version identification properly done and merged 👍

@dottorblaster
Copy link
Contributor Author

@nelsonkopliku removed the leftover test, thanks. I'd like to address the differentiation between ascs/ers and other cluster types in the frontend in a subsequent PR, what do you think?

@nelsonkopliku
Copy link
Member

removed the leftover test, thanks. I'd like to address the differentiation between ascs/ers and other cluster types in the frontend in a subsequent PR, what do you think?

Thank you! Yes, it makes sense to me as well following that up in another PR 👍 Still finishing the review tho 😄

Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

Thanks for addressing sending the env to wanda.

Besides some minor things my main feedback is about AscsErsClusterExecutionEnv. I believe we can avoid that and rely on the cluster type of the already existent ClusterExecutionEnv by doing some pattern matching.

lib/trento/clusters.ex Outdated Show resolved Hide resolved
lib/trento/clusters/enums/filesystem_type.ex Show resolved Hide resolved
lib/trento/clusters.ex Outdated Show resolved Hide resolved
lib/trento/infrastructure/checks/checks.ex Outdated Show resolved Hide resolved
test/trento/clusters_test.exs Outdated Show resolved Hide resolved
Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

Super! Thanks!

@dottorblaster dottorblaster merged commit bf44a41 into main Jan 11, 2024
26 checks passed
@dottorblaster dottorblaster deleted the fs-type-ascs branch January 11, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request user story
Development

Successfully merging this pull request may close these issues.

2 participants