Skip to content

Conversation

adamrtalbot
Copy link
Collaborator

@adamrtalbot adamrtalbot commented Sep 25, 2025

This pull request updates the file and directory path evaluators to better support Azure blob storage paths. The main improvement is that directory checks are now skipped for Azure paths, since Azure blob storage does not have true directories. This change ensures that validation works correctly for Azure file and directory references. Additionally, a new test verifies the correct handling of Azure storage file paths.

Azure path handling improvements:

  • Updated FormatDirectoryPathEvaluator, FormatFilePathEvaluator, and FormatFilePathPatternEvaluator to skip directory checks for Azure storage paths by inspecting the URI scheme. This avoids incorrect validation failures for Azure blob paths, which do not have true directories. [1] [2] [3]
  • Modified SchemaEvaluator so that validation is only skipped for directories on non-Azure paths, allowing Azure file paths to be validated as expected.

Testing:

  • Added a test case in ValidateParametersTest.groovy to ensure Azure storage file and directory paths are validated without errors.

Fixes #16

- Update `FormatDirectoryPathEvaluator` and `FormatFilePathEvaluator` to detect Azure paths (scheme == 'az').
- Skip directory/file checks for Azure paths, since Azure Blob Storage does not have true directories.
- This prevents false validation failures for Azure storage paths.
cursor[bot]

This comment was marked as outdated.

Copy link
Collaborator

@nvnieuwk nvnieuwk left a comment

Choose a reason for hiding this comment

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

Can you update the changelog?

Copy link
Collaborator

@nvnieuwk nvnieuwk left a comment

Choose a reason for hiding this comment

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

Tests are still failing :/

- Update evaluators to check for Azure paths early using value.startsWith('az://')
- Skip validation for Azure paths when nf-azure plugin is missing
- Add comprehensive tests for Azure path validation
- Ensure non-Azure cloud paths (S3, GCS) are still validated normally

This allows pipelines using Azure storage paths to pass validation even when
the nf-azure plugin is not available in the test environment.
Previously, the validators for directory and file path formats would bypass validation and return success if the nf-azure plugin was missing and the path was an Azure path. This commit removes that bypass, so that missing plugin errors will now result in a validation failure, providing clearer feedback to users when the plugin is not installed or configured.
@adamrtalbot
Copy link
Collaborator Author

Tests are still failing :/

I can't seem to import the nf-azure plugin, have you got any ideas?

cursor[bot]

This comment was marked as outdated.

CHANGELOG.md Outdated
## Bug fixes

1. Fixed a bug where non-local samplesheets couldn't be validated and converted.
2. Fixed a bug where Azure blob storage paths were incorrectly validated as directories.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add this version 2.6.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done with c844ee0

@nvnieuwk
Copy link
Collaborator

I can't seem to import the nf-azure plugin, have you got any ideas?

It should do this automatically :/ I'll take a look when I find some time

@adamrtalbot
Copy link
Collaborator Author

It should do this automatically :/ I'll take a look when I find some time

It's the use of file.schema, I don't think nf-schema uses that feature which means it doesn't require nf-amazon etc.

I will roll it back to use simple string matching (.startsWith("az://"))


// Skip validation if it's a directory
if(file.isDirectory() || value.startsWith('az://')) {
log.debug("Could not validate the file ${file.toString()} - path is a directory")
Copy link

Choose a reason for hiding this comment

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

Bug: Azure Path Validation Skips Files

The condition if(file.isDirectory() || value.startsWith('az://')) skips schema validation for all Azure paths, including files. This contradicts the goal of validating Azure file paths and only skipping validation for directories. Additionally, the log message "path is a directory" is misleading when an Azure file path triggers this condition.

Fix in Cursor Fix in Web

@nvnieuwk nvnieuwk changed the base branch from master to 2.6.0dev September 25, 2025 12:06
@adamrtalbot adamrtalbot linked an issue Sep 26, 2025 that may be closed by this pull request
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.

Validation of Azure directory-paths causes issues
2 participants