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

Implement WebSocketResponse.get_extra_info method to avoid using private member #7658

Conversation

ttsia
Copy link
Contributor

@ttsia ttsia commented Oct 6, 2023

What do these changes do?

This change introduces new method to access get_extra_info from a WebSocketResponse, like its possible in ClientWebSocketResponse to avoid accessing the private member like in

response._writer.transport.get_extra_info("the info")

Related issue number

#7078

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 6, 2023
docs/web_reference.rst Outdated Show resolved Hide resolved
aiohttp/web_ws.py Outdated Show resolved Hide resolved
tests/test_web_websocket.py Outdated Show resolved Hide resolved
aiohttp/web_ws.py Show resolved Hide resolved
CHANGES/7078.feature Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

Merging #7658 (0da90df) into master (2590d8d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #7658   +/-   ##
=======================================
  Coverage   97.36%   97.36%           
=======================================
  Files         106      106           
  Lines       31648    31665   +17     
  Branches     3620     3624    +4     
=======================================
+ Hits        30813    30830   +17     
  Misses        632      632           
  Partials      203      203           
Flag Coverage Δ
CI-GHA 97.28% <100.00%> (+<0.01%) ⬆️
OS-Linux 96.95% <100.00%> (+<0.01%) ⬆️
OS-Windows 95.42% <100.00%> (+<0.01%) ⬆️
OS-macOS 96.61% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 95.35% <100.00%> (+<0.01%) ⬆️
Py-3.10.13 96.81% <100.00%> (+<0.01%) ⬆️
Py-3.11.5 96.49% <100.00%> (+<0.01%) ⬆️
Py-3.8.10 95.32% <100.00%> (+<0.01%) ⬆️
Py-3.8.18 96.74% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 95.31% <100.00%> (+<0.01%) ⬆️
Py-3.9.18 96.77% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.11 96.27% <100.00%> (+<0.01%) ⬆️
VM-macos 96.61% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 96.95% <100.00%> (+<0.01%) ⬆️
VM-windows 95.42% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
aiohttp/web_ws.py 93.31% <100.00%> (+0.16%) ⬆️
tests/test_web_websocket.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ttsia ttsia force-pushed the 7078-implement-WebSocketResponse.get_extra_info branch 3 times, most recently from f203412 to efa76ed Compare October 6, 2023 13:25
@ttsia ttsia changed the title Implement WebSocketResponse.get extra info method to avoid using private member Implement WebSocketResponse.get_extra_info method to avoid using private member Oct 6, 2023
@ttsia ttsia force-pushed the 7078-implement-WebSocketResponse.get_extra_info branch 2 times, most recently from 48fbda6 to 4b41505 Compare October 10, 2023 06:01
@ttsia ttsia force-pushed the 7078-implement-WebSocketResponse.get_extra_info branch from 4b41505 to 0da90df Compare October 12, 2023 08:53
@ttsia ttsia force-pushed the 7078-implement-WebSocketResponse.get_extra_info branch from 0da90df to 4ea8d2d Compare October 12, 2023 12:38
@Dreamsorcerer Dreamsorcerer merged commit 39f8ff2 into aio-libs:master Oct 12, 2023
28 of 33 checks passed
@patchback
Copy link
Contributor

patchback bot commented Oct 12, 2023

Backport to 3.9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.9/39f8ff225a3eb93bae3b9fd54fa377e31e0a9f6d/pr-7658

Backported as #7695

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Oct 12, 2023
Dreamsorcerer pushed a commit that referenced this pull request Oct 12, 2023
…ra_info method to avoid using private member (#7695)

**This is a backport of PR #7658 as merged into master
(39f8ff2).**
xiangxli pushed a commit to xiangxli/aiohttp that referenced this pull request Dec 4, 2023
….get_extra_info method to avoid using private member (aio-libs#7695)

**This is a backport of PR aio-libs#7658 as merged into master
(39f8ff2).**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants