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

CLI: add an option to pull that targets given snapshots #729

Closed
midigofrank opened this issue Jul 9, 2024 · 1 comment · Fixed by #732 or #734
Closed

CLI: add an option to pull that targets given snapshots #729

midigofrank opened this issue Jul 9, 2024 · 1 comment · Fixed by #732 or #734
Assignees

Comments

@midigofrank
Copy link
Contributor

midigofrank commented Jul 9, 2024

User story

GitHub actions rely on openfn pull to fetch project state and .yaml files from the app to a GitHub repository (as it would when called in a local environment). When this command is called, the latest version of the project (workflows and settings) is fetched and saved in a directory specified in the config.json file.

While this works for most use cases, there's a challenge when openfn pull is triggered by the Sync to GitHub feature on Lightning due to lag introduced by steps between when the Sync to GitHub event was initiated and when the GitHub action triggers the openfn pull command. With snapshots, we want to be able to attach a snapshot id to openfn pull so that newer changes are not deployed until the user syncs them by clicking "Sync to GitHub".

Check this issue to read more: OpenFn/lightning#1827

Details

Maybe have openfn pull --snapshots snapshot1 snapshot2 ??

  • If the snapshots option is included, the cli should include them in the get requests to lightning. i.e.
    For fetching the YAML:
get(`/api/provision/yaml?id=${project_id}&snapshots[]=${snapshot1}&snapshots[]=${snapshot2}`)

For fetching the project state:

get(`/api/projects/${project_id}?snapshots[]=${snapshot1}&snapshots[]=${snapshot2}`)
  • When the snapshots option is NOT included, the pull command works exactly as it is right now.
@midigofrank
Copy link
Contributor Author

Implementation for pulling the yaml has not been done

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