OpenFn / lightning

OpenFn/Lightning ⚡️ is the newest version of the OpenFn DPG and provides a web UI to visually manage complex workflow automation projects.
https://openfn.github.io/lightning/
GNU Lesser General Public License v3.0
115 stars 31 forks source link

Adds Project and Account hooks #2185

Closed jyeshe closed 3 weeks ago

jyeshe commented 3 weeks ago

Validation Steps

  1. Register a new user (Lightning form)
  2. Login as super user and create another super user
  3. Still as a super user, create a regular user
  4. Still as a super user, create a project

Notes for the reviewer

These hooks (ProjectHook and AccountHook) inside Project and Account contexts allow umbrella apps to handle project and user creation on the same DB which means that all set of operations that need to be atomic can be handled without relying on async events.

As ProjectHook.handle_create_project/1, AccountHook.handle_create_user/1 and so on are called in the context of a DB transaction can be reused by an umbrella app to override and/or extend these hooks.

Related issue

Resolves #2029 Refs https://github.com/OpenFn/thunderbolt/issues/146

Review checklist

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.66%. Comparing base (82e6c19) to head (09519d8). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2185 +/- ## ========================================== + Coverage 89.64% 89.66% +0.02% ========================================== Files 270 274 +4 Lines 9007 9018 +11 ========================================== + Hits 8074 8086 +12 + Misses 933 932 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.