Skip to content

Conversation

@fbartusch
Copy link
Contributor

@fbartusch fbartusch commented Mar 14, 2025

fixes #80

Summary by CodeRabbit

  • New Features

    • Enhanced the deployment process by introducing dynamic configuration file selection. The workflow now automatically recognizes an alternate configuration option at runtime, providing greater flexibility during deployments.
  • Tests

    • Expanded test coverage to ensure that both default and alternative configuration file scenarios are handled correctly.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 14, 2025

📝 Walkthrough

Walkthrough

This pull request updates the deployment process by enhancing configuration file handling. The WorkflowDeployer.deploy_snakefile method now checks for two potential configuration files (config.yaml and config.yml), defaulting to config.yaml if neither is found. The Snakemake template is modified to accept a dynamic config path, and the test suite is extended to cover both configuration scenarios.

Changes

File(s) Change Summary
snakedeploy/deploy.py
snakedeploy/templates/use_module.smk.jinja
Updated configuration file handling: the deployment method now checks for both config.yaml and config.yml (defaulting to config.yaml if neither exists), and the Snakemake template now uses a dynamic {{ config }} placeholder.
tests/test_client.sh Added new test cases to verify that the deployment correctly handles both the default (config.yaml) and alternative (config.yml) configuration file names.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant WD as WorkflowDeployer
    participant FS as FileSystem
    participant TR as Template Renderer

    U->>WD: deploy_snakefile(tmpdir, name, config)
    WD->>FS: Check if "config.yaml" exists
    alt "config.yaml" exists
        FS-->>WD: "config.yaml" found
    else Not found
        WD->>FS: Check if "config.yml" exists
        alt "config.yml" exists
            FS-->>WD: "config.yml" found
        else Not found
            WD-->>WD: Default to "config.yaml"
        end
    end
    WD->>TR: Render template with selected config path
    TR-->>WD: Rendered Snakefile
    WD-->>U: Return deployment result
Loading

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 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.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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

Documentation and Community

  • 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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)
snakedeploy/deploy.py (1)

214-223: Good implementation for supporting both config file formats.

The implementation correctly checks for both config.yaml and config.yml files, with a sensible fallback to the default config.yaml if neither is found. This approach maintains backward compatibility while adding support for the additional format.

Consider adding a brief comment explaining the fallback logic - why we default to config.yaml when neither file exists (likely because a dummy config.yaml will be created in deploy_config).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f52f7ef and 6a0f098.

📒 Files selected for processing (3)
  • snakedeploy/deploy.py (2 hunks)
  • snakedeploy/templates/use_module.smk.jinja (1 hunks)
  • tests/test_client.sh (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest ...

**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

  • snakedeploy/deploy.py
🔇 Additional comments (4)
snakedeploy/templates/use_module.smk.jinja (1)

7-7: Good change that enhances configuration flexibility.

Replacing the hardcoded configuration path with a dynamic template variable allows the template to support both config.yaml and config.yml file extensions. This is a clean way to implement the feature without duplicating code.

tests/test_client.sh (2)

56-57: Good test to verify backward compatibility.

This test ensures that the fix for issue #80 doesn't affect previous functionality by checking that config.yaml is still correctly handled in the generated Snakefile.


59-64: Excellent comprehensive test for the new feature.

This test effectively validates the fix for issue #80 by:

  1. Deploying a repository known to use config.yml
  2. Verifying that the generated Snakefile correctly references config.yml

Good choice of repository to test with, and the test is clear and focused.

snakedeploy/deploy.py (1)

233-233: LGTM - correctly passes the dynamic config path to the template.

This change properly integrates with the Jinja template modification, ensuring the determined configuration path is used when rendering the Snakefile.

@johanneskoester johanneskoester merged commit 6a8fd0d into main Mar 14, 2025
6 checks passed
@johanneskoester johanneskoester deleted the fix/handle-config-yml branch March 14, 2025 11:20
@johanneskoester
Copy link
Contributor

Thanks a lot!

johanneskoester pushed a commit that referenced this pull request Mar 14, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.11.0](v0.10.4...v0.11.0)
(2025-03-14)


### Features

* add profile directory and license file to deployment
([#75](#75))
([f52f7ef](f52f7ef))


### Bug Fixes

* consider config.yml as configuration filename
([#85](#85))
([6a8fd0d](6a8fd0d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

snakedeploy expects config/config.yaml and ignores alternative config names defined in Snakefile

3 participants