Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/five-lamps-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openfn/project': patch
---

Suppress error message when generating app state without a credentials.yaml
5 changes: 5 additions & 0 deletions .changeset/slow-worms-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openfn/cli': patch
---

Improve --help docs and error messages
18 changes: 10 additions & 8 deletions packages/cli/src/execute/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,33 +84,35 @@ const options = [
const executeCommand: yargs.CommandModule<ExecuteOptions> = {
command: 'execute <path> [workflow]',
describe: `Run an openfn expression or workflow. Get more help by running openfn <command> help.
\nExecute will run a expression/workflow at the path and write the output state to disk (to ./state.json unless otherwise specified)
\nRemember to include the adaptor name with -a. Auto install adaptors with the -i flag.`,
\nExecute will run a expression/workflow at the path and write the output state to disk (to ./state.json unless otherwise specified)`,
aliases: ['$0'],
handler: ensure('execute', options),
builder: (yargs) =>
build(options, yargs)
// TODO this is now path or workflow name
.positional('path', {
describe:
'The path to load the job or workflow from (a .js or .json file or a dir containing a job.js file)',
describe: 'The path or name of the workflow or expression to run',
demandOption: true,
})
.example(
'openfn my-workflow',
'Execute a workflow called my-workflow. Requires an openfn.yaml file (created by openfn project pull)'
)
.example(
'openfn foo/job.js',
'Execute foo/job.js with no adaptor and write the final state to foo/job.json'
'Execute foo/job.js (with no adaptor) and write the final state to foo/job.json'
)
.example(
'openfn workflow.json',
'Execute the workflow contained in workflow.json'
)
.example(
'openfn job.js -a common --log info',
'Execute job.js with common adaptor and info-level logging'
'Execute job.js with common adaptor (which will be automatically installed) and info-level logging'
)
.example(
'openfn compile job.js -a http',
'Compile the expression at job.js with the http adaptor and print the code to stdout'
'openfn job.js -ma common',
'Execute job.js with the build of the common adaptor found in your adaptors monorepo'
),
};

Expand Down
2 changes: 1 addition & 1 deletion packages/project/src/Workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class Workspace {
} catch (e) {
if (validate) {
this.logger.warn(
`Could not find openfn.yaml at ${workspacePath}. Using default values.`
`Could not find openfn.yaml at ${workspacePath}. Using default configuration.`
);
}
}
Expand Down
9 changes: 5 additions & 4 deletions packages/project/src/serialize/to-app-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,12 @@ export const mapWorkflow = (
});
if (mappedCredential) {
projectCredentialId = mappedCredential.uuid;
} else {
console.warn(`WARING! Failed to map credential ${projectCredentialId} - Lightning may throw an error.

Ensure the credential exists in project.yaml and try again (maybe ensure the credential is attached to the project in the app and run project fetch)`);
}
// else {
// console.warn(`WARING! Failed to map credential ${projectCredentialId} - Lightning may throw an error.

// Ensure the credential exists in project.yaml and try again (maybe ensure the credential is attached to the project in the app and run project fetch)`);
// }
otherOpenFnProps.project_credential_id = projectCredentialId;
}
}
Expand Down