Skip to content

Conversation

@mosche
Copy link
Contributor

@mosche mosche commented Feb 24, 2025

No description provided.

@mosche mosche requested a review from a team as a code owner February 24, 2025 10:32
@mosche mosche removed the request for review from a team February 24, 2025 10:32
@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.1.0 labels Feb 24, 2025
@mosche mosche added >non-issue :Core/Infra/Entitlements Entitlements infrastructure labels Feb 24, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Feb 24, 2025
@mosche mosche added auto-backport Automatically create backport pull requests when merged v8.18.1 and removed Team:Core/Infra Meta label for core/infra team labels Feb 24, 2025
@elasticsearchmachine elasticsearchmachine removed the needs:triage Requires assignment of a team area label label Feb 24, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Feb 24, 2025
@mosche mosche requested a review from a team February 24, 2025 14:06
Copy link
Contributor

@ldematte ldematte left a comment

Choose a reason for hiding this comment

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

LGTM

if (ndx < -1) {
String maybeParent = paths[-ndx - 2];
return path.startsWith(maybeParent) && path.startsWith(FILE_SEPARATOR, maybeParent.length());
// Normalization on Windows does not allways remove trailing backslashes, we need to check both patterns
Copy link
Contributor

Choose a reason for hiding this comment

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

Not important, but there is a little spelling mistake (always)

Copy link
Contributor

@prdoyle prdoyle left a comment

Choose a reason for hiding this comment

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

If the issue is trailing dir separators, I think we ought to remove them in our normalization, rather than tolerate them in the checks.

@prdoyle
Copy link
Contributor

prdoyle commented Feb 24, 2025

The ironic thing is, Path.startsWith and Path.endsWith take all these things into account. It seems we've inflicted this on ourselves by converting to Strings.

@prdoyle
Copy link
Contributor

prdoyle commented Feb 24, 2025

I just tried reimplementing FileAccessTree in terms of Path instead of String. A hurdle: even though Path implements Comparable<Path>, you can't actually compare two arbitrary Path objects: they must be from the same file system provider. I ended up getting this exception:

class org.apache.lucene.tests.mockfile.FilterPath cannot be cast to class sun.nio.fs.UnixPath

@mosche
Copy link
Contributor Author

mosche commented Feb 24, 2025

@prdoyle where are we with this? Sounds like this PR can be closed, right?

@mosche mosche closed this Feb 25, 2025
@mosche
Copy link
Contributor Author

mosche commented Feb 25, 2025

obsolete, fixed as part of #123291

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 :Core/Infra/Entitlements Entitlements infrastructure >non-issue Team:Core/Infra Meta label for core/infra team v8.18.1 v8.19.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants