Skip to content

Fix #165 by making AsyncApp compatible with aiohttp-devtools - #168

Merged
seratch merged 6 commits into
slackapi:mainfrom
seratch:issue-165-aiohttp-devtools
Dec 3, 2020
Merged

seratch merged 6 commits into
slackapi:mainfrom
seratch:issue-165-aiohttp-devtools

Conversation

@seratch

@seratch seratch commented Dec 2, 2020 •

Copy link
Copy Markdown
Contributor

This pull request fixes #165 by providing a way to easily access aiohttp.web.Application instance.

aiohttp-devtools:
https://github.com/aio-libs/aiohttp-devtools

Category (place an x in each of the [ ])

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Document pages under /docs
  • Others

Requirements (place an x in each [ ])

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_all_and_run_tests.sh after making the changes.

@seratch seratch added enhancement New feature or request area:async labels Dec 2, 2020
@seratch seratch added this to the 1.1.1 milestone Dec 2, 2020
@seratch seratch self-assigned this Dec 2, 2020
# pip install -r requirements.txt
# export SLACK_SIGNING_SECRET=***
# export SLACK_BOT_TOKEN=xoxb-***
# adev runserver --port 3000 --app-factory app_factory async_app.py

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Check this example to learn how to use the devtool.

@codecov-io

codecov-io commented Dec 2, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #168 (94b2418) into main (8586d9e) will increase coverage by 0.00%.
The diff coverage is 61.53%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #168   +/-   ##
=======================================
  Coverage   81.64%   81.65%           
=======================================
  Files         149      149           
  Lines        4403     4415   +12     
=======================================
+ Hits         3595     3605   +10     
- Misses        808      810    +2     
Impacted Files Coverage Δ
slack_bolt/app/async_app.py 62.73% <54.54%> (+0.31%) ⬆️
slack_bolt/app/async_server.py 47.61% <66.66%> (+5.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8586d9e...94b2418. Read the comment docs.

@seratch seratch left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

To other maintainers, let me know your thoughts. I will merge this and will release a new patch version soon.

self._server = AsyncSlackAppServer(port=port, path=path, app=self,)
return self._server

def web_app(self, path: str = "/slack/events") -> web.Application:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When you use aiohttp-devtools, specifying the port to listen on in code does not work. That's why I removed the arg in this factory method as it's so confusing if giving it here does not work.

@seratch
seratch merged commit 94015f6 into slackapi:main Dec 3, 2020
@seratch
seratch deleted the issue-165-aiohttp-devtools branch December 3, 2020 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:async enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a way to easily use aiohttp-devtools for AsyncApp apps

3 participants