Close T2863.
Details
Details
- Reviewers
seirl zack - Group Reviewers
Reviewers - Maniphest Tasks
- T2863: FUSE: lookup: add optional regex pre-condition
- Commits
- rDFUSE6e413667a220: fs: lookup: add optional regexp name validation
Diff Detail
Diff Detail
- Repository
- rDFUSE FUSE virtual file system
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
Build is green
Patch application report for D4689 (id=16640)
Rebasing onto 8515c5171d...
Current branch diff-target is up to date.
Changes applied before test
commit 1880b03749a04aa35befa0dd1e4d721eeae656b5 Author: Thibault Allançon <haltode@gmail.com> Date: Tue Dec 8 16:42:46 2020 +0100 fs: lookup: add optional regexp name validation Close T2863.
See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/233/ for more details.
swh/fuse/fs/artifact.py | ||
---|---|---|
330 | You don't want to have anything of the regex inside the fstring in case you need more changes, and then you don't need an fstring only for SWHID_REGEXP. Why not simply: ENTRIES_REGEXP = r"^([a-f0-9]+)|(" + SWHID_REGEXP + ")$" If that's too ugly, the other option is to use {{ and }} to escape the ranges. |
swh/fuse/fs/entry.py | ||
---|---|---|
80–89 | This way regexs are re-compiled at each check, which isn't great. ENTRIES_REGEXP should have as type something like Optional[re.Pattern], and the default implementation of validate_entry should do nothing if the regex is None. |
Comment Actions
- Use Optional[Pattern] instead of str (and default to None)
- Use re.compile to initialize regexp
Comment Actions
Build is green
Patch application report for D4689 (id=16643)
Rebasing onto 8515c5171d...
Current branch diff-target is up to date.
Changes applied before test
commit 6e413667a22084fd3b30e914f214bb3344aef9bc Author: Thibault Allançon <haltode@gmail.com> Date: Tue Dec 8 16:42:46 2020 +0100 fs: lookup: add optional regexp name validation Close T2863.
See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/234/ for more details.