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

updated with fixes from flask-session2 #170

Closed
wants to merge 5 commits into from
Closed

Conversation

christopherpickering
Copy link

@christopherpickering christopherpickering commented May 11, 2023

This pr merges the updates from flask-session2 and should close out the following issues:
#134
#128
#44
#36
#29
#26
#11
#46
#66
#53
#56
#85
#89
#67
#150
#158
#157
#137
#151
#131
#75
#121
#113
#63
hopefully #79

This overlaps/clones the following pr's
#12
#32
#34
#57
#80
#90
#93
#96
#100
#102
#105
#109
#117
#135
#155

This pr also includes most fixes from the other community forks. The readme is updated with a list of contributors to those changes.

@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (main@3bb2c6e). Click here to learn what that means.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main     #170   +/-   ##
=======================================
  Coverage        ?   67.07%           
=======================================
  Files           ?        3           
  Lines           ?     1063           
  Branches        ?        0           
=======================================
  Hits            ?      713           
  Misses          ?      350           
  Partials        ?        0           

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

@christopherpickering
Copy link
Author

christopherpickering commented May 11, 2023

Some of the tests randomly fail on test_filesysestem_session (only on py39?!), but on a key missmatch error w/ memcached. It looks like cachelib.file is using memecached as a backend, if memcached is installed.

I'm thinking to get around the error we could run the tests in a specified order (file first, then memcached)

Its odd - you can see the same tests running here and never failing: https://github.com/christopherpickering/flask-session2/actions

The difference is that these tests are not running in poetry and the others are. There must be some other level of issolation between tests in repo2.

The other thing I see is another werkzueg warning.. also flask-session never closes out connections? I wonder if there is a way to properly do that?

This was referenced May 11, 2023
@idoshr
Copy link
Contributor

idoshr commented May 13, 2023

This is awesome PR
Please approve it ASAP

While this is merged
My PR should be declined
#155

config.setdefault('SESSION_SQLALCHEMY_TABLE', 'sessions')

if config['SESSION_TYPE'] == 'redis':
config.setdefault("SESSION_TYPE", "null")
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for making the first cut, @christopherpickering ! This PR used to have more than 10K lines, now it reduces to 1.5K.

But it is still somewhat large. From a tactical standpoint, I would suggest to create another PR with styling changes only, which would be much straightforward to review and merge. And then we can rebase this PR which will then be much smaller. You do not have to create that style PR, I can do that for you/us, if you prefer. Just let me know. By the way, what linter do you use?

Choose a reason for hiding this comment

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

I don't have time to spend on the project, I don't even use flask sessions anymore :)

I normally use black with pre-commit. I think this code hasn't been passed through a formatter yet?

Thanks!


with app.app_context():
if not inspect(db.engine).has_table("Session"):
self.db.create_all()
Copy link

Choose a reason for hiding this comment

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

Hmm why to call create_all here? This will affect all tables instead of just the needed one, which will be very confusing

Choose a reason for hiding this comment

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

Something like this should not be there at all! Any developer who uses alembic to maintain DB creation etc will be VERY confused and eventually pissed when finding out that some library executes DDL on its own.

@ThiefMaster
Copy link

ThiefMaster commented May 25, 2023

Having black reformatting in this PR makes it basically impossible for anyone to properly review... widespread formatting changes do not belong in PRs that add features or bugfixes.

@davidism davidism mentioned this pull request Jun 7, 2023
@darless
Copy link
Contributor

darless commented Jun 24, 2023

The PR title states that this merges in changes from flask-session2 but that was done in #160, is the PR title wrong?
I agree with what others stated about this PR having style changes that makes it hard to review, that should be separate. Also workflow changes should be separate, etc.

With all that said, can this be closed out with individual PRs where applicable and keep them tight in scope?

Additionally in the PR I created #179, I updated the testing to use pytest, this will show us the code coverage during github workflows execution. Ideally, we would use the standard testing layout defined there.

@Lxstr
Copy link
Contributor

Lxstr commented Feb 26, 2024

Closing this as have now incorporated effectively all of the fixes. Some backends have not yet been added but will eventually be. Regarding create_all, I will open a new issue directly about this.

@Lxstr Lxstr closed this Feb 26, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

8 participants