Replace Watchman with django-watchfiles for development auto-reloading. Closes #3376#3423
Conversation
There was a problem hiding this comment.
Pull request overview
Migrates the development auto-reload file-watching mechanism from Watchman/pywatchman to django-watchfiles, simplifying the Docker build and removing the custom Watchman installation flow.
Changes:
- Added
django-watchfilesas a dependency and removed the standalone Watchman requirements file. - Enabled
django_watchfilesinINSTALLED_APPSwhenDEBUG=True. - Removed Watchman-related Docker build args/env vars and the Watchman install script invocation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements/project-requirements.txt | Adds django-watchfiles dependency. |
| requirements/django-server-requirements.txt | Removes pywatchman requirements file. |
| intel_owl/settings/init.py | Appends django_watchfiles to INSTALLED_APPS in debug. |
| docker/test.override.yml | Removes Watchman-related build arg and env var. |
| docker/scripts/watchman_install.sh | Removes Watchman installer script. |
| docker/Dockerfile | Removes Watchman env var and installer script invocation. |
Comments suppressed due to low confidence (1)
docker/scripts/watchman_install.sh:1
- The removed
watchman_install.shscript downloaded and installed prebuiltwatchmanbinaries directly from GitHub viawgetandunzipwithout any checksum or signature verification. If the tag or download endpoint were ever compromised or intercepted, an attacker could supply a maliciouswatchmanbinary that would run inside the container with elevated privileges. This change removes that behavior; for any future bootstrap scripts that fetch binaries, ensure downloads are pinned to immutable identifiers (e.g., commit SHAs/releases) and verified with checksums or signatures.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
docker/scripts/watchman_install.sh:1
- The removed
watchman_install.shscript previously downloaded and installed precompiledwatchmanbinaries directly from GitHub usingwget/unzipandcpinto/usr/local/binwithout any checksum or signature verification, creating a supply‑chain RCE risk if the download source or network were compromised. Because this PR deletes that script and its invocation from the Dockerfile, that specific risk is now eliminated. For any future installer scripts, ensure all remotely downloaded artifacts are verified (e.g., with pinned checksums or signatures) or installed via a trusted package manager instead of ad‑hocwget/cpflows.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@mlodic, i have done the watchman to watchfiles implementation, and now I have took a look at more changes, in the #890 of greedybear, and what scope I get to see is
SO yeah, @mlodic please review the current implementation and please let me know, whether I can open a new issue for the next betterment, or just a new pr, or in this pr itself?? |
hey @mlodic, what is your opinion on the next ideas |
|
@rootp1 you have to exercise patience, we get notifications and we are doing this for free, so you need to respect our time |
|
I cannot accept this PR without proof that the change works. So please show that this works as it should with a video showing how the changes are properly reloaded with the new packages as they should and how this works only in testing environments |
|
unrelated watchman changes should be addressed in different issues/PRs |
|
This pull request has been marked as stale because it has had no activity for 10 days. If you are still working on this, please provide some updates or it will be closed in 5 days. |
|
updates on this? |
|
onto it, @mlodic |
|
thankyou for considering |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Hi @mlodic , I’m really sorry for tagging you again on this. I realize now that it may have come across as pushy, which wasn’t my intention at all. I think I was under the impression that the issue might go stale if there wasn’t any activity, and that led me to follow up once prematurely. That said, I completely understand and respect that you are contributing your time voluntarily, and I truly respecting the effort you put into reviewing and mentoring I ask apology. I’ll make sure to be more patient going forward and won’t repeat this.
I’ve attached a video demonstrating that the changes work as expected. It took some time to put this video together, so I hope it helps clarify all the changes. video.mp4 |
This PR migrates the file-watching mechanism used during development from Watchman (
pywatchman) todjango-watchfiles.Changes:
pywatchmanand thedjango-server-requirements.txtfile. Addeddjango-watchfiles>=1.4.0totest-requirements.txt(dev-only dependency).WATCHMANbuild arg, thewatchman_install.shscript invocation, and thegcc/python3-devbuild dependencies that were only needed to compile Watchman.django_watchfilestoINSTALLED_APPSwhenDEBUG=Trueand the package is importable. This automatically hooks into Django'sautoreloadmodule, replacingWatchmanReloaderwithWatchfilesReloader.watchman_install.shscript that downloaded and installed the Watchman binary.Type of change
Please delete options that are not relevant.
Checklist
developdumpplugincommand and added it in the project as a data migration. ("How to share a plugin with the community")test_files.zipand you added the default tests for that mimetype in test_classes.py.FREE_TO_USE_ANALYZERSplaybook by following this guide.urlthat contains this information. This is required for Health Checks (HEAD HTTP requests).get_mocker_response()method of the unittest class. This serves us to provide a valid sample for testing.DataModelfor the new analyzer following the documentation# This file is a part of IntelOwl https://github.com/intelowlproject/IntelOwl # See the file 'LICENSE' for copying permission.Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.testsfolder). All the tests (new and old ones) gave 0 errors.DeepSource,Django Doctorsor other third-party linters have triggered any alerts during the CI checks, I have solved those alerts.Important Rules