-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add default app and manifest watch config #89
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
=======================================
Coverage 94.68% 94.68%
=======================================
Files 11 11
Lines 207 207
=======================================
Hits 196 196
Misses 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
WilliamBergamin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this out locally 🚀 The experience is much better then I expected 🌟
My only concern before merging this is that the CLI seems to be using a keyboard interrupt to stop the process and this is leading to a traceback being printed 🤔 I don't think this traceback should be printed when the CLI does its "refresh"
INFO:slack_bolt.App:Starting to receive messages from a new connection (session id: c946512435)
App change detected: ~/bolt-python-search-template/listeners/functions/search.py, restarting server...
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "~/bolt-python-search-template/.venv/lib/python3.13/site-packages/slack_cli_hooks/hooks/start.py", line 44, in <module>
start(os.getcwd())
~~~~~^^^^^^^^^^^^^
File "~/bolt-python-search-template/.venv/lib/python3.13/site-packages/slack_cli_hooks/hooks/start.py", line 37, in start
runpy.run_path(entrypoint_path, run_name="__main__")
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen runpy>", line 287, in run_path
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "~/bolt-python-search-template/app.py", line 19, in <module>
SocketModeHandler(app, os.environ.get("SLACK_APP_TOKEN")).start()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "~/bolt-python-search-template/.venv/lib/python3.13/site-packages/slack_bolt/adapter/socket_mode/base_handler.py", line 58, in start
Event().wait()
~~~~~~~~~~~~^^
File "/Users/wbergamin/.pyenv/versions/3.13.1/lib/python3.13/threading.py", line 659, in wait
signaled = self._cond.wait(timeout)
File "/Users/wbergamin/.pyenv/versions/3.13.1/lib/python3.13/threading.py", line 359, in wait
waiter.acquire()
~~~~~~~~~~~~~~^^
KeyboardInterruptNot sure if this is something we could handle on the CLI side 🤔 from my quick search it seems like sending a syscall.SIGTERM to the python process might prevent this tracback log from showing up
|
@WilliamBergamin Thanks a ton for taking this for a spin! 🚲 ✨ IIRC Windows doesn't support the same
🔗 https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/signal?view=msvc-170 I agree we might find improvements to these outputs - perhaps clearing the screen between restarts is useful - but for now this output might be alright toward iterations in app development? |
Summary
This PR adds a default
appandmanifestoption to file watching for server restarts and app reinstalls.Following: slackapi/slack-cli#310
Testing
Build these changes with the CLI changes noted above. Then reinstall and reload an app:
Special notes
CLI version >=3.12.0 is required for these changes to be used in development, but these will be released in order or together if all goes well in review 👾
Requirements
./scripts/install_and_run_tests.shafter making the changes.