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

Fix #1376 CustomRoute interface should be accessible from developers #1393

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

seratch
Copy link
Member

@seratch seratch commented Mar 26, 2022

Summary

This pull request resolves #1376 by exporting the two types and one method from ./receivers/custom-routes.

Requirements (place an x in each [ ])

@seratch seratch added the enhancement M-T: A feature request for new functionality label Mar 26, 2022
@seratch seratch added this to the 3.11.0 milestone Mar 26, 2022
@seratch seratch requested review from filmaj and srajiang March 26, 2022 05:34
@seratch seratch self-assigned this Mar 26, 2022
@codecov
Copy link

codecov bot commented Mar 26, 2022

Codecov Report

Merging #1393 (cef181e) into main (be526eb) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1393   +/-   ##
=======================================
  Coverage   77.12%   77.12%           
=======================================
  Files          17       17           
  Lines        1460     1460           
  Branches      432      432           
=======================================
  Hits         1126     1126           
  Misses        236      236           
  Partials       98       98           
Impacted Files Coverage Δ
src/receivers/HTTPReceiver.ts 59.76% <100.00%> (ø)
src/receivers/SocketModeReceiver.ts 87.64% <100.00%> (ø)
src/receivers/custom-routes.ts 94.44% <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 be526eb...cef181e. Read the comment docs.

@@ -13,7 +13,7 @@ export interface ReceiverRoutes {
};
}

export function prepareRoutes(customRoutes: CustomRoute[]): ReceiverRoutes {
export function buildReceiverRoutes(customRoutes: CustomRoute[]): ReceiverRoutes {
Copy link
Member Author

Choose a reason for hiding this comment

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

Either is fine but, to me, the name build indicates the nuance that this method does not side effects much more.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have always had a problem with using prepare to describe functionality. Unless one is familiar with the algorithm already, it is not descriptive to an outsider!

I am OK with buildReceiverRoutes. I also think attachReceiverRoutes or bindReceiverRoutes would be acceptable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestions. I think that we can go with "build" for this

export {
CustomRoute,
ReceiverRoutes,
buildReceiverRoutes,
Copy link
Member Author

Choose a reason for hiding this comment

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

For developers that create their own receivers, exposing not only the types but also the builder method would be helpful.

Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

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

:shipit: !

@@ -13,7 +13,7 @@ export interface ReceiverRoutes {
};
}

export function prepareRoutes(customRoutes: CustomRoute[]): ReceiverRoutes {
export function buildReceiverRoutes(customRoutes: CustomRoute[]): ReceiverRoutes {
Copy link
Contributor

Choose a reason for hiding this comment

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

I have always had a problem with using prepare to describe functionality. Unless one is familiar with the algorithm already, it is not descriptive to an outsider!

I am OK with buildReceiverRoutes. I also think attachReceiverRoutes or bindReceiverRoutes would be acceptable.

@seratch seratch merged commit 5e19ee1 into slackapi:main Mar 28, 2022
@seratch seratch deleted the issue-1376-custom-routes-type branch March 28, 2022 18:34
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CustomRoute interface should be accessible from developers
2 participants