Skip to content

Commit a4e4dbd

Browse files
Initial commit
0 parents  commit a4e4dbd

File tree

9 files changed

+330
-0
lines changed

9 files changed

+330
-0
lines changed
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Summary
2+
3+
Add a high-level, single-sentence summary of what this PR changes.
4+
5+
## Issues
6+
7+
Reference any related issues here.
8+
9+
## Review Checklist
10+
11+
Before merging, the reviewer should check the following items:
12+
13+
- [ ] Does the PR do what it claims to do (Mention jobs changes)?
14+
- [ ] Does the PR have adaptor version?

.github/ISSUE_TEMPLATE/bug_report.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Describe the bug and expected behavior
11+
A clear and concise description of what the bug is. Include any error messages from the run logs and the expected behavior.
12+
13+
## To Reproduce
14+
1. Here is a link to a failed run on OpenFn.org which is indicative of the bug: __________
15+
16+
### expression.js
17+
Link to the job itself in Github: _____________
18+
Adaptor:
19+
20+
21+
### state.json
22+
23+
Either provide state directly, or link to a file. If sensitive information
24+
should be in state, redact it and provide instructions for where it can be
25+
found.
26+
27+
```json
28+
{
29+
"configuration": ["SEE LAST PASS: 'client cred'"],
30+
"data": {LINK TO STATE},
31+
"cursor": "2020-01-19 00:00:00"
32+
}
33+
```
34+
35+
## To test/resolve
36+
1. After the desired output is working locally (from the CLI), please [push commits to master || open a pull request].
37+
2. [Please test the change on OpenFn.org by re-running this run (link) and confirming success.]
38+
39+
## Toggl
40+
Name of the Toggle project to log work
41+
+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: Feature request
3+
about: For new workflows & change requests
4+
title: ''
5+
labels: feature request
6+
assignees: ''
7+
8+
---
9+
## Background, context, and business value
10+
11+
A clear and concise description of what the client wants and WHY.
12+
13+
For example: [Insert use case here]
14+
15+
## The specific request, in as few words as possible
16+
17+
A clear and concise description of what you want to happen.
18+
Things to include as needed:
19+
- The number of workflows needed to be created or updated
20+
- The function of each workflow including specific resources and operations
21+
- Unique identifiers
22+
- Links to mapping specifications, data flow diagrams, sample input/output data, and any API documentation
23+
- Links to the data model of target systems, if available
24+
25+
26+
```md
27+
Create a workflow in which OpenFn will:
28+
1. Get new rows from the PostgreSQL database every 1 hour
29+
2. Clean & transform the data according to the specified mapping rules, and then
30+
3. Upsert cases in the Primero case management system via externalId `case_id`
31+
(Note: 1 DB row will = 1 case record.)
32+
33+
See [links] below for the workflow diagrams, mapping specs, & Primero data model.
34+
```
35+
36+
### Data Volumes & Limits
37+
How many records do we think these jobs will need to process in each run? For example:
38+
```md
39+
When you GET data from the DB, this may return up to 1000 records.
40+
There are no known Primero API limits for # of records, but there is API paging to consider.
41+
```
42+
43+
## Input
44+
45+
### Credentials
46+
Which credentials can be used to access the target system(s)?
47+
(Do NOT share credential secrets on this issue -> rather point to where it can be found).
48+
49+
### Data
50+
Describe how the "input" for this workflow will be generated (e.g., webhook request, timer-based query to be sent). Either provide an example directly, link to a file, or describe how a query can be executed to extract data.
51+
52+
Be sure to redact any sensitive data and to not paste here.
53+
54+
55+
## Workflow Steps
56+
57+
For each new Workflow, describe the number of steps needed and the high-level function of each step. Also include the trigger on platform and the adaptor needed for each step.
58+
For existing steps, provide a link to the step itself in Github and the high-level changes needed to be made. _Provide the information below for _each_ step that is required._
59+
60+
61+
### 1. Step Name (e.g., `1. Get new DB rows`)
62+
63+
#### adaptor
64+
E.g., `postgresql`
65+
66+
#### operation
67+
E.g., Query (`SELECT * from table where created_at >= NOW()`)
68+
69+
#### output
70+
List of new DB rows
71+
72+
## How to test
73+
Link to test suite and/or provide examples of input/output scenarios to validate the implementation.
74+
75+
## Toggl
76+
77+

.gitignore

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# temp
2+
tmp
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
lerna-debug.log*
11+
12+
# Diagnostic reports (https://nodejs.org/api/report.html)
13+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
14+
15+
# Runtime data
16+
pids
17+
*.pid
18+
*.seed
19+
*.pid.lock
20+
21+
# Directory for instrumented libs generated by jscoverage/JSCover
22+
lib-cov
23+
24+
# Coverage directory used by tools like istanbul
25+
coverage
26+
*.lcov
27+
28+
# nyc test coverage
29+
.nyc_output
30+
31+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
32+
.grunt
33+
34+
# Bower dependency directory (https://bower.io/)
35+
bower_components
36+
37+
# node-waf configuration
38+
.lock-wscript
39+
40+
# Compiled binary addons (https://nodejs.org/api/addons.html)
41+
build/Release
42+
43+
# Dependency directories
44+
node_modules/
45+
jspm_packages/
46+
47+
# TypeScript v1 declaration files
48+
typings/
49+
50+
# TypeScript cache
51+
*.tsbuildinfo
52+
53+
# Optional npm cache directory
54+
.npm
55+
56+
# Optional eslint cache
57+
.eslintcache
58+
59+
# Microbundle cache
60+
.rpt2_cache/
61+
.rts2_cache_cjs/
62+
.rts2_cache_es/
63+
.rts2_cache_umd/
64+
65+
# Optional REPL history
66+
.node_repl_history
67+
68+
# Output of 'npm pack'
69+
*.tgz
70+
71+
# Yarn Integrity file
72+
.yarn-integrity
73+
74+
# dotenv environment variables file
75+
.env
76+
.env.test
77+
78+
# parcel-bundler cache (https://parceljs.org/)
79+
.cache
80+
81+
# Next.js build output
82+
.next
83+
84+
# Nuxt.js build / generate output
85+
.nuxt
86+
dist
87+
88+
# Gatsby files
89+
.cache/
90+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
91+
# https://nextjs.org/blog/next-9-1#public-directory-support
92+
# public
93+
94+
# vuepress build output
95+
.vuepress/dist
96+
97+
# Serverless directories
98+
.serverless/
99+
100+
# FuseBox cache
101+
.fusebox/
102+
103+
# DynamoDB Local files
104+
.dynamodb/
105+
106+
# TernJS port file
107+
.tern-port
108+
109+
# Don't commit state.json
110+
state.json*
111+
.state.json*
112+
._state.json*
113+
**/state.json*
114+
**/.state.json*
115+
**/._state.json*

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"proseWrap": "always",
3+
"trailingComma": "es5",
4+
"arrowParens": "avoid",
5+
"semi": true,
6+
"singleQuote": true,
7+
"printWidth": 80
8+
}

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# project-name
2+
3+
Please update this readme when you start a new project.
4+
Summarize the solutions implemented or leverage Github pages to build a documentation site.
5+
6+
*Note that commits to `main` will be auto-deployed to OpenFn app if the Github Sync is enabled. Always work on a branch!*
7+
8+
## Getting started with the Repo
9+
10+
1. create `/tmp` folder locally with a `state.json` file that you don't commit to github
11+
2. start writing and testing jobs locally with the relevant adaptor
12+
13+
See the [OpenFn CLI docs](https://docs.openfn.org/documentation/cli-walkthrough#7-running-workflows) for more on writing, running, and testing workflows locally.
14+
See the [Platform Docs](https://docs.openfn.org/documentation/build/steps/step-editor) for how to run and test workflows on the app.
15+
16+
## Project Documentation
17+
The OpenFn team will often leverage [Github Pages](https://pages.github.com/) to configure a documentation site to organize and display project-specific information.
18+
This site can display the content on this README, or be pointed to another markdown `.md` file created on this repo specifically for docs.
19+
20+
See this example Github pages site that displays this README as a simple site: [https://openfn.github.io/project/](https://openfn.github.io/project/)
21+
22+
Github Page configuration can be adjusted in the `Settings` of this repository.
23+
<img width="1157" alt="Screenshot 2024-05-07 at 2 45 23 PM" src="https://github.com/OpenFn/project/assets/16758106/aa56f904-06b8-46a9-9ea1-18f973c8b527">
24+
25+
26+
## Implementation Checklist
27+
[See OpenFn Docs site](https://docs.openfn.org/documentation/get-started/implementation-checklist) or [this workbook](https://docs.google.com/spreadsheets/d/1_XY0nx0OLNUsogrIHnRaSTyZ-KdcSXks-tqwm3ZfMc4/edit#gid=72612093) for a template work plan for the OpenFn implementation, or contact `[email protected]` to get the Asana-version of this checklist.
28+
29+
## Administration
30+
_It's good practice to document on the read me who is responsible for managing & maintaining the OpenFn project._
31+
### Provisioning, Hosting, & Maintenance
32+
_Document details specific to your OpenFn deployment_
33+
- Deployment: SaaS or Local?
34+
- Platform Version: OpenFn V1 or V2
35+
- Maintenance: Specify the team responsible for software maintenance, security updates, etc. - confirm roles & responsibilities across systems
36+
37+
### Support
38+
_List relevant support point of contacts and system administrators._
39+
- {Contact1 name, email}

sampleData/payload.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"a": 1
3+
}

workflows/jobs/expression.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// language-http
2+
3+
get('someUrl', { ...params }, callback);
4+
post('someUrl', { body: state => state.data })'

workflows/lightning-workflow.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"options": {
3+
"start": "get-data",
4+
"timeout": 1200000
5+
},
6+
"workflow": {
7+
"steps": [
8+
{
9+
"id": "get-data",
10+
"adaptor": "[email protected]",
11+
"state": {},
12+
"configuration": "./tmp/db-credential.json",
13+
"expression": "./jobs/1-getPatientData.js",
14+
"next": {
15+
"post-data": {
16+
"condition": "true"
17+
}
18+
}
19+
},
20+
{
21+
"id": "post-data",
22+
"adaptor": "http@latest",
23+
"configuration": "./tmp/api-credential.json",
24+
"state": {},
25+
"expression": "./jobs/2-postData.js"
26+
}
27+
]
28+
}
29+
}

0 commit comments

Comments
 (0)