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

Replace watchdog with asyncinotify and related changes #17

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

tovrstra
Copy link
Contributor

@tovrstra tovrstra commented Aug 22, 2024

Fixes #12

Summary by Sourcery

Replace the watchdog library with asyncinotify for file system event handling, addressing a long-standing issue with watchdog. Fix several bugs related to path translation and logging. Add a new test case for absolute path handling and update the changelog to document these changes.

New Features:

  • Introduce AsyncInotifyWrapper to replace the watchdog library with asyncinotify for file system event handling.

Bug Fixes:

  • Fix bug in the translation of relative paths before they are sent to the director process.
  • Add trailing slash to the workdir argument of stepup.core.api.step() if it is missing.
  • Fix mistake in worker log filenames.
  • Fix bug in back translation of paths when substituted in a step command.

Enhancements:

  • Refactor the watcher implementation to use asyncinotify instead of watchdog, improving the handling of file system events.

Documentation:

  • Update changelog to reflect the replacement of watchdog with asyncinotify and other changes.

Tests:

  • Add a new test case for handling absolute paths, including a shell script and a Python plan file.

Copy link
Contributor

sourcery-ai bot commented Aug 22, 2024

Reviewer's Guide by Sourcery

This pull request replaces the watchdog library with asyncinotify for file system monitoring. The change aims to address a long-standing issue in watchdog. The implementation involves significant modifications to the Watcher class, introduction of a new AsyncInotifyWrapper class, and related changes in path handling and error logging.

File-Level Changes

Files Changes
stepup/core/watcher.py Replace watchdog with asyncinotify for file system monitoring
stepup/core/watcher.py Introduce AsyncInotifyWrapper class to interface between Watcher and asyncinotify
stepup/core/api.py Modify path handling in step function to use translate_back instead of myrelpath
docs/changelog.md Update changelog to reflect the replacement of watchdog with asyncinotify
stepup/core/worker.py Fix bug in worker log filenames
stepup/core/director.py Remove scheduler.drain() call from director shutdown method
tests/test_cases.py
tests/cases/absolute/main.sh
tests/cases/absolute/plan.py
tests/cases/absolute/README.md
Add new test case for handling absolute paths

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

deepsource-io bot commented Aug 22, 2024

Here's the code health analysis summary for commits d00d465..8fcb0d9. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Shell LogoShell✅ SuccessView Check ↗
DeepSource Python LogoPython❌ Failure
❗ 3 occurences introduced
View Check ↗

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

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @tovrstra - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@tovrstra tovrstra merged commit 2647c9e into reproducible-reporting:main Aug 22, 2024
6 of 8 checks passed
@tovrstra tovrstra deleted the asyncinotify branch August 22, 2024 08:09
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.

Larger projects raise OSError: inotify instance limit reached
1 participant