hubot 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/stale.yml +1 -1
- package/.github/workflows/nodejs-macos.yml +1 -1
- package/.github/workflows/nodejs-ubuntu.yml +2 -2
- package/.github/workflows/nodejs-windows.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/CONTRIBUTING.md +2 -2
- package/bin/hubot.js +1 -1
- package/docs/deploying/azure.md +1 -1
- package/docs/deploying/heroku.md +2 -2
- package/docs/deploying/unix.md +1 -1
- package/docs/deploying/windows.md +1 -1
- package/docs/scripting.md +1 -1
- package/package.json +2 -2
- package/script/release +4 -4
- package/src/adapters/shell.js +5 -0
- package/src/robot.js +1 -1
- package/test/robot_test.js +17 -0
package/.github/stale.yml
CHANGED
|
@@ -13,7 +13,7 @@ staleLabel: stale
|
|
|
13
13
|
# Comment to post when marking as stale. Set to `false` to disable
|
|
14
14
|
markComment: >
|
|
15
15
|
This issue has been automatically marked as stale because it has [not had
|
|
16
|
-
recent activity](https://github.com/github/hubot/blob/
|
|
16
|
+
recent activity](https://github.com/github/hubot/blob/main/CONTRIBUTING.md#stale-issue-and-pull-request-policy).
|
|
17
17
|
It will be closed if no further activity occurs. Thank you for your contributions.
|
|
18
18
|
# Comment to post when removing the stale label. Set to `false` to disable
|
|
19
19
|
unmarkComment: false
|
package/CONTRIBUTING.md
CHANGED
|
@@ -9,7 +9,7 @@ No matter how you want to get involved, we ask that you first learn what’s exp
|
|
|
9
9
|
We love pull requests. Here's a quick guide:
|
|
10
10
|
|
|
11
11
|
1. If you're adding a new feature or changing user-facing APIs, check out the [Hubot Evolution](https://github.com/hubotio/evolution) process.
|
|
12
|
-
1. Check for [existing issues](https://github.com/github/hubot/issues) for duplicates and confirm that it hasn't been fixed already in the [
|
|
12
|
+
1. Check for [existing issues](https://github.com/github/hubot/issues) for duplicates and confirm that it hasn't been fixed already in the [main branch](https://github.com/github/hubot/commits/main)
|
|
13
13
|
1. Fork the repo, and clone it locally
|
|
14
14
|
1. `npm link` to make your cloned repo available to npm
|
|
15
15
|
1. Follow [Getting Started](docs/index.md) to generate a testbot
|
|
@@ -55,7 +55,7 @@ The goal of this process is to keep the list of open issues and pull requests fo
|
|
|
55
55
|
|
|
56
56
|
# Pull Request Reviews & releasing
|
|
57
57
|
|
|
58
|
-
Releasing `hubot` is fully automated using [semantic-release](https://github.com/semantic-release/semantic-release). Once merged into the `
|
|
58
|
+
Releasing `hubot` is fully automated using [semantic-release](https://github.com/semantic-release/semantic-release). Once merged into the `main` branch, `semantic-release` will automatically release a new version based on the commit messages of the pull request. For it to work correctly, make sure that the correct commit message conventions have been used. The ones relevant are
|
|
59
59
|
|
|
60
60
|
* `fix: …` will bump the fix version, e.g. 1.2.3 → 1.2.4
|
|
61
61
|
* `feat: …` will bump the feature version, e.g. 1.2.3 → 1.3.0
|
package/bin/hubot.js
CHANGED
|
@@ -91,7 +91,7 @@ if (options.create) {
|
|
|
91
91
|
console.error(` mkdir -p ${options.path}`)
|
|
92
92
|
console.error(` cd ${options.path}`)
|
|
93
93
|
console.error(' yo hubot')
|
|
94
|
-
console.error('See https://github.com/github/hubot/blob/
|
|
94
|
+
console.error('See https://github.com/github/hubot/blob/main/docs/index.md for more details on getting started.')
|
|
95
95
|
process.exit(1)
|
|
96
96
|
}
|
|
97
97
|
if (options.file) {
|
package/docs/deploying/azure.md
CHANGED
|
@@ -20,7 +20,7 @@ Inside your new hubot directory, make sure you've created a git repository, and
|
|
|
20
20
|
Then [create a GitHub repository](https://help.github.com/articles/create-a-repo/) for your hubot. This is where Azure will pull your code from instead of needing to deploy directly from your dev machine to Azure.
|
|
21
21
|
|
|
22
22
|
% git remote add origin _your GitHub repo_
|
|
23
|
-
% git push -u origin
|
|
23
|
+
% git push -u origin main
|
|
24
24
|
|
|
25
25
|
Once you have your GitHub repo, create an Azure website linked to your repo. In Azure, create a website and select integrated source control. When it asks "where is your source control" select GitHub and link this website to your git repo that you created in the previous step. If you have downloaded the Azure PowerShell modules, you can also do this via PowerShell.
|
|
26
26
|
|
package/docs/deploying/heroku.md
CHANGED
|
@@ -43,7 +43,7 @@ scripts, you'd need to set the following environment variables:
|
|
|
43
43
|
At this point, you are ready to deploy and start chatting. With Heroku, that's a
|
|
44
44
|
git push away:
|
|
45
45
|
|
|
46
|
-
% git push heroku
|
|
46
|
+
% git push heroku main
|
|
47
47
|
|
|
48
48
|
You'll see some text flying, and eventually some success. You should be able to
|
|
49
49
|
see your bot in your configured chat rooms at this point. If not, you can peek
|
|
@@ -55,7 +55,7 @@ If you make any changes to your hubot, just commit and push them as
|
|
|
55
55
|
before:
|
|
56
56
|
|
|
57
57
|
% git commit -am "Awesome scripts OMG"
|
|
58
|
-
% git push heroku
|
|
58
|
+
% git push heroku main
|
|
59
59
|
|
|
60
60
|
Some scripts needs Redis to work, Heroku offers an addon called [Redis Cloud](https://addons.heroku.com/rediscloud), which has a free plan. To use it:
|
|
61
61
|
|
package/docs/deploying/unix.md
CHANGED
|
@@ -60,7 +60,7 @@ really, you probably want some process monitoring using tools like
|
|
|
60
60
|
|
|
61
61
|
For starting at boot, you can create an init script appropriate for your UNIX
|
|
62
62
|
distribution. If you are using one of the process monitoring tools above, make
|
|
63
|
-
sure it boots at startup. See the [examples](https://github.com/github/hubot/tree/
|
|
63
|
+
sure it boots at startup. See the [examples](https://github.com/github/hubot/tree/main/examples)
|
|
64
64
|
for configuration examples.
|
|
65
65
|
|
|
66
66
|
## Recommendations
|
|
@@ -63,4 +63,4 @@ You can set this .ps1 as scheduled task on boot if you like or some other way to
|
|
|
63
63
|
|
|
64
64
|
## Expanding the documentation
|
|
65
65
|
|
|
66
|
-
Not yet fleshed out. [Help contribute by submitting a pull request, please?](https://github.com/github/hubot/pull/new/
|
|
66
|
+
Not yet fleshed out. [Help contribute by submitting a pull request, please?](https://github.com/github/hubot/pull/new/main)
|
package/docs/scripting.md
CHANGED
|
@@ -818,7 +818,7 @@ Listener middleware inserts logic between the listener matching a message and th
|
|
|
818
818
|
|
|
819
819
|
## Listener Middleware Examples
|
|
820
820
|
|
|
821
|
-
A fully functioning example can be found in [hubot-rate-limit](https://github.com/michaelansel/hubot-rate-limit/blob/
|
|
821
|
+
A fully functioning example can be found in [hubot-rate-limit](https://github.com/michaelansel/hubot-rate-limit/blob/main/src/rate-limit.coffee).
|
|
822
822
|
|
|
823
823
|
A simple example of middleware logging command executions:
|
|
824
824
|
|
package/package.json
CHANGED
package/script/release
CHANGED
|
@@ -11,10 +11,10 @@ cd $(dirname "$0")/..
|
|
|
11
11
|
|
|
12
12
|
npm update && script/smoke-test
|
|
13
13
|
|
|
14
|
-
# Make sure we're on the
|
|
14
|
+
# Make sure we're on the main branch.
|
|
15
15
|
|
|
16
|
-
(git branch | grep -q '*
|
|
17
|
-
echo "Only release from the
|
|
16
|
+
(git branch | grep -q '* main') || {
|
|
17
|
+
echo "Only release from the main branch."
|
|
18
18
|
exit 1
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -41,4 +41,4 @@ git fetch -t origin
|
|
|
41
41
|
# Tag it and bag it.
|
|
42
42
|
|
|
43
43
|
npm publish && git tag "$tag" &&
|
|
44
|
-
git push origin
|
|
44
|
+
git push origin main --tags
|
package/src/adapters/shell.js
CHANGED
|
@@ -17,6 +17,11 @@ const historyPath = '.hubot_history'
|
|
|
17
17
|
const bold = str => `\x1b[1m${str}\x1b[22m`
|
|
18
18
|
|
|
19
19
|
class Shell extends Adapter {
|
|
20
|
+
constructor (robot) {
|
|
21
|
+
super(robot)
|
|
22
|
+
this.name = 'Shell'
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
send (envelope/* , ...strings */) {
|
|
21
26
|
const strings = [].slice.call(arguments, 1)
|
|
22
27
|
|
package/src/robot.js
CHANGED
package/test/robot_test.js
CHANGED
|
@@ -1083,6 +1083,23 @@ describe('Robot', function () {
|
|
|
1083
1083
|
})
|
|
1084
1084
|
})
|
|
1085
1085
|
|
|
1086
|
+
describe('Robot Defaults', () => {
|
|
1087
|
+
let robot = null
|
|
1088
|
+
beforeEach(async () => {
|
|
1089
|
+
process.env.EXPRESS_PORT = 0
|
|
1090
|
+
robot = new Robot(null, true, 'TestHubot')
|
|
1091
|
+
robot.alias = 'Hubot'
|
|
1092
|
+
await robot.loadAdapter()
|
|
1093
|
+
robot.run()
|
|
1094
|
+
})
|
|
1095
|
+
afterEach(() => {
|
|
1096
|
+
robot.shutdown()
|
|
1097
|
+
})
|
|
1098
|
+
it('should load the builtin shell adapter by default', async () => {
|
|
1099
|
+
expect(robot.adapter.name).to.equal('Shell')
|
|
1100
|
+
})
|
|
1101
|
+
})
|
|
1102
|
+
|
|
1086
1103
|
describe('Robot ES6', () => {
|
|
1087
1104
|
let robot = null
|
|
1088
1105
|
beforeEach(async () => {
|