-
Notifications
You must be signed in to change notification settings - Fork 399
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
ci: test samples and examples with a packaged bolt build #2372
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2372 +/- ##
=======================================
Coverage 92.59% 92.59%
=======================================
Files 36 36
Lines 7472 7472
Branches 653 653
=======================================
Hits 6919 6919
Misses 545 545
Partials 8 8 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Leaving a few notes from findings during the most recent adventures. I'm so open to thoughts and changing the goal of this PR.
IMO testing samples with npm pack
might be nice to split into a separate change, but I'm rambling now...
- name: Package the latest changes to bolt-js | ||
run: npm i && npm pack . && rm -rf node_modules | ||
- name: Install example dependencies for testing | ||
working-directory: ${{ matrix.example }} | ||
run: npm i && npm link @slack/bolt | ||
run: npm i && npm i ../../slack-bolt-*.tgz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some TILs are included here, though I believe this can still be improved:
npm pack
will package@slack/bolt
as if it's going to be releasednode_modules
of the bolt-js repo must be removed or nested directories can make use of these pacakges
The *.tgz
file seems ideal for testing in a production environment like this since it lets us build bolt-js then remove its node_modules
before testing a sample!
I'm not thrilled with the relative paths here, but am interested in if this is an approach we're alright taking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating examples
continues to be an upcoming task, but I found this app to be helpful for testing the current edges.
FWIW I'm interested in knowing if we want to include jsdoc
as part of examples for typechecking like this or not? That can of course be for a follow up, but I think it might be neat 🔍
/** | ||
* @type {import("@slack/bolt/dist/receivers/ParamsIncomingMessage").ParamsIncomingMessage}; | ||
*/ | ||
const _example = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I think ParamsIncomingMessage
should be exported at the top-level of @slack/bolt
since it describes the "req" parameter of receivers, but that's unchanged in this PR.
However I'm super curious to know if exporting it from the top-level would fix the current typescript
error here 🤔
Summary
This PR explores broken builds due to missing
@types/express
from the most recent release 👀Preview
npm pack
without removingnode_modules
npm pack
and removingnode_modules
Notes
@types/express
back intodependencies
seems like a fix to the above errors, but this was difficult to confirm with local setups. Hoping to improve our CI testing and return@types/express
in perhaps another PR to prevent this regression in future changes 😓Requirements