Skip to content

Commit

Permalink
Merge pull request #734 from OpenFn/include-snapshot-ids-when-fetchin…
Browse files Browse the repository at this point in the history
…g-project-spec

Add snapshots to the url for fetching project spec
  • Loading branch information
josephjclark authored Jul 17, 2024
2 parents 9928992 + 2105329 commit acceafe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @openfn/cli

## 1.6.1

### Patch Changes

- 505d60b: Add snapshot ids to the url for fetching project spec

## 1.6.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/cli",
"version": "1.6.0",
"version": "1.6.1",
"description": "CLI devtools for the openfn toolchain.",
"engines": {
"node": ">=18",
Expand Down
7 changes: 6 additions & 1 deletion packages/cli/src/pull/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ async function pullHandler(options: PullOptions, logger: Logger) {

logger.always('Downloading the project spec (as YAML) from the server.');
// Get the project.yaml from Lightning
const queryParams = new URLSearchParams();
queryParams.append('id', options.projectId);
options.snapshots?.forEach((snapshot) =>
queryParams.append('snapshots[]', snapshot)
);
const url = new URL(
`api/provision/yaml?id=${options.projectId}`,
`api/provision/yaml?${queryParams.toString()}`,
config.endpoint
);
logger.debug('Fetching project spec from', url);
Expand Down

0 comments on commit acceafe

Please sign in to comment.