Skip to content

feat: suffix replacement#54

Merged
johanneskoester merged 2 commits into
mainfrom
feat/suffix-replacement
Jun 2, 2026
Merged

feat: suffix replacement#54
johanneskoester merged 2 commits into
mainfrom
feat/suffix-replacement

Conversation

@johanneskoester

@johanneskoester johanneskoester commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added support for suffix-substitution configuration in source files.
  • Bug Fixes

    • Removed unintended debugger breakpoint that was interrupting hash operations during runtime.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@johanneskoester, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 57 minutes and 1 second. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2cdf0cdb-1db9-4c3b-8924-784c52d109ae

📥 Commits

Reviewing files that changed from the base of the PR and between 8f81191 and 5d5c27b.

📒 Files selected for processing (1)
  • snakemake_interface_software_deployment_plugins/__init__.py
📝 Walkthrough

Walkthrough

This PR extends the environment specification interface with suffix replacement configuration for source files and inserts a debugging breakpoint in the hash computation method. The SuffixReplacement dataclass and replace_suffix() method on EnvSpecSourceFile enable callers to configure suffix substitution, while a breakpoint() call is added to EnvBase._managed_generic_hash().

Changes

Environment Specification Enhancements

Layer / File(s) Summary
Suffix replacement support
snakemake_interface_software_deployment_plugins/__init__.py
Introduced SuffixReplacement dataclass with old_suffixes: List[str] and new_suffix: str fields. Extended EnvSpecSourceFile with optional suffix_replacement field. Added replace_suffix(suffixes, new_suffix) method that returns a new EnvSpecSourceFile instance with the replacement configured, raising ValueError if already set.
Debug breakpoint in hash method
snakemake_interface_software_deployment_plugins/__init__.py
Inserted breakpoint() statement inside EnvBase._managed_generic_hash() to pause execution during hash computation.

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: suffix replacement' directly corresponds to the main changes: adding a SuffixReplacement dataclass and suffix_replacement functionality to EnvSpecSourceFile.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/suffix-replacement

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
snakemake_interface_software_deployment_plugins/__init__.py (1)

56-65: 💤 Low value

The cached field is not propagated to the new instance.

When creating the new EnvSpecSourceFile, self.cached is not copied over and will default to None. If this is intentional (e.g., because suffix replacement invalidates the cache), consider adding a brief comment. If the cache should be preserved, include it:

         return EnvSpecSourceFile(
             path_or_uri=self.path_or_uri,
             suffix_replacement=SuffixReplacement(
                 old_suffixes=suffixes, new_suffix=new_suffix
             ),
+            cached=self.cached,
         )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@snakemake_interface_software_deployment_plugins/__init__.py` around lines 56
- 65, The replace_suffix method creates a new EnvSpecSourceFile but doesn't
propagate self.cached, causing the cached field to be lost; update
replace_suffix to pass cached=self.cached into the new EnvSpecSourceFile
construction (or, if cache invalidation is intended, add a short comment in
replace_suffix explaining why suffix replacement must drop the cache) so the
behavior is explicit; reference the replace_suffix method, EnvSpecSourceFile
constructor call, and the cached attribute when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@snakemake_interface_software_deployment_plugins/__init__.py`:
- Line 326: Remove the stray debug breakpoint() call that halts execution during
hash computation; locate the breakpoint() invocation (shown in the diff) and
delete it before merging, or replace it with a non-interactive log statement
(e.g., using the module's logger or debug facility) if you need to record the
event without stopping the process.

---

Nitpick comments:
In `@snakemake_interface_software_deployment_plugins/__init__.py`:
- Around line 56-65: The replace_suffix method creates a new EnvSpecSourceFile
but doesn't propagate self.cached, causing the cached field to be lost; update
replace_suffix to pass cached=self.cached into the new EnvSpecSourceFile
construction (or, if cache invalidation is intended, add a short comment in
replace_suffix explaining why suffix replacement must drop the cache) so the
behavior is explicit; reference the replace_suffix method, EnvSpecSourceFile
constructor call, and the cached attribute when making the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c8fb18d1-077a-4054-9fcf-921c0f23ad0d

📥 Commits

Reviewing files that changed from the base of the PR and between 58c5322 and 8f81191.

📒 Files selected for processing (1)
  • snakemake_interface_software_deployment_plugins/__init__.py

Comment thread snakemake_interface_software_deployment_plugins/__init__.py
@johanneskoester johanneskoester merged commit 6282e25 into main Jun 2, 2026
5 checks passed
@johanneskoester johanneskoester deleted the feat/suffix-replacement branch June 2, 2026 19:39
johanneskoester pushed a commit that referenced this pull request Jun 2, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.18.0](v0.17.0...v0.18.0)
(2026-06-02)


### Features

* suffix replacement
([#54](#54))
([6282e25](6282e25))


### Bug Fixes

* remove debug code
([ffa0804](ffa0804))

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