Skip to content

refactor: use tempfile module instead of hardcoded /tmp#12

Open
deepsource-autofix[bot] wants to merge 1 commit into
masterfrom
deepsource-autofix-03281c64
Open

refactor: use tempfile module instead of hardcoded /tmp#12
deepsource-autofix[bot] wants to merge 1 commit into
masterfrom
deepsource-autofix-03281c64

Conversation

@deepsource-autofix
Copy link
Copy Markdown

This PR refactors all temporary file and directory handling to use Python’s built-in tempfile module instead of hardcoded '/tmp' paths. By leveraging TemporaryFile, NamedTemporaryFile, and TemporaryDirectory, the changes improve portability, reduce collision risk, and harden file management.

  • Hardcoded temporary directory detected: Several functions wrote to '/tmp' directly (e.g., generating bundle.js, receipts, inventory cache, zipping workflows). These have been replaced with tempfile.TemporaryFile, NamedTemporaryFile, and TemporaryDirectory. S3 uploads/downloads now use upload_fileobj/download_fileobj and download_fileobj, eliminating static path usage and ensuring safe, ephemeral storage.

This Autofix was generated by AI. Please review the change before merging.

This PR refactors all temporary file and directory handling to use Python’s built-in tempfile module instead of hardcoded '/tmp' paths. By leveraging TemporaryFile, NamedTemporaryFile, and TemporaryDirectory, the changes improve portability, reduce collision risk, and harden file management.

- Hardcoded temporary directory detected: Several functions wrote to '/tmp' directly (e.g., generating bundle.js, receipts, inventory cache, zipping workflows). These have been replaced with tempfile.TemporaryFile, NamedTemporaryFile, and TemporaryDirectory. S3 uploads/downloads now use upload_fileobj/download_fileobj and download_fileobj, eliminating static path usage and ensuring safe, ephemeral storage.

> This Autofix was generated by AI. Please review the change before merging.
@deepsource-development
Copy link
Copy Markdown

deepsource-development Bot commented Jun 11, 2025

Here's the code health analysis summary for commits 15f1b79..a690236. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Secrets LogoSecrets✅ SuccessView Check ↗
DeepSource Python LogoPython❌ Failure
❗ 8 occurences introduced
🎯 31 occurences resolved
View Check ↗
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Jun 11, 2025

Here's the code health analysis summary for commits 15f1b79..a690236. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Secrets LogoSecrets✅ SuccessView Check ↗
DeepSource Python LogoPython❌ Failure
❗ 8 occurences introduced
🎯 31 occurences resolved
View Check ↗
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

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.

0 participants