Skip to content

Fixes and polish for stable release#2128

Merged
filmaj merged 3 commits intofeat-functionsfrom
pre-stable-fixes
Aug 12, 2024
Merged

Fixes and polish for stable release#2128
filmaj merged 3 commits intofeat-functionsfrom
pre-stable-fixes

Conversation

@misscoded
Copy link
Contributor

@misscoded misscoded commented Jun 6, 2024

Summary

Final preparations and polish prior to cutting a stable release. 💅🏼

  • Makes inputs available by way of Context for interactivity events that are associated with a function's execution
  • Added three function-related props to the Context interface
  • Surface proper errors if the functionExecutionId somehow goes missing when using a utility
  • Incorporates base-branch (feat-functions) PR feedback (TS fixes)
  • TODO: TS fix for action payload

Requirements (place an x in each [ ])

@misscoded misscoded added the enhancement M-T: A feature request for new functionality label Jun 6, 2024
@codecov
Copy link

codecov bot commented Jun 8, 2024

Codecov Report

Attention: Patch coverage is 78.37838% with 8 lines in your changes missing coverage. Please review.

Project coverage is 81.58%. Comparing base (87730ef) to head (7ee465b).

Files Patch % Lines
src/App.ts 22.22% 6 Missing and 1 partial ⚠️
src/middleware/builtin.ts 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           feat-functions    #2128      +/-   ##
==================================================
+ Coverage           81.43%   81.58%   +0.15%     
==================================================
  Files                  19       19              
  Lines                1621     1640      +19     
  Branches              458      462       +4     
==================================================
+ Hits                 1320     1338      +18     
  Misses                194      194              
- Partials              107      108       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

LGTM! Nice to see the stronger typings here 🙏 Left a few comments around imports but nothing blocking IMO

} from './types';
import processMiddleware from './middleware/process';
import { CustomFunctionInitializationError } from './errors';
import { CustomFunctionCompleteFailError, CustomFunctionCompleteSuccessError, CustomFunctionInitializationError } from './errors';
Copy link
Member

Choose a reason for hiding this comment

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

We might want to just use the CustomFunctionInitializationError error here to not confuse initialization and runtime errors 🤔

if (type === IncomingEventType.Action && context.functionExecutionId !== undefined) {
listenerArgs.complete = CustomFunction.createFunctionComplete(context, client);
listenerArgs.fail = CustomFunction.createFunctionFail(context, client);
listenerArgs.inputs = context.functionInputs;
Copy link
Member

Choose a reason for hiding this comment

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

Just sharing as an option, free to ignore- all listener arguments could be created and assigned with Object.assign if we wanted to reduce the number of CustomFunction exports

import { Logger } from '@slack/logger';
import { StringIndexed } from './helpers';
import { SlackEventMiddlewareArgs } from './events';
import { FunctionInputs, SlackEventMiddlewareArgs } from './events';
Copy link
Member

Choose a reason for hiding this comment

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

Could these be imported from ./functions instead?

@filmaj filmaj marked this pull request as ready for review August 12, 2024 17:58
@filmaj filmaj merged commit bea900d into feat-functions Aug 12, 2024
@filmaj filmaj deleted the pre-stable-fixes branch August 12, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:signed enhancement M-T: A feature request for new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants