Page MenuHomeSoftware Heritage

Improve directory entry name filtering uisng casefolded strings
ClosedPublic

Authored by jayeshv on Oct 18 2022, 9:12 AM.

Diff Detail

Repository
rDGQL GraphQL API
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D8694 (id=31400)

Rebasing onto bc6f6a7269...

Current branch diff-target is up to date.
Changes applied before test
commit 2053e5de27bd1c7da3ae340206d8f5e5d6c4dc58
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Tue Oct 18 08:53:20 2022 +0200

    Improve directory entry name filtering uisng casefolded strings

See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/216/ for more details.

anlambert added a subscriber: anlambert.
anlambert added inline comments.
swh/graphql/tests/data.py
129

s/speical/special/

134

Could you use a more meaningful example as UTF-8 string and add a dedidcated test ? For instance casefold will turn german letter ß into ss.

This revision now requires changes to proceed.Oct 18 2022, 11:49 AM
swh/graphql/tests/data.py
134

b"\xc3\x9f\xc3\x9f\xc3\xa9tE\xc3\x89t".decode() == "ßßétEÉt"

The tests are using "ßßétEÉ" to search. (It is generic with pytest. parametrize where name include is always entry_name[:-1])
I too would like to make this explicit, maybe I will add a new test for this.

swh/graphql/tests/data.py
134

Use "ßßétEÉt".encode() then and add a test searching for "ss" in directory entry.

Build is green

Patch application report for D8694 (id=31408)

Rebasing onto bc6f6a7269...

Current branch diff-target is up to date.
Changes applied before test
commit c6d410118d075640f66c70a89f2003abcca8a8bd
Author: Jayesh Velayudhan <jayesh@softwareheritage.org>
Date:   Tue Oct 18 08:53:20 2022 +0200

    Improve directory entry name filtering uisng casefolded strings

See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/217/ for more details.

This revision is now accepted and ready to land.Oct 18 2022, 12:17 PM