Skip to content

Conversation

@n1v0lg
Copy link
Contributor

@n1v0lg n1v0lg commented Sep 28, 2025

Refactoring pass over CrossProjectIndexExpressionsRewriter to make it plug into the end-to-end expression rewriting flow (#135346).

The main change is isolating the logic of rewriting a single expression into rewriteIndexExpression. Also, fixes two smaller quirks:

  • instead of rewriting an empty index expression to "*" we rewrite to _all. There is a marginal difference in behavior between the two and _all better matches empty index expression behavior
  • uses project aliases consistently across rewriting qualified and unqualified expressions

@n1v0lg n1v0lg self-assigned this Sep 28, 2025
@n1v0lg n1v0lg added >non-issue :Security/Security Security issues without another label labels Sep 28, 2025
this(localExpression, List.of());
}

List<String> all() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will disappear once we've removed public static Map<String, List<String>> rewriteIndexExpressions in favor of calling rewriteIndexExpression inside the IndexAbstractionResolver

@n1v0lg n1v0lg changed the title Refactor CrossProjectSearchIndexExpressionRewriter Refactor CrossProjectIndexExpressionRewriter Sep 29, 2025
@n1v0lg n1v0lg changed the title Refactor CrossProjectIndexExpressionRewriter Refactor CrossProjectIndexExpressionsRewriter Sep 29, 2025
@n1v0lg n1v0lg marked this pull request as ready for review September 29, 2025 11:26
@n1v0lg n1v0lg requested a review from piergm September 29, 2025 11:26
@elasticsearchmachine elasticsearchmachine added the Team:Security Meta label for security team label Sep 29, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@n1v0lg
Copy link
Contributor Author

n1v0lg commented Sep 29, 2025

serverless failure is unrelated

Copy link
Member

@piergm piergm 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 Sep 30, 2025
@elasticsearchmachine elasticsearchmachine merged commit 22f15e9 into elastic:main Sep 30, 2025
40 checks passed
@n1v0lg n1v0lg deleted the cps-expression-rewriter branch September 30, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >non-issue :Security/Security Security issues without another label Team:Security Meta label for security team v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants