Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Workflow Steps from Apps #597

Merged
merged 11 commits into from
Sep 3, 2020

Conversation

misscoded
Copy link
Contributor

Summary

This pull request contains the proposed API changes outlined here to incorporate support for Workflow Steps from Apps.


Workflow Steps provide the ability for Slack apps to create and process custom Workflow Steps for use in Workflows. Steps can be built to do things such as send data to external services, create tasks in project management systems, or update tickets. These steps can then be shared and used by anyone in the Workflow Builder to incorporate into Workflows they're building.

For more information on Workflow Steps, read full details here: https://api.slack.com/workflows/steps

Requirements

@misscoded misscoded added the enhancement M-T: A feature request for new functionality label Aug 25, 2020
@misscoded misscoded self-assigned this Aug 25, 2020
src/WorkflowStep.ts Outdated Show resolved Hide resolved
src/WorkflowStep.ts Outdated Show resolved Hide resolved
@@ -17,7 +17,7 @@ export type AnyMiddlewareArgs =
| SlackViewMiddlewareArgs
| SlackShortcutMiddlewareArgs;

interface AllMiddlewareArgs {
export interface AllMiddlewareArgs {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

src/WorkflowStep.ts Outdated Show resolved Hide resolved
src/WorkflowStep.ts Outdated Show resolved Hide resolved
const token = selectToken(context);

return (config: Parameters<StepCompleteFn>[0]) => {
const { outputs = [] } = config;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outputs should default to an empty object, as it's not an array, but a key/value mapping in the step execute portion.

Copy link
Contributor Author

@misscoded misscoded Sep 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going off of the other comments around config, since outputs is optional per the API docs, I altered this to be the following:

return (config: Parameters<StepCompleteFn>[0] = {}) => {
  return client.workflows.stepCompleted({
    token,
    workflow_step_execute_id,
    ...config,
  });
};

Testing didn't reveal any issues in my case, but let me know if this doesn't suit for some reason!

@misscoded misscoded changed the base branch from feat-workflow-steps to main September 3, 2020 01:37
package.json Outdated
@@ -44,8 +44,8 @@
"dependencies": {
"@slack/logger": "^2.0.0",
"@slack/oauth": "^1.2.0",
"@slack/types": "^1.6.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder :: @slack/types and @slack/web-api need to be updated to appropriate versions prior to merge

@codecov
Copy link

codecov bot commented Sep 3, 2020

Codecov Report

Merging #597 into feat-workflow-steps will decrease coverage by 2.32%.
The diff coverage is 66.31%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           feat-workflow-steps     #597      +/-   ##
=======================================================
- Coverage                83.27%   80.95%   -2.33%     
=======================================================
  Files                        7        8       +1     
  Lines                      598      693      +95     
  Branches                   193      206      +13     
=======================================================
+ Hits                       498      561      +63     
- Misses                      67       95      +28     
- Partials                    33       37       +4     
Impacted Files Coverage Δ
src/App.ts 86.77% <0.00%> (-1.09%) ⬇️
src/WorkflowStep.ts 67.41% <67.41%> (ø)
src/errors.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2c17a0...f9e1c55. Read the comment docs.

@misscoded misscoded changed the base branch from main to feat-workflow-steps September 3, 2020 02:27
@misscoded misscoded force-pushed the feat-workflow-steps branch 2 times, most recently from 47a53bf to f2c17a0 Compare September 3, 2020 02:34
@misscoded misscoded merged commit a456a00 into slackapi:feat-workflow-steps Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality semver:minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants