-
Notifications
You must be signed in to change notification settings - Fork 117
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
Detailed discussion and complete code for "Discover shared projects" #4153
Conversation
One issue I have seen is So, But, CurrentUser.group_names returns |
apps/dashboard/app/models/project.rb
Outdated
vendor_path = ENV['VENDOR_SHARED_FILESYSTEM'] || '' | ||
[ | ||
Pathname.new('/fs/projects'), | ||
Pathname.new('/fs/scratch'), | ||
Pathname.new(vendor_path) | ||
] | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should come from the configuration_singleton.rb
and likely shouldn't have hard coded paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, will update
apps/dashboard/app/models/project.rb
Outdated
Project.new({ id: id, directory: directory }) | ||
end | ||
|
||
shared_projects_paths.each do |path| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be searching this all the time. Maybe we need a new view to import projects
where we can trigger a search and potentially add an item to their own lookup file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you suggest
-
Using
Rails.application.config.after_initialize
function atdashboard/config/initializer
and search for all path and save to.project_lookup
or may be.shared_project_lookup
. So will happpen everytime a user logs into dashboard (but may not end up using projects) -
Create a
_helper.rb
, which will be called fromproject_controller.rb:index()
and update the.project_lookup
. So if a user route to project index then we add new entries to lookup file. To track single time edit we can keep a class variable. {also will have to track if any project already exists in the lookup} -
Any better and easier suggestion
…tial shared projects
2c9c3b9
to
edd5c32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the workflow is more like
- the pages load
all
projects that you've imported into your lookup table - we add a new page to
import projects
- on this new page, that's when we search the shared projects paths
- We generate this list of possible projects to import and the user
imports
one - This shared project is then added to their lookup table so they don't have to search for it anymore
I guess my point is we shouldn't be searching these paths all the time. Instead we make a page specific to importing shared projects and when the user "imports" the project, that adds it to the lookup so we don't have to search for it again.
Can you separate this functionality? I mean make 1 pull request for the the search path functionality, then another to actually use it in a page? |
I am closing this PR, right now it have all the code, I will split it into 3 separate PRs
|
Related to Issue #4120
Added support for env variable "VENDOR_SHARED_FILESYSTEM" to allow users to set up shared path in case those are different from
/fs/scratch
and/fs/project
During brute force looking for project we just need to check if there exists a .ondemand folder in any project path, if so, then it is an OOD project
<shared_projects_paths>/<group_id>/<brute force all child folders>/.ondemand