OpenFn / OpenFn/kit

Sync: allow a v1 project export yaml to be deployed

Open
#1,540 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
21
Forks
23
Avg merge
1d 22h
Merged PRs (30d)
17

Description

Two problems encountered trying to deploy a v1 project file with the v2 command:

  • Credentials are mis-managed
  • An edge is generated for a step which points to itself

Sample yaml:

name: joe-sync-1
description: |
  A test project for sync deploy. User story 1

collections: null
channels: null
credentials:
  jclark@openfn.org-dasd:
    name: dasd
    owner: jclark@openfn.org
  jclark@openfn.org-joe-credential-2:
    name: joe-credential-2
    owner: jclark@openfn.org
  jclark@openfn.org-joes-test-credential:
    name: joes-test-credential
    owner: jclark@openfn.org
workflows:
  Event-based-workflow:
    name: Event-based workflow
    jobs:
      Transform-data:
        name: Transform data
        adaptor: '@openfn/language-common@latest'
        credential: null
        body: |
          // Validate and transform the data you've received...
          fn(state => {
            console.log("Do some data transformation here");
            return state;
          })

    triggers:
      webhook:
        type: webhook
        webhook_reply: after_completion
        enabled: true
    edges:
      webhook->Transform-data:
        source_trigger: webhook
        target_job: Transform-data
        condition_type: always
        enabled: true
  my-workflow:
    name: my workflow
    jobs:
      'A':
        name: 'A'
        adaptor: '@openfn/language-http@7.0.3'
        credential: null
        body: |
          // jam
          get('https://jsonplaceholder.typicode.com/todos/3');
          post('your-endpoint-here', dataValue('data'));
      Common:
        name: Common
        adaptor: '@openfn/language-arcgis@1.0.5'
        credential: null
        body: |
          // Check out the Job Writing Guide for help getting started:
          // https://docs.openfn.org/documentation/jobs/job-writing-guide
      Send-gmail-email:
        name: Send gmail email
        adaptor: '@openfn/language-gmail@latest'
        credential: null
        body: |
          sendMessage({
            to: 'recipient@example.com',
            subject: 'user data',
            text: 'Your email body here'
          });
    triggers:
      cron:
        type: cron
        cron_expression: '*/15 * * * *'
        enabled: false
    edges:
      cron->A:
        source_trigger: cron
        target_job: 'A'
        condition_type: always
        enabled: true
      A->Common:
        source_job: 'A'
        target_job: Common
        condition_type: on_job_success
        enabled: true
      Common->Send-gmail-email:
        source_job: Common
        target_job: Send-gmail-email
        condition_type: on_job_success
        enabled: true

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 at the v2 deploy command and trace how the sample v1 YAML is handled for credentials and workflow edges. Reproduce the deployment with the sample; done means the v1 export deploys without mis-managed credentials or an edge pointing from a step to itself.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.