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

fix: populate sessions when logging in #507

Merged
merged 7 commits into from
Apr 24, 2024
Merged

fix: populate sessions when logging in #507

merged 7 commits into from
Apr 24, 2024

Conversation

JerrySentry
Copy link
Contributor

@JerrySentry JerrySentry commented Apr 15, 2024

Purpose/Motivation

What is the feature? Why is this being done?

Create a Session object that stores user info like IP and user agent when logging in. All sessions will be displayed on the UI in the settings/access page, can also click on revoke to delete the sessions which will logout the corresponding sessions. The Session is created whenever we create a DjangoSession object, for deletion the DjangoSession object is deleted which will cascade delete the Session object

Links to relevant tickets

fixes: codecov/engineering-team#1278

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@JerrySentry JerrySentry marked this pull request as ready for review April 19, 2024 00:54
@JerrySentry JerrySentry requested a review from a team as a code owner April 19, 2024 00:54
@codecov-notifications
Copy link

Codecov Report

Attention: Patch coverage is 95.45455% with 1 lines in your changes are missing coverage. Please review.

✅ All tests successful. No failed tests found ☺️

Files Patch % Lines
codecov_auth/views/base.py 90.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 91.44%. Comparing base (52ac5d9) to head (1e4339d).

✅ All tests successful. No failed tests found ☺️

Files Patch % Lines
codecov_auth/views/base.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #507   +/-   ##
=======================================
  Coverage   91.44%   91.44%           
=======================================
  Files         599      599           
  Lines       16193    16210   +17     
=======================================
+ Hits        14808    14824   +16     
- Misses       1385     1386    +1     
Flag Coverage Δ
unit 91.44% <95.45%> (+<0.01%) ⬆️
unit-latest-uploader 91.44% <95.45%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codecov-public-qa bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 91.44%. Comparing base (52ac5d9) to head (1e4339d).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #507   +/-   ##
=======================================
  Coverage   91.44%   91.44%           
=======================================
  Files         599      599           
  Lines       16193    16210   +17     
=======================================
+ Hits        14808    14824   +16     
- Misses       1385     1386    +1     
Flag Coverage Δ
unit 91.44% <95.45%> (+<0.01%) ⬆️
unit-latest-uploader 91.44% <95.45%> (+<0.01%) ⬆️

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

Files Coverage Δ
..._auth/commands/owner/interactors/delete_session.py 100.00% <100.00%> (ø)
codecov_auth/commands/owner/owner.py 100.00% <100.00%> (ø)
codecov_auth/tests/factories.py 100.00% <100.00%> (ø)
codecov_auth/views/base.py 99.09% <90.00%> (-0.44%) ⬇️

Impacted file tree graph

Copy link

@barnett-yuxiang barnett-yuxiang left a comment

Choose a reason for hiding this comment

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

LGTM

ajay-sentry
ajay-sentry previously approved these changes Apr 23, 2024
Copy link
Contributor

@ajay-sentry ajay-sentry left a comment

Choose a reason for hiding this comment

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

Discussed with Jerry on a huddle, lgtm!

Copy link

codecov bot commented Apr 24, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 95.76%. Comparing base (52ac5d9) to head (1e4339d).

✅ All tests successful. No failed tests found ☺️

Files Patch % Lines
codecov_auth/views/base.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #507     +/-   ##
=======================================
- Coverage   95.77   95.76   -0.01     
=======================================
  Files        774     774             
  Lines      17049   17066     +17     
=======================================
+ Hits       16327   16343     +16     
- Misses       722     723      +1     
Flag Coverage Δ
unit 91.44% <95.45%> (+<0.01%) ⬆️
unit-latest-uploader 91.44% <95.45%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JerrySentry JerrySentry added this pull request to the merge queue Apr 24, 2024
Merged via the queue into main with commit bffd67c Apr 24, 2024
33 of 35 checks passed
@JerrySentry JerrySentry deleted the apr_15_sessions branch April 24, 2024 16:34
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.

Sessions table in settings is broken
3 participants