Repository navigation
Stop incorrect IFS directories being protected - #3512
Nathaniel-King-Navarrete wants to merge 3 commits into
Conversation
|
Hi @Nathaniel-King-Navarrete Is this ready for the review? Test cases are always welcome :-D |
|
@buzzia2001 Ready for review. Thoughts on me not updating the other l10n bundles? Thanks! |
buzzia2001
left a comment
There was a problem hiding this comment.
Thanks! The boundary-aware matching is a nice improvement. A few issues before merge:
Must fix
- l10n key mismatch: the bundle key is missing the closing
)that thevscode.l10n.t(...)string insettings/index.tshas, so the lookup never matches. The file also lost its trailing newline. - Test leaks config: the
it.eachcases overwriteconfig.protectedPathson the shared connection (in aconcurrentdescribe) and never restore it. Wrap the body intry/finallyand restore the original value. *protects the whole IFS: entries that don't start with/are still compiled in the IFS branch, so*becomes^[^/]*(?:/.*)?$and matches every path. Add.filter(p => p.startsWith('/'))./QOpenSyscase bypass: the/QOpenSysprefix itself is compared case-sensitively, so/qopensys/secret(same object) isn't protected. Normalise the prefix before matching and flip the corresponding test.
To discuss
- At the moment wildcards only apply to IFS entries;
MYLIB*still uses exactincludes().
Nits
- A
RegExpis rebuilt per entry on every call (hot path in the tree views), so consider caching the compiled patterns. - This is a third glob-to-regex implementation (after
Filter.tsandsnippets.ts); a shared helper would keep their semantics aligned. - The pure matcher logic only runs in the live IBM i suite; a unit test wouldn't need a connection.
…, and normalize /qopensys to /QOpenSys in protected paths
(facepalm)
Good catch! This should have
I was trying to address the complaints from the ticket, but I am happy to implement what you think is best. Let me know :)
@buzzia2001 Do you want the nits in the same PR, or should I create another PR to address them? |
Changes
If the user has explicitly included
*in their protected directories path, then protect all matching directories.Protected Path:



Before:
After:
Protected Path:



Before:
After:
@SanjulaGanepola Should I write some tests for this change? Also, is using Google Translate on the l10n bundles acceptable, or do we just fill out the languages we know? Thanks.
How to test this PR
Change the
Protected PathsinConnection Settingsunder theSource Codetab. The IFS Browser should have a locked icon for those directories.Checklist
console.logs I addedCloses #3507