1. 04 Jul, 2024 3 commits
    • Jérome Perrin's avatar
      testCMFActivity: support pickle protocol > 0 in test_insert_max_payload · 5ec854aa
      Jérome Perrin authored
      This test assumed that activating a method with a string of length `n+x`
      as argument would be serialized in `x` more bytes that activating the
      same method with a string of length `n` as argument, which is only true
      for protocol 0 for multiple reasons ( short strings and long strings
      are serialized differently, "frames" are used with protocol 5) and
      db.string_literal seems to introduce a difference.
      
      Change the test to mock Message.dump to produce longer dumps instead of
      relying on this assumption.
      5ec854aa
    • Jérome Perrin's avatar
      testCMFActivity: do not rely on unittest internals (_resultForDoCleanups) · 33e6415c
      Jérome Perrin authored
      _resultForDoCleanups no longer exists on python3, getting the status
      of a test in teardown is very different accross python versions ( see
      https://stackoverflow.com/q/4414234 ) and just executing this code when
      the test failed only has the problem that a test method may count as
      two failures or errors, which is after all not a big problem.
      33e6415c
    • Jérome Perrin's avatar
      ComponentTool: update new test snippet · 102bfbe6
      Jérome Perrin authored
      On recent pylint, this is flagged as unnecessary-pass
      
      Also update the link that was pointing to python2 doc
      102bfbe6
  2. 02 Jul, 2024 7 commits
    • Rafael Monnerat's avatar
    • Rafael Monnerat's avatar
      erp5_oauth_[google|facebook]_login: Normalize get*Connector so we can use on login page · 9dd76a3b
      Rafael Monnerat authored
        This is helpfull to display or not the buttons on login page
      9dd76a3b
    • Rafael Monnerat's avatar
      erp5_core: Don't enable login buttons if the connector isnt configured · fc742752
      Rafael Monnerat authored
        If the login button isnt suppose to work, dont display it.
      fc742752
    • Georgios Dagkakis's avatar
      Widget.py: Allow to set autocomplete also for hidden fields · 7feb1a67
      Georgios Dagkakis authored
      We may want to set autocomplete 'off' or whatever other value
      7feb1a67
    • Vincent Pelletier's avatar
      Products.CMFActivity: Distribute all activities pending distribution · 4cbc4eea
      Vincent Pelletier authored
      Activity distribution (actually: validation) is fundamentally a bottleneck
      of the current CMFActivity design: there can be only one distribution/
      validation node, and it must check every single activity which express a
      dependency over any activity, until these dependencies are satisfied.
      As a result, distribution/validation is in the critical path between an
      activity being spawned and it being executed, and this work cannot be
      parallelised. So care should be taken to waste as little time as possible,
      in order to reduce the activity execution latency.
      
      Before this change, CMFActivity would distribute at most 1000 activities
      (MAX_VALIDATED_LIMIT) per queue per timerserver wake-up.
      In a typical ERP5 setup, timerserver ticks once per second, which means
      CMFActivity was unable to validate more than 1000 activities per second
      per queue. Maybe there are more activities which are possible to validate
      but still the code was forcing the node to sleep until the next wake-up,
      which is a tremendous waste of time.
      
      This change fixes that issue by having ActivityTool.distribute keep looping
      until there has been an iteration over all activity queues which
      simultaneously did not find any activity they could validate. This lets
      Zope yield CPU control when it would be better spent processing activities
      (those which are preventing the validation of any activities remaining to
      validate) without imposing a maximum effective validation-per-second
      hard limit.
      4cbc4eea
    • Vincent Pelletier's avatar
      Products.CMFActivity.SQLBase: Always commit before returning · 966fb6a0
      Vincent Pelletier authored
      Committing serves two purposes:
      - obviously: it makes any transactional data change persistent
      - less obviously: it releases the database transactional snapshot taken by
        any previously issued query, allowing that snapshot and all snapshots
        after it to be also freed (ex: garbage collecting the data records that
        no other transaction can see)
      In the current state of the code flow, this does not change much: after
      this method returns the code flow should quickly hit a commit anyway,
      either in dequeueMessage or before handing control back to timerserver,
      thereby ending the Zope-initiated transaction.
      But this will not be true in a future version of the code.
      966fb6a0
    • Vincent Pelletier's avatar
      Products.CMFActivity: Inverse dequeueMessage return value · 02791ba1
      Vincent Pelletier authored
      dequeueMessage used to return False when something was done, and True
      otherwise. The only caller which uses that value then reverses it, causing
      a double-negative which makes the code confusing to read.
      Inverse the meaning of the return value, getting rid of this double-
      negation.
      02791ba1
  3. 01 Jul, 2024 3 commits
  4. 28 Jun, 2024 1 commit
  5. 27 Jun, 2024 5 commits
  6. 26 Jun, 2024 2 commits
  7. 25 Jun, 2024 2 commits
  8. 24 Jun, 2024 1 commit
  9. 20 Jun, 2024 1 commit
  10. 19 Jun, 2024 4 commits
  11. 18 Jun, 2024 3 commits
  12. 17 Jun, 2024 1 commit
  13. 11 Jun, 2024 2 commits
  14. 09 Jun, 2024 2 commits
    • Jérome Perrin's avatar
      d885e20e
    • Jérome Perrin's avatar
      oauth_google_login: reimplement with oauthlib/requests · c3488a67
      Jérome Perrin authored
      Because the librairies used here were never ported to python3.
      
      Notable changes:
      
        - ERP5Site_createGoogleUserToOAuth is dropped
        - internal API changed radically, so customizations made by overriding
          scripts are broken.
        - the core logic is now implemented in a connector class (still in
          portal_oauth for simplicity, but it would be simpler to move it to
          portal_web_services)
      
      No changes required in the google console, the redirect uri is still
      ERP5Site_receiveGoogleCallback
      c3488a67
  15. 06 Jun, 2024 3 commits