Skip to content

Conversation

@pditommaso
Copy link
Member

Summary

  • Changed conda explicit file detection from extension-based (.txt) to content-based by checking for the @EXPLICIT marker
  • The detection now reads the first 20 lines of a file to look for the @EXPLICIT marker, which is the standard identifier for conda explicit specification files
  • This approach is more reliable and flexible than relying on file extensions

Motivation

Previously, conda explicit files were identified solely by their .txt extension using isTextFilePath(). This had two issues:

  1. False negatives: Conda explicit files with non-standard extensions (e.g., .lock, .spec) were not recognized
  2. False positives: Regular text files with .txt extension could be incorrectly treated as conda explicit files

The @EXPLICIT marker is the canonical identifier for conda explicit specification files (see conda documentation). By checking file content, we can reliably identify these files regardless of their extension.

Changes

CondaCache.groovy

  • Replaced isTextFilePath() with isExplicitFile() - checks if file exists and contains @EXPLICIT marker
  • Added containsExplicitMarker() helper - efficiently reads only first 20 lines
  • Updated condaPrefixPath() and createLocalCondaEnv0() to use the new method

CondaCacheTest.groovy

  • Updated tests to use actual conda explicit file format with @EXPLICIT marker
  • Tests now create real files with proper content rather than relying on extension checks

Test plan

  • All existing CondaCacheTest tests pass
  • New content-based detection correctly identifies files with @EXPLICIT marker
  • Files without @EXPLICIT marker are not incorrectly identified as explicit files
  • Non-existent files return false gracefully

🤖 Generated with Claude Code

Change conda explicit file detection from extension-based (.txt) to
content-based by checking for the @explicit marker in the first 20 lines
of the file.

This improves compatibility with conda explicit files that may use
different extensions, and avoids incorrectly treating regular .txt
files as conda explicit files.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
@netlify
Copy link

netlify bot commented Jan 12, 2026

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit 4a2a8d6
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/69653d8d43523700086d5944
😎 Deploy Preview https://deploy-preview-6713--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pditommaso pditommaso requested a review from ewels January 12, 2026 16:09
@pditommaso
Copy link
Member Author

@ewels does this match the same expectation of #6665?

Signed-off-by: Paolo Di Tommaso <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

Yup, LGTM 👍🏻

@pditommaso pditommaso merged commit f141116 into master Jan 13, 2026
12 checks passed
@pditommaso pditommaso deleted the detect-conda-explicit-by-content branch January 13, 2026 09:14
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.

4 participants