-
Notifications
You must be signed in to change notification settings - Fork 163
Open
Milestone
Description
Now that we are testing with a realistic SHARED_PROJECT_PATH configuration, I wonder if we can use some details of the assumed structure to make the scan for importable projects more effecient. There are two main strategies I can see.
- Use the
findcommand to only get folders with*/.ondemand/manifest.ymlstructure, and check for readability. This would certainly be faster, though I am not sure if
- We can rely on the find command in all supported OS's
- We can efficiently filter out 'Permission Denied' errors, which are the bulk of the output.
- Only look in writable directories (instead of readable). I am pretty sure after the mode discussion in add setgid option to projects #4872 (comment) that all directories in the path have to be writable (for full collaboration at least) and this greatly reduces the space we have to search over. For example, running a distilled version of the loop
['/fs/ess/'].map do |root|
Dir.each_child(root).map do |child|
child_dir = "#{root}#{child}"
next unless File.directory?(child_dir) && File.readable?(child_dir)
child_dir
end.flatten
end.flatten.compact.lengthYields 34 readable children, while changing the test to writable? only yields 3. While importing from a dir that you cannot write to may be a route to the 'read-only' collaboration, it is not something that we explicitly support and should not be including in these shortcuts (and the chance of this readability extending past the top level is very low).
Metadata
Metadata
Assignees
Labels
No labels