Skip to content

Conversation

@kderusso
Copy link
Member

Adds remaining BWC tests to the ent-search module.

@kderusso kderusso added >non-issue :EnterpriseSearch/Application Enterprise Search Team:Enterprise Search Meta label for Enterprise Search team v8.10.0 labels Jul 27, 2023
&& eventTime == that.eventTime
&& Objects.equals(eventType, that.eventType)
&& Objects.equals(xContentType, that.xContentType)
&& Objects.equals(xContentType.canonical(), that.xContentType.canonical())
Copy link
Member Author

Choose a reason for hiding this comment

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

The canonical() calls were added here to ensure that versioned XContentTypes still act as equivalent in BWC tests.

@kderusso kderusso requested review from a team, afoucret, joemcelroy and saarikabhasi July 27, 2023 18:31
@kderusso kderusso marked this pull request as ready for review July 27, 2023 18:33
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ent-search-eng (Team:Enterprise Search)


static {
PARSER.declareStringOrNull(optionalConstructorArg(), NAME_FIELD);
PARSER.declareStringArray(constructorArg(), INDICES_FIELD);
Copy link
Contributor

Choose a reason for hiding this comment

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

just a note for both of us - this will not be compatible with #98036 since I removed the indices from the list search apps API - so whichever PR gets merged second, we need to make sure we get the latest changes

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a really good observation. I actually think it might be best to merge this one first, so we can ensure that BWC works after removing the indices. WDYT?

}

@Override
protected PutSearchApplicationAction.Response mutateInstanceForVersion(
Copy link
Contributor

Choose a reason for hiding this comment

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

we have to implement this because we are now inheriting from AbstractBWCWireSerializationTestCase.

this is not related to your PR, but looking at the other (~70) implementation of this method most of them are the same where we just do return instance.

Is there a reason why this is an abstract method?

protected abstract T mutateInstanceForVersion(T instance, TransportVersion version);

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a really good question.

My guess is that the assumption was, these tests wouldn't be written unless we had backwards compatibility changes to address. However, if we're going to be proactively including them (which I think is a good idea) then it would make sense to have a sane default to return the instance.

Copy link
Member

Choose a reason for hiding this comment

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

I guess the intention is to make us think about that. If we're doing a BWC test, then something could have changed between version serializations. So probably it's let's not forget?

Copy link
Contributor

Choose a reason for hiding this comment

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

(@kderusso - sorry again, I know this is not related to your PR and it's not a change I propose doing here)
I don't know if there's a clear intention behind making this method abstract or if all implementations just follow a pattern that's already in place.
This method was added as part of #69534 by @astefan.

@astefan - do you think it would make sense to provide a sane default here instead of having this be an abstract method and forcing an implementation in each subclass?

@kderusso kderusso requested a review from ioanatia July 28, 2023 18:16
Copy link
Member

@carlosdelest carlosdelest left a comment

Choose a reason for hiding this comment

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

}

@Override
protected PutSearchApplicationAction.Response mutateInstanceForVersion(
Copy link
Member

Choose a reason for hiding this comment

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

I guess the intention is to make us think about that. If we're doing a BWC test, then something could have changed between version serializations. So probably it's let's not forget?

@kderusso kderusso merged commit 022a927 into elastic:main Jul 31, 2023
@kderusso kderusso deleted the kderusso/bwc-tests branch July 8, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:EnterpriseSearch/Application Enterprise Search >non-issue Team:Enterprise Search Meta label for Enterprise Search team v8.10.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants