Skip to content

Comments

docs(examples): fix the "deploy to heroku" button using latest dependencies#2385

Merged
zimeg merged 19 commits intoslackapi:mainfrom
zimeg:main
Jan 9, 2025
Merged

docs(examples): fix the "deploy to heroku" button using latest dependencies#2385
zimeg merged 19 commits intoslackapi:mainfrom
zimeg:main

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Jan 8, 2025

Summary

This PR checks out the heroku example of a Bolt JS app and smoothes edges found when testing!

Reviewers

These changes are available on this forked branch: zimeg/bolt-js/tree/main/examples/deploy-heroku

The "Deploy to Heroku" button at the end links to slackapi/bolt-js - the following link can be used to test these changes: https://dashboard.heroku.com/new?template=https://github.com/zimeg/bolt-js

The included manifest can be used to create a Slack app for the bot token and signing secret 🔒

Requirements

@zimeg zimeg added the area:examples issues related to example or sample code label Jan 8, 2025
@zimeg zimeg added this to the 4.x milestone Jan 8, 2025
@zimeg zimeg self-assigned this Jan 8, 2025
Copy link
Member Author

@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.

📝 Notes for the kind reviewers!


### 6. Bonus: Deploy to Heroku with one click

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/slackapi/bolt-js)
Copy link
Member Author

Choose a reason for hiding this comment

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

I think having this button in a subdirectory is causing strange redirects. It's replaced with the redirected result here, which I find to be working well 🙏

https://devcenter.heroku.com/articles/heroku-button#adding-the-heroku-button

Copy link
Contributor

Choose a reason for hiding this comment

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

This link worked for me 💯

Copy link
Member Author

Choose a reason for hiding this comment

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

await app.start(process.env.PORT || 3000);

console.log('⚡️ Bolt app is running!');
app.logger.info('⚡️ Bolt app is running!');
Copy link
Member Author

Choose a reason for hiding this comment

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

🔍 From the logs!

2025-01-08T18:18:40.258427+00:00 heroku[web.1]: Starting process with command `node app.js`
2025-01-08T18:18:40.933034+00:00 app[web.1]: [INFO]  bolt-app ⚡️ Bolt app is running!
2025-01-08T18:18:41.379963+00:00 heroku[web.1]: State changed from starting to up

"web": {
"quantity": 1,
"size": "free"
"size": "eco"
Copy link
Member Author

Choose a reason for hiding this comment

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

The free tier is no longer an option and caused errors on setup - https://www.heroku.com/pricing

"features": {
"bot_user": {
"display_name": "Bolt on Heroku Example",
"always_online": true
Copy link
Member Author

Choose a reason for hiding this comment

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

Related to the eco dyno that can sleep - I think it's alright to suppose the bot is always online. It just might be slow to response 🤔

@codecov
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.59%. Comparing base (44cde97) to head (660dc18).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2385   +/-   ##
=======================================
  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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

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

Nice job these changes look good 💯
I did not test the deployment first hand, but trust you have!


### 6. Bonus: Deploy to Heroku with one click

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/slackapi/bolt-js)
Copy link
Contributor

Choose a reason for hiding this comment

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

This link worked for me 💯

@zimeg
Copy link
Member Author

zimeg commented Jan 9, 2025

@WilliamBergamin 🙏 Thanks for reviewing!

I've tested this a few times and am feeling confident with the setup for now, but will confirm things are working after merging 🚢 💨

@zimeg zimeg merged commit 2d26011 into slackapi:main Jan 9, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:examples issues related to example or sample code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants