-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #813 from OpenFn/collections-dont-override
worker: allow steps to specify their own adaptor version
- Loading branch information
Showing
3 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@openfn/ws-worker': patch | ||
--- | ||
|
||
Allow steps to specify their own adaptor version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -614,7 +614,36 @@ test('append the collections adaptor to jobs that use it', (t) => { | |
t.deepEqual(b.adaptors, ['common', '@openfn/[email protected]']); | ||
}); | ||
|
||
test('append the collections credential to jobs that use it', (t) => { | ||
test('do not append the collections adaptor to jobs that already have it', (t) => { | ||
const run: Partial<LightningPlan> = { | ||
id: 'w', | ||
jobs: [ | ||
createNode({ | ||
id: 'a', | ||
body: 'collections.each("c", "k", (state) => state)', | ||
adaptor: '@openfn/language-collections@latest', | ||
}), | ||
], | ||
triggers: [{ id: 't', type: 'cron' }], | ||
edges: [createEdge('t', 'a')], | ||
}; | ||
|
||
const { plan } = convertPlan(run as LightningPlan, { | ||
collectionsVersion: '1.0.0', | ||
}); | ||
|
||
const [_t, a] = plan.workflow.steps; | ||
|
||
// @ts-ignore | ||
t.deepEqual(a.adaptors, ['@openfn/language-collections@latest']); | ||
|
||
t.deepEqual(plan.workflow.credentials, { | ||
collections_token: true, | ||
collections_endpoint: true, | ||
}); | ||
}); | ||
|
||
test('append the collections credential to workflows that use it', (t) => { | ||
const run: Partial<LightningPlan> = { | ||
id: 'w', | ||
jobs: [ | ||
|