Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Remove Retweeter feature (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
alysivji authored Sep 22, 2020
1 parent 837fe43 commit 621c92e
Show file tree
Hide file tree
Showing 34 changed files with 52 additions and 1,202 deletions.
5 changes: 0 additions & 5 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ GITHUB_APP_CLIENT_ID=
GITHUB_APP_CLIENT_SECRET=
GITHUB_SIGNING_SECRET=

TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_ACCESS_TOKEN_SECRET=

YOUTUBE_API_KEY=

MEETUP_API_KEY=
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ Busy Beaver posts daily summaries of public GitHub activity for registered users

Users sign up for an account by `DM`ing the bot with the phrase: `connect`. The bot requires users to sign into GitHub to ensure only authorized activity is posted in the channel.

### Retweeter

Busy Beaver retweets posts made to the [@ChicagoPython Twitter account](https://twitter.com/ChicagoPython) in the `#at-chicagopython` channel on the [ChiPy Slack](https://chipy.slack.com/).

### Roadmap

We are currently working on additional features to improve ChiPy community engagement. Please join the conversation in `#busy-beaver-meta` on the [ChiPy Slack](https://chipy.slack.com/).
Expand Down
10 changes: 1 addition & 9 deletions busy_beaver/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@
from secure import SecureHeaders
from whitenoise import WhiteNoise

from .blueprints import (
events_bp,
github_bp,
healthcheck_bp,
slack_bp,
twitter_bp,
web_bp,
)
from .blueprints import events_bp, github_bp, healthcheck_bp, slack_bp, web_bp
from .common.oauth import OAuthError
from .config import DATABASE_URI, REDIS_URI, SECRET_KEY
from .exceptions import NotAuthorized, StateMachineError, ValidationError
Expand Down Expand Up @@ -55,7 +48,6 @@ def create_app(*, testing=False):
app.register_blueprint(healthcheck_bp)
app.register_blueprint(github_bp, url_prefix="/github", cli_group=None)
app.register_blueprint(slack_bp, url_prefix="/slack")
app.register_blueprint(twitter_bp, cli_group=None)
app.register_blueprint(web_bp)

app.wsgi_app = WhiteNoise(
Expand Down
1 change: 0 additions & 1 deletion busy_beaver/apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ Flask code is in `api` subfolders.
|debug|Tools to help development and debug|
|events|Find and post upcoming events|
|github_integration|GitHub related-integration logic|
|retweeter|Shares tweets by a given Twitter account in Slack|
|slack_integration|Slack-related integration logic|
|youtube_integration|YouTube related-itnegration logic (WIP)|
4 changes: 0 additions & 4 deletions busy_beaver/apps/retweeter/README.md

This file was deleted.

Empty file.
5 changes: 0 additions & 5 deletions busy_beaver/apps/retweeter/blueprint.py

This file was deleted.

19 changes: 0 additions & 19 deletions busy_beaver/apps/retweeter/cli.py

This file was deleted.

46 changes: 0 additions & 46 deletions busy_beaver/apps/retweeter/workflow.py

This file was deleted.

3 changes: 0 additions & 3 deletions busy_beaver/apps/slack_integration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ def __repr__(self): # pragma: no cover
uselist=False,
lazy="joined",
)
key_value_pairs = db.relationship(
"KeyValueStore", back_populates="slack_installation"
)


class SlackUser(UserMixin, BaseModel):
Expand Down
1 change: 0 additions & 1 deletion busy_beaver/blueprints.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from busy_beaver.apps.debug.api.healthcheck import healthcheck_bp # noqa
from busy_beaver.apps.github_integration.blueprint import github_bp # noqa
from busy_beaver.apps.retweeter.blueprint import twitter_bp # noqa
from busy_beaver.apps.slack_integration.api import slack_bp # noqa
from busy_beaver.apps.upcoming_events.blueprint import events_bp # noqa
from busy_beaver.apps.web.blueprint import web_bp # noqa
18 changes: 1 addition & 17 deletions busy_beaver/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
integration.
"""

from .common.wrappers import (
GitHubClient,
MeetupClient,
S3Client,
SlackClient,
TwitterClient,
)
from .common.wrappers import GitHubClient, MeetupClient, S3Client, SlackClient
from .config import (
DIGITALOCEAN_SPACES_KEY,
DIGITALOCEAN_SPACES_SECRET,
Expand All @@ -25,10 +19,6 @@
SLACK_CLIENT_ID,
SLACK_CLIENT_SECRET,
SLACK_TOKEN,
TWITTER_ACCESS_TOKEN,
TWITTER_ACCESS_TOKEN_SECRET,
TWITTER_CONSUMER_KEY,
TWITTER_CONSUMER_SECRET,
)
from busy_beaver.apps.github_integration.oauth.oauth_flow import GitHubOAuthFlow
from busy_beaver.apps.slack_integration.oauth.oauth_flow import (
Expand All @@ -39,12 +29,6 @@
chipy_slack = SlackClient(SLACK_TOKEN) # Default Workspace -- this is being phased out
github = GitHubClient(GITHUB_OAUTH_TOKEN)
meetup = MeetupClient(MEETUP_API_KEY)
twitter = TwitterClient(
TWITTER_CONSUMER_KEY,
TWITTER_CONSUMER_SECRET,
TWITTER_ACCESS_TOKEN,
TWITTER_ACCESS_TOKEN_SECRET,
)

slack_install_oauth = SlackInstallationOAuthFlow(SLACK_CLIENT_ID, SLACK_CLIENT_SECRET)
slack_signin_oauth = SlackSignInOAuthFlow(SLACK_CLIENT_ID, SLACK_CLIENT_SECRET)
Expand Down
26 changes: 0 additions & 26 deletions busy_beaver/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,6 @@ def patch(self, data: dict):
setattr(self, key, value)


class KeyValueStore(BaseModel):
"""Key Value store by slack workspace id
Keeps track of required values for each workspace"""

__tablename__ = "key_value_store"

def __repr__(self): # pragma: no cover
workspace_name = self.slack_installation.workspace_name
return f"<KeyValueStore: {workspace_name} {self.key} {self.value}>"

# Attributes
installation_id = db.Column(
db.Integer,
db.ForeignKey("slack_installation.id", name="fk_installation_id"),
nullable=False,
)
key = db.Column(db.String(255), nullable=False, unique=True)
value = db.Column(db.LargeBinary(), nullable=False)

# Relationships
slack_installation = db.relationship(
"SlackInstallation", back_populates="key_value_pairs"
)


class Task(BaseModel):
"""Task Base Table"""

Expand Down
2 changes: 0 additions & 2 deletions busy_beaver/common/wrappers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from .aws_s3 import S3Client # noqa
from .github import GitHubClient # noqa
from .key_value_store import KeyValueStoreClient # noqa
from .meetup import MeetupClient # noqa
from .requests_client import RequestsClient # noqa
from .slack import SlackClient # noqa
from .twitter import TwitterClient # noqa
from .youtube import YouTubeClient # noqa
40 changes: 0 additions & 40 deletions busy_beaver/common/wrappers/key_value_store.py

This file was deleted.

31 changes: 0 additions & 31 deletions busy_beaver/common/wrappers/twitter.py

This file was deleted.

6 changes: 0 additions & 6 deletions busy_beaver/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
REDIS_URI = os.getenv("REDIS_URI")

# social media details
TWITTER_USERNAME = "ChicagoPython"
YOUTUBE_CHANNEL = "UCT372EAC1orBOSUd2fsA8WA"

SLACK_CLIENT_ID = os.getenv("SLACK_CLIENT_ID", None)
Expand All @@ -29,11 +28,6 @@

MEETUP_API_KEY = os.getenv("MEETUP_API_KEY", "abcdef")

TWITTER_CONSUMER_KEY = os.getenv("TWITTER_CONSUMER_KEY", None)
TWITTER_CONSUMER_SECRET = os.getenv("TWITTER_CONSUMER_SECRET", None)
TWITTER_ACCESS_TOKEN = os.getenv("TWITTER_ACCESS_TOKEN", None)
TWITTER_ACCESS_TOKEN_SECRET = os.getenv("TWITTER_ACCESS_TOKEN_SECRET", None)

YOUTUBE_API_KEY = os.getenv("YOUTUBE_API_KEY", None)

DIGITALOCEAN_SPACES_KEY = os.getenv("DIGITALOCEAN_SPACES_KEY", None)
Expand Down
2 changes: 1 addition & 1 deletion busy_beaver/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from busy_beaver.common.models import BaseModel, KeyValueStore, Task # noqa isort:skip
from busy_beaver.common.models import BaseModel, Task # noqa isort:skip

from busy_beaver.apps.github_integration.models import ( # noqa
GitHubSummaryConfiguration,
Expand Down
7 changes: 0 additions & 7 deletions docs/deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Material related to deploying Busy Beaver.
- [Deployment Notes](#deployment-notes)
- [Integration Notes](#integration-notes)
- [GitHub](#github)
- [Twitter](#twitter)
- [Meetup](#meetup)
- [Sentry](#sentry)

Expand Down Expand Up @@ -53,12 +52,6 @@ For both staging and production apps in the `busy-beaver-dev` organization

- [ ] update the callback URL

### Twitter

For both staging and production app

- [ ] fetch application credentials and make into environment variables

### Meetup

Currently using an API token generated
Expand Down
35 changes: 4 additions & 31 deletions docs/deployment/digitalocean_deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ Details about infrastructure set up on DigitalOcean.
- [Prerequestites](#prerequestites)
- [Setting up Staging Environment](#setting-up-staging-environment)
- [Setting up Production Environment](#setting-up-production-environment)
- [Deploying App](#deploying-app)
- [Secrets Format](#secrets-format)
- [Secrets](#secrets)

<!-- /TOC -->

Expand Down Expand Up @@ -42,32 +41,6 @@ helm install busybeaver-production ./busybeaver/ -f values/production.yaml
helm upgrade busybeaver-production ./busybeaver/ -f values/production.yaml --set image.version=[version]
```

### Secrets Format

All data values need to be `base64` encoded.

```yaml
apiVersion: v1
kind: Secret
metadata:
name: busybeaver-[staging|production]
type: Opaque
data:
db-uri:
cache-uri:
sentry-dsn:
secret-key:
slack-client-id:
slack-client-secret:
slack-botuser-oauth-token:
slack-signing-secret:
meetup-api-key:
github-client-id:
github-client-secret:
github-oauth-token:
github-signing-secret:
twitter-access-token-secret:
twitter-access-token:
twitter-consumer-key:
twitter-consumer-secret:
```
### Secrets

Secrets are loaded from AWS Secrets Manager into Kuberenetes using Terraform.
Loading

0 comments on commit 621c92e

Please sign in to comment.