Skip to content

Conversation

@jakevc
Copy link

@jakevc jakevc commented Jun 12, 2025

Summary by CodeRabbit

  • New Features
    • Added support for specifying a custom Conda configuration file when running the Snakemake GitHub Action.
  • Documentation
    • Updated documentation to describe new input parameters and provide usage examples for custom Conda configuration.
  • Tests
    • Introduced automated tests to verify functionality with a custom Conda configuration file.

@jakevc jakevc changed the title bring your own environment feat: bring your own environment Jun 12, 2025
@jakevc jakevc requested a review from johanneskoester June 12, 2025 20:21
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 12, 2025

📝 Walkthrough

Walkthrough

The changes introduce a new optional condarc-file input to the Snakemake GitHub Action, allowing users to specify a custom Conda configuration file. Documentation and workflow examples are updated, and the action now validates and applies the custom Conda configuration during runs. A new test job verifies this functionality.

Changes

File(s) Change Summary
README.md Documents new inputs: snakemake-version, install-apptainer, condarc-file; updates usage examples.
action.yml Adds condarc-file input, validates its existence, passes it to Conda setup, and updates Conda environment setup.
.github/workflows/main.yml Renames "build" job to "test"; adds "test-condarc" job to test custom Conda config file usage.
.test/condarc.yaml Adds sample Conda configuration file for testing the condarc-file input.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHub Actions Runner
    participant Snakemake Action
    participant Conda Setup

    User->>GitHub Actions Runner: Push workflow with condarc-file input
    GitHub Actions Runner->>Snakemake Action: Start action with condarc-file
    Snakemake Action->>Snakemake Action: Validate condarc-file exists
    alt condarc-file found
        Snakemake Action->>Conda Setup: Setup Miniconda with condarc-file
        Conda Setup->>Snakemake Action: Conda environment configured
    else condarc-file missing
        Snakemake Action->>GitHub Actions Runner: Fail with error
    end
    Snakemake Action->>GitHub Actions Runner: Run workflow with custom Conda config
Loading

Possibly related PRs

  • snakemake/snakemake-github-action#39: Adds and modifies composite action structure, including Conda-based setup and related input parameters, directly affecting the same files and logic as this PR.

Suggested reviewers

  • johanneskoester

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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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 (7)
action.yml (3)

68-78: Generate default environment only when no custom file is provided
Using if: ${{ inputs.environment-file == '' }} properly scopes the generation of .snakemake.environment.yaml.

Optionally add comments or logging to clarify that this file is overwritten on each run.


80-90: Validate presence of custom environment file before setup
This early-fail guard is essential to prevent confusing downstream errors. For stricter error handling, consider enabling pipefail and an explicit exit code:

-      shell: bash -el {0}
+      shell: bash -eo pipefail {0}

97-97: Simplify environment-file selection for Conda setup
The current expression works but can be simplified using GitHub Actions’ fallback operator:

-        environment-file: ${{ inputs.environment-file != '' && inputs.environment-file || '.snakemake.environment.yaml' }}
+        environment-file: ${{ inputs.environment-file || '.snakemake.environment.yaml' }}
README.md (4)

31-34: Fix grammar and document default for snakemake-version
Add “the” before “latest version” and note the default:

