OpenFn / OpenFn/lightning

Export projects as .zip (yaml, state, config)

Open
#913 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

User Story

  • As a user that is setting up version control for an already existing project,
  • I'd like to be able to export a whole directory that I can immediately use as a git repo
  • To save time and make clearer the process for "linking an existing project" to git.

Details

  1. This builds on #249, which allows users to export their current project configuration as a .yaml file. That .yaml file can be use to do new deployments but it can't be used to immediately start updating an existing project. (In this sense, it's good for portability but not adding version control to existing projects.)
  2. The ideal repo structure for version controlling an OpenFn project includes at least a project.yaml, a .state.json file, and a configuration.json file without an API token. (The API token will be passed in manually, or via GitHub secrets if this repo is being used with a GitHub action as in #250 )
  3. The project.yaml export functionality has been delivered in #249, the .state.json functionality is available via the projects API (and is used by the CLI when deploying) and the configuration.json information can be inferred by the current Lightning deployment and decisions—e.g., what will we call the .state.json file, what will we call the project.yaml file, and what is the api endpoint of the current instance: https://app.openfn.org/api or whatever.)

Implementation notes

  1. Start by reviewing the current export as YAML feature.
  2. Read through the export as ZIP feature from V1
  3. Test your zip export by opening the newly downloaded folder and running OPENFN_API_KEY=<<yourkey>> openfn deploy -c configuration.json

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 reviewing the current export-as-YAML feature, then read the linked V1 export-as-ZIP implementation in export_controller.ex. Confirm the project API data needed for .state.json and configuration.json, excluding the API token. Done means the downloaded ZIP contains project.yaml, .state.json, and configuration.json and works with the documented openfn deploy command.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.