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

bugfix: namespaceDepth filter loses entry content #6648

Merged
merged 1 commit into from Apr 21, 2023

Conversation

XN137
Copy link
Contributor

@XN137 XN137 commented Apr 21, 2023

implicit namespaces are somewhat deprecated and thus also the namespaceDepth filter

however as long as the filter exists, it should not lose already retrieved information about the content of real entries

implicit namespaces are somewhat deprecated and thus also the
namespaceDepth filter

however as long as the filter exists, it should not lose already
retrieved information about the content of real entries
soft.assertThat(entries)
.hasSize(2)
.map(e -> immutableEntry(e.getName(), e.getType()))
.containsExactlyInAnyOrder(
immutableEntry(ContentKey.of("a", "b", "c", "secondTable"), Content.Type.ICEBERG_TABLE),
immutableEntry(ContentKey.of("a", "b", "c", "firstTable"), Content.Type.ICEBERG_TABLE));

// namespaceDepth filter always returns contentId of real entries
entries = entries(reference.getName(), reference.getHash(), 4, filterThatFindsTwoTables, false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

before the fix:

java.lang.AssertionError: 
Expecting all elements of:
  [Entry{type=ICEBERG_TABLE, name=a.b.c.firstTable, contentId=null, content=null},
    Entry{type=ICEBERG_TABLE, name=a.b.c.secondTable, contentId=null, content=null}]
to satisfy given requirements, but these elements did not:

see how both contentId and content were always null

EntriesResponse.Entry.entry(key.getKey(), key.getType(), key.getContentId());
c != null
? EntriesResponse.Entry.entry(key.getKey(), key.getType(), c)
: EntriesResponse.Entry.entry(key.getKey(), key.getType(), key.getContentId());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note this is the same logic as in the else branch of the line 768 if statement

@XN137 XN137 marked this pull request as ready for review April 21, 2023 09:07
Copy link
Member

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Nice find! 👍

@XN137 XN137 merged commit 0540aa6 into projectnessie:main Apr 21, 2023
24 checks passed
@XN137 XN137 deleted the namespaceDepth-loses-content branch April 21, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants