Coder Social home page Coder Social logo

ubclaunchpad / rocket2 Goto Github PK

View Code? Open in Web Editor NEW
18.0 37.0 6.0 11.64 MB

πŸš€ The official UBC Launch Pad Slack bot and team management platform

Home Page: https://rocket2.readthedocs.io

License: Other

Python 98.95% Dockerfile 0.11% Makefile 0.22% Shell 0.72%
dynamodb slack slack-bot team-management ubc github self-hosted python

rocket2's Introduction

Rocket 2

Rocket 2 is the official UBC Launch Pad Slack bot and team management platform.

Rocket 2 is a from-the-ground-up rewrite of the original Rocket, and it is a Slack bot that aims to be a ChatOps-style tool for team management across platforms like GitHub and Google Drive, with extensive configuration options so that it can be used by other organizations as well. Rocket 2 is used, built, and maintained with ❀️ by UBC Launch Pad, UBC's student-run software engineering club.

Main features
πŸ’¬ Unix-style command system in Slack - invoke commands with a simple /rocket in Slack
πŸ”— Platform integrations - easily configure GitHub organization invites and teams, Google Drive permissions, and more
πŸ—‚ Team directory - provide and manage member information such as emails and other accounts
πŸ”’ Permissions system - control access to Rocket functionality with a tiered set of permissions
πŸ”¨ Hackable and extensible - an open codebase makes it easy to add commands, scheduled modules, and more!

πŸ“¦ Usage

Check out our command reference pages to get started interacting with Rocket, or take a look at how Rocket is used at UBC Launch Pad in the Launch Pad handbook.

To set up a Rocket instance for your organization, refer to the deployment and configuration documentation.

πŸ“š Contributing

Any contribution (pull requests, feedback, bug reports, ideas, etc.) is welcome!

Please refer to our contribution guide for contribution guidelines as well as detailed guides to help you get started with Rocket 2's codebase.

rocket2's People

Contributors

bobheadxi avatar chuck-sys avatar coffeetableespresso avatar dependabot[bot] avatar jacqueschen1 avatar joy8zhang avatar manav2511 avatar michaelenglo avatar michaelfu1029 avatar no-or avatar omar2535 avatar phillytan avatar ravencondol avatar rmcreyes avatar rwblickhan avatar vyzw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rocket2's Issues

Implement slack events adapter

Use the slack events adapter from the slackeventsapi to call the app mention handler in core.py when listening to the appropriate event.

Create permissions model

In model/permissions.py, create a permissions model - this might be a Permissions class but might also be something else. We should have at least three permissions levels:

  • Admin
  • Team lead
  • Member

Create Slack client

In bot/bot.py (or a similar file) create a new Slack client per the Python Slack library. In particular it should connect to the Slack bot created in #1 - for now this can be hardcoded but eventually we will want it to be configurable.

Create pre-commit hook

Travis is protecting our main branches but it’s not officially documented what our build is doing, nor is it very convenient to run all those commands locally. So, we should add a build script to run all those commands and have contributors add this as a pre-commit hook, so that we don’t have to run a Travis build to find linting errors.

Handling errors at the core level

Currently core.py returns 0, 1, or -1 depending on whether or not a command follows a valid format, the command is successful, or the command results in an error. This should be changed so that error handling is done rather than returning a value that indicates an error took place.

Auto-deploy python documentation

Would be nice if we had documentation automatically deployed onto Read the Docs. More specifically, the API docs on database, commands, and maybe a short little tutorial on how everything works together, and how to build a plugin.

Might need some way to access through ubclaunchpad (since this repo is under the organization).

Implement concurrent request handling

The Slack Python SDK may not concurrently handle events. If that's the case, we'll want to make some of our own request handling (e.g. the event handler from #29) concurrent, probably using the asyncio standard library module.

Team storing isn't validated

It doesn't give any feedback on if the team is stored correctly or not. It should return true if the team is stored successfully, and false if it isn't.

tiered permission model

The current Rocket only has admins and everyone else - it's probably more flexible to have an additional lead position that has permissions like team and repo creation. Something like:

  • admin: create, delete, read
  • lead: create, read
  • everyone else: read

Start documentation

Create a docs/ directory containing our MVP etc. Also create a README and a LICENSE.

Create initial `team` command documentation

Create a document in docs/ (similar to the one created for #25) that lists the various options/help strings/etc that we will implement for MVP for the @rocket team command.

In particular, we will want to match the functionality of the current @rocket edit-team, @rocket remove-user, @rocket view-team, @rocket add-team, @rocket add-user, @rocket remove-team, and @rocket teams commands (but hopefully with better/more consistent names!). These should probably all be implemented as subcommands to the core @rocket team command (similar to how user commands are being done).

Setup Travis

Setup Travis CI to run on each push/pull request. At the very least it should:

  • Run automated tests.
  • Run pycodestyle to ensure code style adherence.
  • Push code coverage statistics to Codecov.io (look into coverage.py).

Create initial documentation `user` command

Create a document in docs/ that lists the various options/help strings/etc that we will implement for MVP for the @rocket user command.

In particular, we will want to match the functionality of the current @rocket remove-user, @rocket view-user, @rocket edit, @rocket set, and @rocket add-user commands (but hopefully with better names!). These should probably all be implemented as subcommands or flags to the core @rocket user command.

Setup logging

After deployment we'll want to set up some logging. In particular we will want logging levels as well as a general facade structure (so that for instance we can use a local log file or AWS CloudWatch Logs in the future). These should be provided by the logging standard library module - see also the logging tutorial and tips on Hitchhiker's Guide.

Setup Slack manual testing

Create a new bot on Slack and a channel to test it on (a good name for this would be #rocket-test) so that we can try out our bot "live" without interrupting the old Rocket.

Create database facade

Create a database facade (probably in a database/ directory) that exposes core database actions that commands/events can interact with. For now, focus on user-related actions; these can just be stubbed out, since the point of this ticket is more to get the database facade's API up and going so other modules can start calling it.

This doesn't necessarily have to be a whole class; it might be better to leave it as a set of functions (but I leave that up to the developers!).

Stub out `user` command

Create a user command class in command/commands/, stub out its main methods (e.g. handle()), and implement help() and name().

Create data model for users

In model/user.py, create a class User that we'll use to represent users. At the moment in Rocket users have:

  • Name
  • Email
  • Position
  • GitHub username
  • Major
  • Bio

In the future we will also need to add permissions in the future and potentially other fields, so it should be somewhat extensible.

Research pytest and different types of tests (if possible)

Have pytest run database tests only when travis is running the tests (full tests). If the user doesn't have the database running (by pinging localhost:8000), we just give a warning, saying that the database isn't running, or have a whole different group of tests (unit tests vs functional tests).

Server crashes with NameError on launch

SLACK_SIGNING_SECRET is undefined, it should be read in from an environment variable.

File "/Users/rwblickhan/Developer/rocket2.0/server/server.py", line 16, in <module>
    slack_events_adapter = SlackEventAdapter(SLACK_SIGNING_SECRET,
NameError: name 'SLACK_SIGNING_SECRET' is not defined
[2018-11-10 15:44:14 -0800] [715] [INFO] Worker exiting (pid: 715)

Implement model equality

Just as a convenience function (so that we don't have to do user.get_slack_id() == user2.get_slack_id() and user.get_biography() == user2.get_biography() every single time).

Setup unit tests

Create a sample test in tests/ and ensure it runs - in particular this test should be automated in Travis builds (see #2).

Create data model for teams

In model/team.py, create a class Team that we'll use to represent teams. At the moment in Rocket teams have:

  • Display name
  • Platform
  • List of members
  • GitHub team name

In particular we will need to decide how to represent the list of members internally - potentially it could be a list of User objects (see #3), some kind of identifier that could be referenced externally, or something else.

Look into forking pymarkdownlint

We're using mdl to lint Markdown (e.g. for documentation). This is rather inconvenient because it's written in Ruby but everything else is in Python 3. We tried using the (unmaintained) pymarkdownlint instead but it appears to be written in Python 2. We should investigate how easy it would be to convert this to Python 3 - if it would be relatively straightforward we should fork it and replace mdl.

Enforce documentation standards

Everything should be documented with Python docstrings. Checking for docstring style should be part of our CI pipeline; luckily there's a tool called pydocstyle for just this purpose.

Start DynamoDb connection class

Create a class to encapsulate a connection to DynamoDb, using the boto3 library. This will eventually be called from the database facade created in #30. For now it's probably enough to stub out some of the major methods, and possibly start methods to convert instances of our data model into DynamoDb equivalents.

Add event handler method

Add a core.py (or some other reasonable name) to a command/ directory (or some other reasonable name) that will expose an event handler method that will be sent the event JSON strings from the Slack client. For now it just has to accept these and deserialize them to into SlackEvent objects (as implemented in #28).

Missing getter/setter for User.name

Kinda weird that nobody noticed. While testing the User class with the .__dict__, which prints out all class attributes, I found that there is a name attribute, but no getters or setters. Needs to be fixed quickly.

No error checking in dynamodb team functions

There are no checks for dynamodb team existance (undefined). Please do so.

The best way would be to raise a LookupError with some proper text explaining what happened to the poor user.

Stub out `team` command

Create a team command class in command/commands/, stub out its main methods (e.g. handle()), and implement help() and name() (double check with the implementation of the user command as implemented in #31).

Add type annotations to data model

Once our data model starts stabilizing a bit more, we should add type annotations from the typing standard library module and add type checking to our Travis builds.

Feature random channels

Feature request: every week, feature a random public channel to help with channel discovery (for example, #rock-it-beats or #interview-prep)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.