Skip to content

fix: handle None type for source file attributes in EnvSpec#21

Merged
johanneskoester merged 1 commit into
mainfrom
fix/source-files
Sep 12, 2025
Merged

fix: handle None type for source file attributes in EnvSpec#21
johanneskoester merged 1 commit into
mainfrom
fix/source-files

Conversation

@johanneskoester

@johanneskoester johanneskoester commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a rare crash when no source file is provided for an environment specification. The system now safely skips caching in this case, preventing intermittent errors and improving reliability during environment discovery and deployment. Behavior remains unchanged for projects with a source file, increasing robustness and reducing unexpected failures in runs without source metadata.

@coderabbitai

coderabbitai Bot commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds a None-check before assigning to source_file.cached in _get_cached_env_spec to avoid AttributeError when source_file is None. No public APIs changed.

Changes

Cohort / File(s) Summary
Guarded assignment in env spec caching
snakemake_interface_software_deployment_plugins/tests.py
Wrapped assignment to source_file.cached with a check so it only executes if source_file is not None, preventing AttributeError; behavior remains the same when source_file is present.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 135bbef and 9aabfd2.

📒 Files selected for processing (1)
  • snakemake_interface_software_deployment_plugins/tests.py (1 hunks)
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/source-files

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@johanneskoester johanneskoester merged commit 247d066 into main Sep 12, 2025
3 of 4 checks passed
@johanneskoester johanneskoester deleted the fix/source-files branch September 12, 2025 12:44
johanneskoester pushed a commit that referenced this pull request Sep 12, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.7.2](v0.7.1...v0.7.2)
(2025-09-12)


### Bug Fixes

* handle None type for source file attributes in EnvSpec
([#21](#21))
([247d066](247d066))

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

1 participant