Skip to content

Conversation

@Ulthran
Copy link
Contributor

@Ulthran Ulthran commented Aug 21, 2025

Summary

  • add --check CLI flag to verify archive directory and md5 file
  • implement check_backup helper
  • test new check flag behavior

Testing

  • pytest -q

https://chatgpt.com/codex/tasks/task_e_68a71a0a2c788323a623ceaf00a0cb95

Copilot AI review requested due to automatic review settings August 21, 2025 15:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a --check flag to the CLI that verifies if archive directory and MD5 file exist without performing backup operations. This allows users to validate existing backups before running new ones.

  • Adds check_backup helper function to verify archive directory and MD5 file existence
  • Implements --check CLI argument that returns boolean verification result
  • Adds comprehensive test coverage for the new check functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
seqBackupLib/backup.py Implements check_backup function and --check CLI flag with early return logic
test/test_backup.py Adds test for check flag behavior including negative cases when MD5 file is missing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

return hash_md5.hexdigest()


def check_backup(forward_reads: Path, dest_dir: Path) -> bool:
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

The function signature is inconsistent with backup_fastq which takes sample_sheet_fp and other parameters. Consider adding sample_sheet_fp parameter for consistency and to enable more comprehensive validation.

Suggested change
def check_backup(forward_reads: Path, dest_dir: Path) -> bool:
def check_backup(forward_reads: Path, dest_dir: Path, sample_sheet_fp: Path) -> bool:

Copilot uses AI. Check for mistakes.


def check_backup(forward_reads: Path, dest_dir: Path) -> bool:
with gzip.open(forward_reads, mode="rt") as f:
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

Missing error handling for file operations. If forward_reads doesn't exist or isn't a valid gzip file, this will raise an unhandled exception instead of returning False.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants