Decoupling looper #85646

Closed
opened 2021-02-15 11:23:43 +01:00 by Anna Sirota · 8 comments
Owner

Goal

Having a looper package that is used in DevFund and can also be reused in Blender Studio with mostly cosmetic changes. This means the following payments components should be decoupled from DevFund:

  • Data structures, models, signals and so on;
  • Braintree integration, JS and views;
  • Checkout views and templates;

If possible, these would be nice to make reusable too:

  • Customer information view and templates;
  • Billing address views and templates.

Two existing loopers

Standalone looper: https:*developer.blender.org/source/looper/

Devfund's looper: https:*developer.blender.org/source/blender-dev-fund/browse/master/looper/

The goal of the below steps is to use the already working DevFund's looper as a starting point, while attempting to salvage some useful changes from the standalone looper.

This means:

  • making only cosmetic changes to the DevFund's implementation,
  • adding all DevFund's features into the standalone version,
  • temporarily reverting any features and migrations that the standalone version has and DevFund's doesn't.

Decoupling devfund's looper

  1. Minimising superficial differences: currently two versions of looper have very different sources, partially due to syntax checkers enforced differently, which makes patching/reading diffs almost impossible (D10434, D10435):
    1. pug templates and gulp boilerplate removed from devfund;
    2. black, mypy applied to devfund's looper;
    3. Missing tests and views copied, so that they exist in both versions.
    4. Functionality that doesn't belong to looper moved out of DevFund's looper
  2. Static assets devfund's looper depends on should be contained in its looper directory
  1. GeoLite2 should be contained in devfund's looper directory
  2. Devfund's looper packaged as a standalone looper package
  Devfund's implementation contains views that do not exist in the standalone one and are not specific to DevFund (e.g. customer settings, address editing, existing payment methods).
**As a start, devfund's version of `looper.migrations` should be used, so that no migrations have to be applied when devfund switches to using a packaged looper.**
  1. Devfund should use this package
  (as a submodule, via pypi or git dependency, whichever is quicker to setup, this can changed later)

Applying missing migrations

After packaged version has proven not to break anything in devfund, changes that had been rolled back in the standalone looper can be reapplied.

  1. User to Customer migration applied to devfund

Upd: the migration was not applied, because its benefits for Blender Cloud didn't seem to be greater than the effort required to make it work with Development Fund and risks of applying it to the whole database of existing Fund members.

At this point it should be possible to integrate looper into Blender Studio in the same manner.

Clean up

    • GitLab's looper should be removed/archived, to avoid causing confusion in the future
    • Stale patches and abandoned looper branches should be closed/deleted
## Goal Having a `looper` package that is used in DevFund and can also be reused in Blender Studio with mostly cosmetic changes. This means the following payments components should be decoupled from DevFund: * Data structures, models, signals and so on; * Braintree integration, JS and views; * Checkout views and templates; If possible, these would be nice to make reusable too: * Customer information view and templates; * Billing address views and templates. ### Two existing loopers Standalone looper: [https:*developer.blender.org/source/looper/](https:*developer.blender.org/source/looper/) Devfund's looper: [https:*developer.blender.org/source/blender-dev-fund/browse/master/looper/](https:*developer.blender.org/source/blender-dev-fund/browse/master/looper/) The goal of the below steps is to use the already working DevFund's looper as a starting point, while attempting to salvage some useful changes from the standalone looper. This means: - making only cosmetic changes to the DevFund's implementation, - adding all DevFund's features into the standalone version, - temporarily reverting any features and migrations that the standalone version has and DevFund's doesn't. ## Decoupling devfund's looper 1. Minimising superficial differences: currently two versions of looper have very different sources, partially due to syntax checkers enforced differently, which makes patching/reading diffs almost impossible ([D10434](https://archive.blender.org/developer/D10434), [D10435](https://archive.blender.org/developer/D10435)): 1. `pug` templates and `gulp` boilerplate removed from devfund; * [D10407](https://archive.blender.org/developer/D10407) 2. `black`, `mypy` applied to devfund's looper; * [D10431](https://archive.blender.org/developer/D10431) (on hold) 3. Missing tests and **views** copied, so that they exist in both versions. * [D10398](https://archive.blender.org/developer/D10398) 4. Functionality that doesn't belong to looper moved out of DevFund's looper * [D10437](https://archive.blender.org/developer/D10437) 2. Static assets devfund's looper depends on should be contained in its looper directory * [D10440](https://archive.blender.org/developer/D10440) 3. GeoLite2 should be contained in devfund's looper directory 4. **Devfund's looper packaged as a standalone `looper` package** ``` Devfund's implementation contains views that do not exist in the standalone one and are not specific to DevFund (e.g. customer settings, address editing, existing payment methods). ``` **As a start, devfund's version of `looper.migrations` should be used, so that no migrations have to be applied when devfund switches to using a packaged looper.** 5. Devfund should use this package ``` (as a submodule, via pypi or git dependency, whichever is quicker to setup, this can changed later) ``` ## Applying missing migrations After packaged version has proven not to break anything in devfund, changes that had been rolled back in the standalone looper can be reapplied. 1. ~~[User to Customer migration applied to devfund](https://developer.blender.org/rLfadc6daea8c30dfc4ba7f5ef6b5331f5d7414aa9)~~ Upd: the migration was not applied, because its benefits for Blender Cloud didn't seem to be greater than the effort required to make it work with Development Fund and risks of applying it to the whole database of existing Fund members. At this point it should be possible to integrate looper into Blender Studio in the same manner. ## Clean up - - [x] [GitLab's looper](https://gitlab.com/blender/looper) should be removed/archived, to avoid causing confusion in the future - - [x] Stale patches and abandoned looper branches should be closed/deleted
Anna Sirota self-assigned this 2021-02-15 11:23:43 +01:00
Author
Owner

Added subscriber: @railla

Added subscriber: @railla
Author
Owner

Added subscribers: @fsiddi, @dr.sybren

Added subscribers: @fsiddi, @dr.sybren
Author
Owner

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

This issue was referenced by studio/blender-studio@5eba10d694

This issue was referenced by studio/blender-studio@5eba10d6943250955159acf60e79a2df39f8e30c

This issue was referenced by d9152b72b0

This issue was referenced by d9152b72b050bd38b59c9f6ec4fc2139d996734d

This issue was referenced by 514729cce1

This issue was referenced by 514729cce143c8bce2ea6d8143edfaee20de38c9

This issue was referenced by 8c652a2342

This issue was referenced by 8c652a2342ffd0774b89d6215eab931d44ae40f6
Author
Owner

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: infrastructure/devfund-website#85646
No description provided.