Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Open-Fn with OpenSPP #248

Closed
13 of 14 tasks
jeremi opened this issue Jun 22, 2023 · 18 comments
Closed
13 of 14 tasks

Integrate Open-Fn with OpenSPP #248

jeremi opened this issue Jun 22, 2023 · 18 comments
Assignees

Comments

@jeremi
Copy link
Member

jeremi commented Jun 22, 2023

What is OpenFn?

Digital Public Good for workflow automation–a platform.

Video link explaining how OpenFN works

Official documentation

OpenFn v1 iPaaS will be used to integrate with OpenSPP.

  • Write the Adaptor
  • Prepare a demo flow

registrant_id is from: https://github.com/OpenSPP/openspp-registry/issues/247

Implement the methods:

@nhatnm0612
Copy link
Contributor

nhatnm0612 commented Jun 26, 2023

@jeremi https://community.openfn.org/t/testing-new-adaptor-on-local-environment-with-lightning/331/2
there is no way to test local adaptor on local Lightning running, confirmed by OpenFN employee. I gonna switch to the only way is writing automated tests and running that.

@jeremi
Copy link
Member Author

jeremi commented Aug 8, 2023

ok

@jeremi jeremi assigned nhatnm0612 and unassigned jeremi Aug 8, 2023
@dasunhegoda
Copy link
Contributor

Left to be done,

  • Publishing of the adaptor - create a PR and request them to accept it. @nhatnm0612 will create the PR today.

@jeremi
Copy link
Member Author

jeremi commented Aug 10, 2023

How can I test it manually?

@nhatnm0612
Copy link
Contributor

@jeremi we can not, only testing using unittest code via pnpm, and in term of unittest, I mean mocking test response from Odoo as well.

@dasunhegoda
Copy link
Contributor

@nhatnm0612 will raise the PR today.

@jeremi
Copy link
Member Author

jeremi commented Aug 16, 2023

but @nhatnm0612 can we install it locally and run it (not automated tests)?

@nhatnm0612
Copy link
Contributor

but @nhatnm0612 can we install it locally and run it (not automated tests)?

@jeremi no, it is confirmed by OpenFN employee

@dasunhegoda
Copy link
Contributor

dasunhegoda commented Sep 15, 2023

@nhatnm0612 will setup OpenFN on local to be utilized with OpenSPP repo.

@dasunhegoda
Copy link
Contributor

dasunhegoda commented Oct 16, 2023

@nhatnm0612 has raised a PR in the OpenFN repo. OpenFn/adaptors#409

@dasunhegoda
Copy link
Contributor

The methods mentioned in the description have been implemented.

@dasunhegoda
Copy link
Contributor

@nhatnm0612 will list down the steps to setup on local.

@nhatnm0612
Copy link
Contributor

steps for setting up local OpenFN:

  1. Requirements:
  • Using Unix like Os [Ubuntu] / MacOs with Apple Silicon chips [harder version].
  • Having basic knowledge of nodejs & Unix like file system.
  1. Pre-installed:

After Pre-installed step, basically, you can boost up OpenFn Lightning with this command:
iex -S mix phx.server

  1. Installing new adaptor locally:
  def fetch() do
    start = DateTime.utc_now()
    Logger.debug("Fetching adaptors from NPM.")

    openfn_adapters =
      Npm.user_packages("openfn")
      |> Enum.map(fn {name, _} -> name end)
      |> Enum.filter(fn name ->
        Regex.match?(~r/@openfn\/language-\w+/, name)
      end)
      |> Enum.reject(fn name ->
        name in @excluded_adaptors
      end)
      |> Task.async_stream(
        &fetch_npm_details/1,
        ordered: false,
        max_concurrency: 10,
        timeout: @timeout
      )
      |> Stream.map(fn {:ok, detail} -> detail end)
      |> Enum.to_list()
    result = openfn_adapters ++ [
      %{
        latest: "1.0.0",
        name: "openspp",
        repo: "git+https://github.com/nhatnm0612/adaptors/tree/add-openspp-adaptor",
        versions: [%{version: "1.0.0"}]
      }
    ]
    diff = DateTime.utc_now() |> DateTime.diff(start, :millisecond)
    # IO.inspect(result)
    Logger.debug(fn -> "Finished fetching adaptors in #{diff}ms." end)
    result
  end

@nhatnm0612
Copy link
Contributor

nhatnm0612 commented Nov 6, 2023

@dasunhegoda due to requests from OpenFN side, I need a rectangle image [png, 512*190px] of OpenSPP for the adaptor logos. [link]. Also, they asked me to create test jobs with OpenSPP sandbox server's credentials [link]

I made some changes last weekend and all the feedbacks are positive now except these 2.

@dasunhegoda
Copy link
Contributor

@nhatnm0612 : You can use the logo on our web and resize it as per requirement. If additional help is required, Lit usually helps us with this. We can use the openspp demo env as the sandbox.

@jeremi
Copy link
Member Author

jeremi commented Nov 6, 2023

@nhatnm0612 ask Lit for it. He will prepare it for you.

@jeremi
Copy link
Member Author

jeremi commented Nov 15, 2023

Can you add the methods:

  • createIndividual(data)
  • updateIndividual(individual_id, data)
  • createGroup(data)
  • updateGroup(group_id, data)
  • addToGroup(group_id, individual_id, role)
  • removeFromGroup(group_id, individual_id)

@nhatnm0612
Copy link
Contributor

nhatnm0612 commented Nov 27, 2023

link to slack message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants