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

Avoid un-intended wildcard matches in ProfileIntegTests #117888

Merged
merged 4 commits into from
Dec 5, 2024

Conversation

n1v0lg
Copy link
Contributor

@n1v0lg n1v0lg commented Dec 3, 2024

The test setup for ProfileIntegTests is flawed, where the full name of a user can be a substring of other profile names (e.g., SER is a substring of User <random-string>-space1) -- when that's passed into suggest call with the * space, we get a match on all profiles, instead of only the one profile expected in the test, since we are matching on e.g. SER*. This PR restricts the setup to avoid the wildcard profile for that particular test.

Closes: #117782

@n1v0lg n1v0lg added >test Issues or PRs that are addressing/adding tests auto-backport Automatically create backport pull requests when merged :Security/Profile User Profiles & Personalisation v9.0.0 v8.16.2 v8.17.1 v8.18.0 labels Dec 3, 2024
@n1v0lg n1v0lg self-assigned this Dec 3, 2024
@n1v0lg n1v0lg changed the title Fix ProfileIntegTests test setup to avoid wildcard matches Avoid un-intended wildcard matches in ProfileIntegTests Dec 3, 2024
@n1v0lg n1v0lg marked this pull request as ready for review December 3, 2024 13:16
@n1v0lg n1v0lg requested a review from a team December 3, 2024 13:16
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@elasticsearchmachine elasticsearchmachine added the Team:Security Meta label for security team label Dec 3, 2024
Copy link
Contributor

@slobodanadamovic slobodanadamovic left a comment

Choose a reason for hiding this comment

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

LGTM

@n1v0lg n1v0lg added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Dec 4, 2024
@elasticsearchmachine elasticsearchmachine merged commit 2fe6b60 into elastic:main Dec 5, 2024
21 checks passed
@n1v0lg n1v0lg deleted the fix-suggest-profiles-it branch December 5, 2024 11:22
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.16
8.17
8.x

n1v0lg added a commit to n1v0lg/elasticsearch that referenced this pull request Dec 5, 2024
The test setup for `ProfileIntegTests` is flawed, where the full name of
a user can be a substring of other profile names (e.g., `SER` is a
substring of `User <random-string>-space1`) -- when that's passed into
suggest call with the `*` space, we get a match on all profiles, instead
of only the one profile expected in the test, since we are matching on
e.g. `SER*`. This PR restricts the setup to avoid the wildcard profile
for that particular test.

Closes: elastic#117782
n1v0lg added a commit to n1v0lg/elasticsearch that referenced this pull request Dec 5, 2024
The test setup for `ProfileIntegTests` is flawed, where the full name of
a user can be a substring of other profile names (e.g., `SER` is a
substring of `User <random-string>-space1`) -- when that's passed into
suggest call with the `*` space, we get a match on all profiles, instead
of only the one profile expected in the test, since we are matching on
e.g. `SER*`. This PR restricts the setup to avoid the wildcard profile
for that particular test.

Closes: elastic#117782
n1v0lg added a commit to n1v0lg/elasticsearch that referenced this pull request Dec 5, 2024
The test setup for `ProfileIntegTests` is flawed, where the full name of
a user can be a substring of other profile names (e.g., `SER` is a
substring of `User <random-string>-space1`) -- when that's passed into
suggest call with the `*` space, we get a match on all profiles, instead
of only the one profile expected in the test, since we are matching on
e.g. `SER*`. This PR restricts the setup to avoid the wildcard profile
for that particular test.

Closes: elastic#117782
elasticsearchmachine pushed a commit that referenced this pull request Dec 5, 2024
The test setup for `ProfileIntegTests` is flawed, where the full name of
a user can be a substring of other profile names (e.g., `SER` is a
substring of `User <random-string>-space1`) -- when that's passed into
suggest call with the `*` space, we get a match on all profiles, instead
of only the one profile expected in the test, since we are matching on
e.g. `SER*`. This PR restricts the setup to avoid the wildcard profile
for that particular test.

Closes: #117782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Security/Profile User Profiles & Personalisation Team:Security Meta label for security team >test Issues or PRs that are addressing/adding tests v8.16.2 v8.17.1 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] ProfileIntegTests testSuggestProfilesWithHint failing
3 participants