Skip to content

fix: use the latest time of file or link#87

Merged
johanneskoester merged 1 commit into
mainfrom
fix/local-time
Mar 11, 2026
Merged

fix: use the latest time of file or link#87
johanneskoester merged 1 commit into
mainfrom
fix/local-time

Conversation

@Hocnonsense

@Hocnonsense Hocnonsense commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

related to snakemake/snakemake#3784 (comment)

After touch() updates _local, max(_local, _local_target) picks up the fresh symlink mtime.
If the real directory's .snakemake_timestamp is fresher (e.g. the target was independently updated), that is correctly preferred instead.
The change is non-breaking: it can only return a value ≥ the current return, so it won't introduce spurious re-runs.

Summary by CodeRabbit

  • Refactor

    • Improved internal code quality and type safety with enhanced type annotations across core interfaces.
  • Bug Fixes

    • Refined timestamp handling logic to ensure consistent maximum timestamp values in file operations.

@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 95ba2e7a-364a-4105-80dc-83b59b8a326d

📥 Commits

Reviewing files that changed from the base of the PR and between 7c8a8d5 and f4a2b60.

📒 Files selected for processing (1)
  • snakemake_interface_storage_plugins/io.py

📝 Walkthrough

Walkthrough

Type annotations have been added to function signatures and return types in snakemake_interface_storage_plugins/io.py. The Mtime.local method's behavior was updated: when follow_symlinks is True and _local_target is set, it now returns the maximum of _local and _local_target instead of just _local_target.

Changes

Cohort / File(s) Summary
Type Annotations
snakemake_interface_storage_plugins/io.py
Added type hints to get_constant_prefix() return type (str), and expanded Mtime.__init__() with parameter types (float | None) and return type (None). Updated Mtime.local_or_storage(), Mtime.storage(), and Mtime.local() with parameter and return types.
Logic Update
snakemake_interface_storage_plugins/io.py
Modified Mtime.local() behavior: when follow_symlinks is True and _local_target is not None, returns max(_local, _local_target) if _local is also set, otherwise returns _local_target.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main behavioral change in the pull request - updating the Mtime.local method to return the maximum of _local and _local_target, ensuring the latest timestamp is used.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/local-time

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 35ba663 into main Mar 11, 2026
5 checks passed
@johanneskoester johanneskoester deleted the fix/local-time branch March 11, 2026 17:19
@github-project-automation github-project-automation Bot moved this from In review to Done in Snakemake Hackathon 2026 Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants