Skip to content
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

Enhance code and tackle weaknesses found in testing #32

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

glrs
Copy link
Collaborator

@glrs glrs commented Dec 13, 2024

This pull request includes several changes aimed at improving error handling, validation, and logging across multiple utility functions in the codebase. The most important changes include enhancing path validation, adding error checks and logging, and ensuring proper handling of configuration data.

Enhancements to path validation and error handling:

  • lib/core_utils/common.py: Improved the get_path function to validate paths more rigorously, including checks for absolute paths and directory traversal attempts. Added logging for various error scenarios.
  • lib/core_utils/common.py: Enhanced save_last_processed_seq to include error handling when writing to the sequence file, with appropriate logging for failures.

Improvements to configuration data handling:

  • lib/core_utils/config_loader.py: Updated _load_config to set the configuration to an empty immutable mapping before raising exceptions, ensuring a consistent state.

Additional error checks and logging:

  • lib/module_utils/report_transfer.py: Added validation to ensure the report_transfer configuration is a dictionary and included logging for invalid configurations.
  • lib/module_utils/slurm_utils.py: Introduced type checks for template_fpath and output_fpath in generate_slurm_script to ensure they are either strings or Path objects.

@glrs glrs merged commit 9003804 into NationalGenomicsInfrastructure:main Dec 13, 2024
3 checks passed
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.

1 participant