Skip to content

Commit be783fd

Browse files
gsteelXerkus
authored andcommitted
Purge all twitter functionality
- Removes the slack commands that dispatch tweets etc via slack - Removes the listener that tweets out GitHub releases - Removes the twitter webhook that reacts to tweets and posts them to a slack channel - Removes all configuration relating to twitter - Removes dependencies on laminas-twitter - Removes the twitter link in the layout - Removes twitter related documentation from the README Signed-off-by: George Steel <george@net-glue.co.uk>
1 parent e544778 commit be783fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+21
-3542
lines changed

.env.dist

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ SLACK_CHANNEL_GITHUB=github
99
SLACK_SIGNING_SECRET=
1010
SLACK_TOKEN=
1111
SLACK_WEBHOOK_LOGGING=
12-
TWEET_VERIFICATION_TOKEN=
13-
TWITTER_ACCESS_TOKEN=
14-
TWITTER_ACCESS_SECRET=
15-
TWITTER_CONSUMER_KEY=
16-
TWITTER_CONSUMER_SECRET=
1712
MASTODON_CLIENT_ID=
1813
MASTODON_CLIENT_SECRET=
1914
MASTODON_BEARER_TOKEN=
20-

README.md

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ The Laminas Bot acts as:
2929
- Report repository build status to the Laminas Slack #github channel.
3030
- Report releases to:
3131
- The Laminas Slack #github channel.
32-
- The [@getlaminas](https://twitter.com/getlaminas) twitter account.
3332
- The https://getlaminas API, to allow rebuilding the release RSS feed.
3433

3534
- A Discourse webhook handler:
@@ -41,18 +40,6 @@ The Laminas Bot acts as:
4140
given repository.
4241
- /regenerate-tsc-list triggers rebuilding the list of TSC members (the only
4342
ones authorized to initiate slash commands).
44-
- `/tweet [media:url] message` allows sending a tweet via the
45-
[@getlaminas](https://twitter.com/getlaminas) twitter account, optionally
46-
with media.
47-
- `/retweet {url}` allows retweeting a tweet as specified by `{url}` via the
48-
[@getlaminas](https://twitter.com/getlaminas) twitter account.
49-
- `/reply-to-tweet {url} {message}` allows replying to a tweet as specified by
50-
`{url}` via the [@getlaminas](https://twitter.com/getlaminas) twitter account.
51-
52-
- A webhook for incoming tweets. This webhook works in conjunction with a recipe
53-
on IFTTT that monitors tweets on the getlaminas account, and then passes them
54-
to our webhook. The webhook queues a job that sends the tweet details to a
55-
configured Slack channel.
5643

5744
### Requirements
5845

@@ -77,9 +64,6 @@ The Laminas Bot acts as:
7764
- /regenerate-tsc-list
7865
- /register-repo {repo}
7966
- /build-docs {repo}
80-
- /tweet [media:url] {message}
81-
- /retweet {url}
82-
- /reply-to-tweet {url} {message}
8367
- Setup an incoming webhook
8468
- Add location to SLACK_WEBHOOK_LOGGING
8569
- Invite the bot to #technical-steering-committee and #laminasbot-errors
@@ -93,15 +77,6 @@ The Laminas Bot acts as:
9377
- From Discourse
9478
- We need a signing secret; this can be arbitrary, but once used, must be used
9579
when registering ALL webhooks. Add to DISCOURSE_SECRET
96-
97-
- From Twitter
98-
- We need the access token and secret, and the consumer key and secret, as:
99-
- TWITTER_ACCESS_TOKEN
100-
- TWITTER_ACCESS_SECRET
101-
- TWITTER_CONSUMER_KEY
102-
- TWITTER_CONSUMER_SECRET
103-
- We need the shared token between IFTTT and the website for accepting tweets
104-
as TWEET_VERIFICATION_TOKEN.
10580

10681
- From Mastodon
10782
- We need access credentials from a created app as
@@ -116,7 +91,7 @@ The Laminas Bot acts as:
11691

11792
#### Handlers
11893

119-
There are four primary endpoints:
94+
There are three primary endpoints:
12095

12196
- `/api/discourse/[:channel]/:event` is an incoming webhook from Discourse. The
12297
`:channel` is the name of the Slack channel to notify, and the `:event`
@@ -136,12 +111,6 @@ There are four primary endpoints:
136111
implementation and dispatch. Individual implementations marshal appropriate
137112
events to dispatch via the event dispatcher.
138113

139-
- `/api/twitter/[:token]` is an incoming webhook from IFTTT. The `:token` is the
140-
shared token between the IFTTT and the webhook; if not identical, requests are
141-
rejected. They payload must contain the elements text, url, and timestamp, and
142-
is used to dispatch an `App\Twitter\Tweet` event before returning a 202
143-
response.
144-
145114
#### Events
146115

147116
The repository provides the following event types, with the listed handlers.
@@ -153,14 +122,10 @@ Event Type | Handler(s) | Action taken
153122
`App\GitHub\Event\GitHubIssue` | `App\GitHub\Listener\GitHubIssueListener` | Send a notification to Slack about issue creation or closure.
154123
`App\GitHub\Event\GitHubIssueComment` | `App\GitHub\Listener\GitHubIssueCommentListener` | Send a notification to Slack about comment creation on an issue or pull request.
155124
`App\GitHub\Event\GitHubPullRequest` | `App\GitHub\Listener\GitHubPullRequestListener` | Send a notification to Slack about pull request creation or closure.
156-
`App\GitHub\Event\GitHubRelease` | `App\GitHub\Listener\GitHubRelease\SlackListener`, `App\GitHub\Listener\GitHubReleaseTweetListener`, `App\GitHub\Listener\GitHubReleaseWebsiteUpdateListener` | Send a notification to Slack about release creation; tweet the release details; and notify the website of the release so it can update the release RSS feed.
125+
`App\GitHub\Event\GitHubRelease` | `App\GitHub\Listener\GitHubRelease\SlackListener`, `App\GitHub\Listener\GitHubReleaseWebsiteUpdateListener` | Send a notification to Slack about release creation and notify the website of the release so it can update the release RSS feed.
157126
`App\GitHub\Event\GitHubStatus` | `App\GitHub\Listener\GitHubStatusListener` | Send a notification to Slack about a build failure, error, or success.
158127
`App\GitHub\Event\RegisterWebhook` | `App\GitHub\Listener\RegisterWebhookListener` | Use the GitHub API to register the Laminas-BOT webhook with the given repository.
159128
`App\Slack\Event\RegenerateAuthorizedUserList` | `App\Slack\Listener\RegenerateAuthorizedUserListListener` | Use the Slack Web API to rebuild the list of authorized slash command users from the current #technical-steering-committee list.
160-
`App\Slack\Event\Retweet` | `App\Slack\Listener\RetweetListener` | Use the Twitter API to retweet a given tweet.
161-
`App\Slack\Event\Tweet` | `App\Slack\Listener\TweetListener` | Use the Twitter API to send a tweet.
162-
`App\Slack\Event\TwitterReply` | `App\Slack\Listener\TwitterReplyListener` | Use the Twitter API to send a message in reply to another tweet.
163-
`App\Twitter\Tweet` | `App\Twitter\TweetListener` | Send a Slack message to a configured channel with details on a single tweet.
164129

165130
All listeners are decorated using the `DeferredServiceListenerDelegator` class
166131
from the phly/phly-swoole-taskworker package. This means that they will be
@@ -236,6 +201,3 @@ All of these objects support:
236201
technical steering committee members. If not, an error message is returned to
237202
the user immediately. The list is generated on application initialization, and
238203
again on receipt of a /regenerate-tsc-list command.
239-
240-
- A shared secret is configured between IFTTT and the Twitter webhook, and we
241-
also verify the payload structure.

composer.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"ext-hash": "*",
1919
"ext-json": "*",
2020
"ext-openswoole": "*",
21-
"beberlei/assert": "^2.9.9 || ^3.0.0",
21+
"beberlei/assert": "^2.9.9 || ^3.3.2",
2222
"colorfield/mastodon-api": "^0.1.5",
23-
"guzzlehttp/guzzle": "^6.3 || ^7.0",
23+
"guzzlehttp/guzzle": "^6.3 || ^7.8",
2424
"laminas/laminas-cli": "^1.9.0",
2525
"laminas/laminas-component-installer": "^3.4.0",
2626
"laminas/laminas-config-aggregator": "^1.14.0",
@@ -30,7 +30,6 @@
3030
"laminas/laminas-servicemanager": "^3.22.1",
3131
"laminas/laminas-stdlib": "^3.18.0",
3232
"laminas/laminas-stratigility": "^3.11.0",
33-
"laminas/laminas-twitter": "^3.7.0",
3433
"league/commonmark": "^2.4.1",
3534
"mezzio/mezzio": "^3.18.0",
3635
"mezzio/mezzio-fastroute": "^3.11.0",
@@ -52,14 +51,14 @@
5251
"psr/log": "^1.1 || ^2.0 || ^3.0"
5352
},
5453
"require-dev": {
55-
"filp/whoops": "^2.14.5",
54+
"filp/whoops": "^2.15.3",
5655
"laminas/laminas-coding-standard": "~2.5.0",
57-
"laminas/laminas-development-mode": "^3.1",
58-
"mezzio/mezzio-tooling": "^2.5",
59-
"phpspec/prophecy-phpunit": "^2.0.1",
60-
"phpunit/phpunit": "^9.5.26",
56+
"laminas/laminas-development-mode": "^3.11",
57+
"mezzio/mezzio-tooling": "^2.8",
58+
"phpspec/prophecy-phpunit": "^2.0.2",
59+
"phpunit/phpunit": "^9.6.13",
6160
"roave/security-advisories": "dev-master",
62-
"squizlabs/php_codesniffer": "^3.7.1"
61+
"squizlabs/php_codesniffer": "^3.7.2"
6362
},
6463
"config": {
6564
"discard-changes": true,

0 commit comments

Comments
 (0)