OpenHumans / open-humans

Powering openhumans.org
https://www.openhumans.org/
MIT License
73 stars 22 forks source link

Move to py3.10, django 3.2 and heroku stack 22 #1159

Closed gedankenstuecke closed 2 months ago

gedankenstuecke commented 2 months ago

Description

Okay, this started out as the wish to be able to have a recaptcha when registering to make live for our spammers at least a bit harder, but then it turned out to be a bit more work given that our deployment was a bit behind in terms of heroku stack.

So in short this one:

  1. Updates our heroku stack to 22
  2. Bumps the Python version from 3.6 to 3.10 (as that is supported on Heroku stack 22)
  3. Bumps the Django library to 3.2 (from 2.2) (and many downstream libraries), as those are needed for the newer Python version.
  4. Finally adds in the captcha, which started this journey

Related Issue

Testing

I've mainly tested it on our staging deployment on Heroku, which I bumped to Stack22 already, the deployment there seems to work as far as I could see.

gedankenstuecke commented 2 months ago

@beaugunderson I've tagged you in, as I think you'd be most likely in the position to give this a look to see if that all makes sense or not. You'll also have access to the heroku stacks to see everything there I think :-)

gedankenstuecke commented 2 months ago

Thanks @beaugunderson! Did you have a chance to run the tests locally? I didn't yet myself but can try to sort that out over the WE hopefully!

beaugunderson commented 2 months ago

Thanks @beaugunderson! Did you have a chance to run the tests locally? I didn't yet myself but can try to sort that out over the WE hopefully!

there are failures:

======================================================================
FAIL: test_authorize_if_already_authorized (private_sharing.tests.DirectSharingOAuth2Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/beau/p/open-humans/private_sharing/tests.py", line 247, in test_authorize_if_already_authorized
    self.assertTrue(b"Project previously authorized." in response.content)
AssertionError: False is not true

======================================================================
FAIL: test_authorize_if_logged_in (private_sharing.tests.DirectSharingOAuth2Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/beau/p/open-humans/private_sharing/tests.py", line 238, in test_authorize_if_logged_in
    self.assertEqual(response.status_code, 200)
AssertionError: 302 != 200

----------------------------------------------------------------------
Ran 76 tests in 13.755s

FAILED (failures=2, errors=5, skipped=7)

Additionally, I did not have AMQP running so both test_message_member tests hung, I commented them out to see if the rest succeeded.

I also did not run the chromedriver tests.

gedankenstuecke commented 2 months ago

Thanks, I just tried reproducing both of those tests in the staging environment and the joining for the on-site worked, as did the "previously joined" warning!