OpenFn / OpenFn/lightning

Refactor create_project, create_user, register_user

Open
#2,084 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactor
Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

There are a bunch of account-related features that need unpicking. Lightning.Projects.create_project was recently extended and now includes some emailing behaviour. Some unwanted side effects appeared, and we think that it's a good time to refactor these contexts and functions.

  • create project
  • create user
  • register user

Ideally, we'd always have the ability to create a project or create a user without sending emails. If we want to introduce more complex business logic like that introduced here we should consider a higher level function (like a service) that does a number of things.

By changing the deep create_project function like in the commit above, we risk modifying a lot of application behaviour.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Lightning.Projects.create_project and the create_user and register_user functions, including the linked commit that introduced emailing behavior. Separate the lower-level creation operations from higher-level business logic so project and user creation can occur without sending emails, while preserving the intended account behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.