Repository navigation
feat: add cloud workflows quickstart - #2120
Conversation
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
|
Here is the summary of changes. You added 2 region tags.
This comment is generated by snippet-bot.
|
|
CI failures are unrelated. |
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
35010c4 to
46aa63f
Compare
|
Thanks for the review @grayside. I've addressed your comments. PTAL again. |
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
|
|
| // Execute workflow | ||
| try { | ||
| const createExecutionRes = await client.createExecution({ | ||
| parent: client.workflowPath(projectId, location, workflow), |
There was a problem hiding this comment.
nit: save parent as a variable
There was a problem hiding this comment.
There's no reason to add a new variable/const, as the expression is not reused.
There was a problem hiding this comment.
Right, but it may be more readable split apart. Preference is up to you.
| parent: client.workflowPath(projectId, location, workflow), | |
| const parent = client.workflowPath(projectId, location, workflow); | |
| const createExecutionRes = await client.createExecution({parent}); |
There was a problem hiding this comment.
Yes, it could be argued either way. Less variables on the stack / in autocompletion results one way.
There was a problem hiding this comment.
Since this is a quickstart the emphasis is not on readability to the same degree as a snippet, however the (often forgotten) rubric guideline is to avoid nesting complex initialization logic inside objects.
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
grant
left a comment
There was a problem hiding this comment.
Thanks, replied to comments with updated code.
| // Execute workflow | ||
| try { | ||
| const createExecutionRes = await client.createExecution({ | ||
| parent: client.workflowPath(projectId, location, workflow), |
There was a problem hiding this comment.
There's no reason to add a new variable/const, as the expression is not reused.
|
Can an admin merge this PR? @ace-n looks like there's a flaky Functions test. |
|
I'll try re-running the tests for now, and merge if they continue to be flaky. |
Inits canonical Cloud Workflows API quickstart sample.
workflows/quickstartmyfirstworkflow) using the Workflows client libraryGOOGLE_CLOUD_PROJECT=my-project npm testExample test result:
CC: @KrisBraun