-
Notifications
You must be signed in to change notification settings - Fork 212
Lint for version captures in modules #3676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
e8bcc7b
to
c809831
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will have a deeper look once the two other PRS it contains are cleared up.
c809831
to
5b2a24f
Compare
Add new lint check `test_snap_version_content` to ensure version information in test snapshots contains actual content instead of MD5/SHA hash values. This addresses the issue where version snapshots were storing hash values like "versions.yml:md5,949da9c6297b613b50e24c421576f3f1" instead of actual version content like {"ALE": {"ale": "20180904"}}. Changes: - Add version content validation in module_tests.py with regex patterns - Add comprehensive tests for both invalid (hash) and valid (content) cases - Add pytest issue marker support for linking tests to GitHub issues - Update pyproject.toml with new pytest marker configuration Fixes: nf-core/modules#6505 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
5b2a24f
to
a35f9bc
Compare
…egex and error handling - Extract version checking logic into dedicated helper functions for better modularity - Implement more precise regex patterns with proper word boundaries to avoid false positives - Optimize performance by reducing string conversions from multiple to single per test - Add comprehensive test coverage for SHA hashes, mixed scenarios, and edge cases - Enhance error messages with clearer guidance and examples for developers - Improve code maintainability and readability through separation of concerns 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix critical indentation issue where version checking ran outside the test loop - Remove redundant _check_version_content_format function for cleaner logic - Ensure version content validation runs for each test individually - Improve regex patterns with word boundaries for more precise hash detection - Add comprehensive test coverage for SHA hashes, mixed scenarios, and edge cases - All new tests now pass correctly after fixing the loop structure Related to: nf-core/modules#6505 Fixed in: #3676 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix critical indentation issue where version checking ran outside the test loop - Remove redundant _check_version_content_format function for cleaner logic - Ensure version content validation runs for each test individually - Improve regex patterns with word boundaries for more precise hash detection - Add comprehensive test coverage for SHA hashes, mixed scenarios, and edge cases - All new tests now pass correctly after fixing the loop structure Related to: nf-core/modules#6505 Fixed in: #3676 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
565e30d
to
11bcdcb
Compare
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nf_core/modules/lint/module_tests.py
Outdated
r"\bversions\.yml:sha[0-9]*,[a-f0-9]+\b", # SHA format with variable length | ||
] | ||
|
||
# Convert to string only once and search efficiently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Convert to string only once and search efficiently |
nf_core/modules/lint/module_tests.py
Outdated
# Check if version content is actual content vs MD5/SHA hash | ||
# Related to: https://github.com/nf-core/modules/issues/6505 | ||
# Ensures version snapshots contain actual content instead of hash values | ||
if _contains_version_hash(snap_content[test_name]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the previous if
statement, looks like the version can be a key of snap_content
, so we whould take this option into account too.
- Clean up AI-generated comments and verbose documentation - Improve version hash detection to handle both content and keys - Add test case for version hash in snapshot keys scenario - Update CHANGELOG.md with feature description - Preserve all existing pytest-workflow logic for separate PR Addresses feedback from @mashehu and @mirpedrol Related to: nf-core/modules#6505
7e90309
to
1ddf9ce
Compare
Waiting on #3592 to get merged.PR checklist
CHANGELOG.md
is updateddocs
is updated