Feat/glab hosts
closes #96
This automatically detects the gitlab host you used and injects it into the provided snakemake module.
Summary by CodeRabbit
- New Features
- Added support for specifying a custom host during deployment.
- Improved compatibility with self-hosted GitHub and GitLab instances when generating source declarations.
- Maintains backward compatibility: if no host is provided, behavior remains unchanged.
📝 Walkthrough
Walkthrough
Introduces an optional host parameter across deployment and provider APIs. WorkflowDeployer now stores host and passes it to provider.get_source_file_declaration. Providers (Github, Gitlab, Local) accept host; Gitlab derives host from non-gitlab.com URLs when not provided. The top-level deploy() signature includes host but may not pass it into WorkflowDeployer.
Changes
| Cohort / File(s) | Summary |
|---|---|
Public API: host parametersnakedeploy/deploy.py |
Adds host: Optional[str] to WorkflowDeployer.init and deploy() signatures; stores self.host; passes host to provider when rendering module declaration. Note: deploy() currently doesn’t propagate host to WorkflowDeployer instance per summary. |
Providers: host-aware source declarationsnakedeploy/providers.py |
Adds host: Optional[str] to Provider.get_source_file_declaration across Provider, Local, Github, Gitlab. Gitlab uses host if provided or derives from URL when non-gitlab.com; Github optionally includes host; Local ignores host in declaration. Typing/import cleanups; PROVIDERS list unchanged. |
Sequence Diagram(s)
sequenceDiagram
autonumber
actor User
participant CLI as CLI / deploy()
participant WD as WorkflowDeployer
participant Prov as Provider (Gitlab/Github/Local)
participant FS as Filesystem
User->>CLI: deploy(source_url, ..., host?)
CLI->>WD: new WorkflowDeployer(..., host?) %% If propagated
note over WD: Stores self.host
WD->>Prov: get_source_file_declaration(path, tag, branch, host=self.host)
alt Provider = Gitlab
note right of Prov: If host is None and URL not gitlab.com,<br/>derive host from URL
end
Prov-->>WD: source-file declaration string
WD->>FS: Write Snakefile with module declaration
FS-->>User: Snakefile created/updated
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Support host in GitLab module declaration so non-gitlab.com URLs include host (e.g., gitlab.awi.de) [#96] | ✅ |
Assessment against linked issues: Out-of-scope changes
| Code Change | Explanation |
|---|---|
| Add optional host handling to Github.get_source_file_declaration (snakedeploy/providers.py) | Issue #96 concerns GitLab hosts only; extending Github is not required by the stated objective. |
| Add host parameter to Local.get_source_file_declaration (snakedeploy/providers.py) | Local provider host handling is unrelated to GitLab host support requested in #96. |
| Extend public deploy() API to include host (snakedeploy/deploy.py) | Changing the top-level API is not explicitly required to solve GitLab host declaration; internal derivation in GitLab provider would suffice. |
[!TIP]
🔌 Remote MCP (Model Context Protocol) integration is now available!
Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
🧪 Generate unit tests
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. - PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
CodeRabbit Commands (Invoked using PR/Issue comments)
Type @coderabbitai help to get the list of available commands.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Status, Documentation and Community
- Visit our Status Page to check the current availability of CodeRabbit.
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.