-
Notifications
You must be signed in to change notification settings - Fork 34
Add workspaces directory configuration to settings and update workspa… #159
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
Add workspaces directory configuration to settings and update workspa… #159
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request introduces a new configuration option in the settings. A new key Changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/common/common.py (2)
211-214: Flexible workspace directory configuration addedThe new logic correctly checks for a custom workspace directory configuration. This implementation allows users to specify their own workspace location which is a good usability improvement.
Two suggestions for improvement:
- Consider adding validation to ensure the provided path exists and is writable
- Document the expected value type in a comment (e.g., "Path string or false")
# Define the directory where all workspaces will be stored if st.session_state.settings["workspaces_dir"] and st.session_state.location == "local": - workspaces_dir = Path(st.session_state.settings["workspaces_dir"]) + workspaces_dir_path = st.session_state.settings["workspaces_dir"] + workspaces_dir = Path(workspaces_dir_path) + # Validate the path exists and is writable + if not workspaces_dir.exists(): + st.warning(f"Configured workspace directory '{workspaces_dir_path}' doesn't exist. Creating it.") + workspaces_dir.mkdir(parents=True, exist_ok=True) else: workspaces_dir = Path("..", "workspaces-" + st.session_state.settings["repository-name"])
286-289: Code duplication with page_setup functionThis logic is duplicated from the
page_setupfunction. Consider extracting this functionality into a helper function to avoid maintenance issues in the future.You could create a utility function:
def get_workspaces_dir(): """Return the configured workspaces directory or the default one.""" if st.session_state.settings["workspaces_dir"] and st.session_state.location == "local": return Path(st.session_state.settings["workspaces_dir"]) else: return Path("..", "workspaces-" + st.session_state.settings["repository-name"])Then call this function in both places. This would ensure consistent behavior and make future updates easier.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
settings.json(1 hunks)src/common/common.py(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build-simple-app
- GitHub Check: build-openms
- GitHub Check: build-full-app
🔇 Additional comments (1)
settings.json (1)
18-18: New workspace directory configuration addedGood addition! This new setting allows users to specify a custom workspace directory path. The default value of
falseis logical as it will fall back to the default path when not configured.
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.
Thank you for contribution! Could you also add documentation (in the docs folder) about the workspaces_dir parameter and specifically about the behavior that it is ignored in online mode?
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/user_guide.md (1)
26-26: Clarify the Default Workspace Directory SettingThe documentation indicates that in local mode, the workspace directory "Defaults to
..". Please double-check that this default value is consistent with the actual behavior insettings.json. Notably, the PR objectives mention a default value offalse, whereas the AI summary and the documentation imply a default of... It would be beneficial to clarify which default is correct so that users have consistent guidance.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docs/user_guide.md(1 hunks)settings.json(1 hunks)src/common/common.py(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- settings.json
- src/common/common.py
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build-openms
- GitHub Check: build-simple-app
- GitHub Check: build-full-app
|
Thanks for your contribution! |
Fixes #112
Changes :
Summary by CodeRabbit