fix: more robust inference of source path that properly respects hosting provider urls without loosing release or commit information#3195
Conversation
…ing provider urls without loosing release or commit information
📝 WalkthroughWalkthroughThe changes in this pull request modify the Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)snakemake/workflow.py (1)Pattern 🔇 Additional comments (1)snakemake/workflow.py (1)
The updated condition properly handles both exact matches and paths within the base directory, making the source path inference more robust while maintaining backward compatibility. Let's verify that the change doesn't break existing path resolution: ✅ Verification successfulLet me analyze the source path inference changes in more detail by looking at the relevant code context. Let me try a different approach to analyze the source path inference changes. Based on the gathered information, I can now provide a final response about the source path inference changes. The source path inference enhancement is correct and well-justified The changes to
The change is supported by:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for any potential file path related issues in the codebase
# Test: Look for file paths that might be affected by the source_path changes
# Check for relative path usage patterns
rg -A 2 "source_path\("
# Check for potential path traversal patterns
rg -A 2 "\.\./|\.\."
Length of output: 181676 Script: #!/bin/bash
# Check the source_path method implementation and its usage
ast-grep --pattern $'def source_path(self, rel_path):
$$$
if self.included_stack and (
(calling_file == self.included_stack[-1].get_path_or_uri())
or calling_file.startswith(self.current_basedir.get_path_or_uri())
$$$'
# Check for any test cases related to source_path
rg -A 5 "test_source_path" tests/
Length of output: 281 Script: #!/bin/bash
# Look for the source_path method implementation in workflow.py
rg -A 20 "def source_path" snakemake/workflow.py
# Look for tests related to source_path
rg -A 10 "source_path" tests/tests.py
# Look for any related changes in recent commits
rg -A 5 "source_path" CHANGELOG.md
Length of output: 4809 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
🤖 I have created a release *beep* *boop* --- ## [8.25.3](v8.25.2...v8.25.3) (2024-11-11) ### Bug Fixes * correctly set params in bash scripts ([#3188](#3188)) ([07ddab5](07ddab5)) * more robust inference of source path that properly respects hosting provider urls without loosing release or commit information ([#3195](#3195)) ([bd8212b](bd8212b)) * When generating a DAG or HTML rulegraph, use consistent colours ([#3189](#3189)) ([5f651d2](5f651d2)) --- 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>



QC
docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).Summary by CodeRabbit
New Features
Style