Snakemake version to use. If not specified, uses the latest version (`*`). Pin a specific version (e.g., '8.25.5') for reproducibility.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~33-~33: You might be missing the article “the” here.
Context: ... version to use. If not specified, uses latest version. Pin a specific version (e.g., ...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


35-38: Include default value for install-apptainer
Clarify default behavior to match action.yml:

Install Apptainer (true/false). Default: `false`.

39-42: Document default for environment-file input
Specify default and behavior when omitted:

Path to a custom Conda environment file containing Snakemake (e.g., 'etc/custom-environment.yml'). Default: `''` (generates a default environment).

61-61: Enhance example usage for environment-file
The example is clear; consider showing both cases (with and without custom file):

# Without custom environment file:
with:
  directory: '.test'
  snakefile: 'workflow/Snakefile'
  # environment-file omitted => default environment is generated
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4e2fd67 and 943d13f.

📒 Files selected for processing (2)
  • README.md (2 hunks)
  • action.yml (3 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[uncategorized] ~33-~33: You might be missing the article “the” here.
Context: ... version to use. If not specified, uses latest version. Pin a specific version (e.g., ...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🔇 Additional comments (1)
action.yml (1)

41-44: Correctly introduce environment-file input for custom Conda environments
The new environment-file parameter allows users to override the default environment YAML. Defaults to '' to trigger auto-generation of .snakemake.environment.yaml.

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: 1

🧹 Nitpick comments (1)
.test/environment.yaml (1)

1-6: Add trailing newline
YAML files should end with a newline to satisfy linters and avoid potential parsing issues.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 6-6: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 943d13f and bf9323f.

📒 Files selected for processing (3)
  • .github/workflows/main.yml (1 hunks)
  • .test/environment.yaml (1 hunks)
  • action.yml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • action.yml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.test/environment.yaml

[error] 6-6: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (1)
.github/workflows/main.yml (1)

25-31: Add CI test for custom environment-file
The new step correctly invokes the action with the environment-file input, ensuring the feature is exercised in CI.

@jakevc jakevc changed the title feat: bring your own environment feat: bring your own condarc Jun 13, 2025
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 (6)
action.yml (1)

76-76: Remove trailing whitespace
Line 76 contains unnecessary trailing spaces. Please trim to satisfy YAML lint rules.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 76-76: trailing spaces

(trailing-spaces)

.github/workflows/main.yml (2)

36-36: Trim trailing spaces
Line 36 has trailing whitespace; please remove to clean up the workflow file.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 36-36: trailing spaces

(trailing-spaces)


40-40: Fix indentation under steps
The - uses: entry under test-condarc steps is indented 4 spaces instead of the expected 6. Please adjust to match other job definitions.

🧰 Tools
🪛 YAMLlint (1.37.1)

[warning] 40-40: wrong indentation: expected 6 but found 4

(indentation)

README.md (3)

31-33: Minor grammar: add missing article
Change to “If not specified, uses the latest version.” for smoother reading.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~33-~33: You might be missing the article “the” here.
Context: ... version to use. If not specified, uses latest version. Pin a specific version (e.g., ...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


39-42: Document condarc-file input
The condarc-file section is consistent with action.yml. You could mention that leaving it empty falls back to default Conda settings.


61-61: Example usage for condarc-file
Including this example is helpful. Verify that the code block indentation matches other examples.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bf9323f and 0a44f09.

📒 Files selected for processing (4)
  • .github/workflows/main.yml (2 hunks)
  • .test/condarc.yaml (1 hunks)
  • README.md (2 hunks)
  • action.yml (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .test/condarc.yaml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/main.yml

[error] 36-36: trailing spaces

(trailing-spaces)


[warning] 40-40: wrong indentation: expected 6 but found 4

(indentation)

action.yml

[error] 76-76: trailing spaces

(trailing-spaces)

🪛 LanguageTool
README.md

[uncategorized] ~33-~33: You might be missing the article “the” here.
Context: ... version to use. If not specified, uses latest version. Pin a specific version (e.g., ...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🔇 Additional comments (6)
action.yml (3)

41-43: Add and document the condarc-file input
The new condarc-file parameter is clearly defined with a description and default value. Ensure the downstream steps correctly handle an empty input.


77-87: Validate existence of custom Conda config early
Good approach to fail fast if the specified condarc-file is missing. Consider aligning the error output style (quotes, capitalization) with other validation steps.


95-96: Pass condarc-file to setup-miniconda
The conda-remove-defaults and condarc-file options correctly configure the Conda environment. No further changes required here.

.github/workflows/main.yml (2)

11-11: Rename CI job from build to test
The renamed job better reflects its purpose. Confirm there are no downstream references to the old job name.


37-49: Add test-condarc job for custom Conda config
This new job effectively tests the condarc-file feature. The steps appear correct and comprehensive.

🧰 Tools
🪛 YAMLlint (1.37.1)

[warning] 40-40: wrong indentation: expected 6 but found 4

(indentation)

README.md (1)

35-37: Document install-apptainer input
The new install-apptainer parameter is clearly described with valid options. Good addition.

@m-jahn
Copy link
Member

m-jahn commented Nov 5, 2025

Hi @jakevc
Is this PR still active? If yes I can review if you like to invite me.
I've gone through the changes and can not see how this extra feature would harm the action.

@johanneskoester
Copy link
Contributor

I would like to wait with this. Reason: Snakemake will soon move away from conda to directly using rattler for conda package deployment. This would deprecate the desired option.

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.

4 participants