Skip to content

Commit 023454c

Browse files
committed
fix a sync issue on deploy
1 parent a3c96d5 commit 023454c

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

packages/cli/src/deploy/beta.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export async function handler(options: DeployOptionsBeta, logger: Logger) {
2929
// TMP use options.path to set the directory for now
3030
// We'll need to manage this a bit better
3131
const project = await Project.from('fs', { root: options.path || '.' });
32+
// Why is there an id on openfn here?
33+
console.log({ openfn: project.openfn });
3234

3335
// TODO: work out if there's any diff
3436

packages/cli/src/pull/beta.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ export async function handler(options: PullOptionsBeta, logger: Logger) {
7777
{
7878
endpoint: cfg.endpoint,
7979
env: name,
80+
81+
// TODO this is NOT an openfn metadata key
82+
// (it should not be sent back to lighting)
83+
// should add it to the local or meta objects instead
8084
fetched_at: new Date().toISOString(),
8185
},
8286
config

packages/project/src/parse/from-fs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
findWorkspaceFile,
1313
} from '../util/config';
1414
import fromProject from './from-project';
15+
import { omit } from 'lodash-es';
1516

1617
export type FromFsConfig = {
1718
root: string;
@@ -50,7 +51,7 @@ export const parseProject = async (options: FromFsConfig) => {
5051

5152
const proj: any = {
5253
name: state?.name,
53-
openfn: context.project,
54+
openfn: omit(context.project, ['id']),
5455
config: config,
5556
workflows: [],
5657
};

packages/project/src/serialize/to-app-state.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ export default function (
1818
project: Project,
1919
options: Options = {}
2020
): Provisioner.Project | string {
21-
const { uuid, endpoint, env, ...rest } = project.openfn ?? {};
21+
const {
22+
uuid,
23+
endpoint,
24+
env,
25+
id /* shouldn't be there but will cause problems if it's set*/,
26+
fetched_at /* remove this metadata as it causes problems */,
27+
...rest
28+
} = project.openfn ?? {};
2229

2330
const state = omitBy(
2431
pick(project, ['name', 'description', 'collections']),

0 commit comments

Comments
 (0)