Skip to content

Conversation

@DriesSchaumont
Copy link
Contributor

@DriesSchaumont DriesSchaumont commented Nov 24, 2025

See #6604

Nextflow uses the contents of a file to determine its hash regardless of the requested hashing strategy when the item is part of the git repository. This is because a different clone of the repository (as often happpens on remote executors like batch) changes the item's timestamp, which invalidates the cache when using its metadata.

When executing a workflow which resides in a subdirectory (using main-script), repository assets are not recognized when they are not a child from the same subdirectory where the script resides. This is because isAssetFile uses session.getBaseDir() as a point of reference for where the assets are stored, but this is not the root of the repository.

This PR changes the check for isAssetFile to use the asset root directory as defined by nextflow.Const.DEFAULT_ROOT.

Signed-off-by: Dries Schaumont <5946712+DriesSchaumont@users.noreply.github.com>
@netlify
Copy link

netlify bot commented Nov 24, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 599b518
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6926c161115ba3000861c8d7

Signed-off-by: Dries Schaumont <5946712+DriesSchaumont@users.noreply.github.com>
Copy link
Member

@pditommaso pditommaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide context in the PR description and unit testing to validate the (new) isAssetFile semantic

Signed-off-by: Dries Schaumont <5946712+DriesSchaumont@users.noreply.github.com>
@DriesSchaumont
Copy link
Contributor Author

Please provide context in the PR description and unit testing to validate the (new) isAssetFile semantic

Thanks for the quick review! Updated the PR and open for new suggestions.

Signed-off-by: Dries Schaumont <5946712+DriesSchaumont@users.noreply.github.com>
- Enhanced JavaDoc explaining asset file hashing strategy
- Added context about SHA-256 content hashing for cache validity
- Documented dual-check logic for baseDir and assetRoot
- Improved test using Spock where block for better readability
- Added inline comments explaining main-script parameter use case

Related to nextflow-io#6604

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso pditommaso changed the title Fix asset detection when item is not a sibling of the executed script. Fix asset detection when item is not a sibling of the executed script Nov 28, 2025
@pditommaso pditommaso merged commit 1ca327c into nextflow-io:master Nov 28, 2025
23 checks passed
pditommaso added a commit that referenced this pull request Nov 28, 2025
…#6605)

Signed-off-by: Dries Schaumont <5946712+DriesSchaumont@users.noreply.github.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Co-authored-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants