Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keybase-bot monkeypatch #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

keybase-bot monkeypatch #63

wants to merge 3 commits into from

Conversation

hadaclay
Copy link

#35 Finished

@@ -573,13 +577,14 @@ class Snipe {
name: subteamName,
};

// @ts-ignore
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's this for?

Copy link
Author

Choose a reason for hiding this comment

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

Typescript is unable to find methods that have been patched in. If it sees a method like createSubteam that doesn't come with the keybase-bot npm package, it will error and not run.

self.bot1.team.createSubteam(subteamName).then((res) => {
console.log("Subteam creation complete!", res);
console.log("Attempting to add people to the team", usernamesToAdd);
self.bot1.team
.addMembers({
team: subteamName,
usernames: usernamesToAdd,
usernames: usernamesToAdd as AddMemberUsernameItem[],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why's this required?

Copy link
Author

Choose a reason for hiding this comment

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

team.addMembers() is looking for a usernames object with type AddMemberUsernameItem[]. Because usernamesToAdd is defaulting to an object[], it's erroring. So we cast object[] to AddMemberUsernameItem[].

- MongoDB (if you're running the bot locally)
- Unix/Linux Server - Croupier relies on non-Windows commands (namely `which`)
- `expect` command (`apt-get install expect`)
- Some Lumens to fund the bot accounts (Main bot needs at least 1XLM to function)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Main bot needs at least 2.01XLM

### Requirements

- MongoDB (if you're running the bot locally)
- Unix/Linux Server - Croupier relies on non-Windows commands (namely `which`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

macOS, Linux, or Windows Subsystem for Linux – Croupier relies on non-Windows commands such as which

@@ -4,25 +4,29 @@ import * as moment from "moment";
import * as mongodb from "mongodb";
import * as os from "os";
import * as throttledQueue from "throttled-queue";
import * as Bot from "./keybase-bot";
// @ts-ignore
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are a lot of these @ts-ignore comments. They seem to be cluttering the code now – is there a deeper fix?

process.env.DEV_CROUPIER_PAPERKEY1,
process.env.DEV_CROUPIER_PAPERKEY2,
process.env.MONGODB_USERNAME,
process.env.MONGODB_PASSWORD,
process.env.MONGODB_HOST,
true,
JSON.parse(process.env.IS_CLUSTER),
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we're now coding this as an envvar, we should remove the isCluster param from the class Croupier constructor(), and just have the constructor method check JSON.parse(process.env.IS_CLUSTER).

Copy link
Collaborator

@zackster zackster left a comment

Choose a reason for hiding this comment

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

Looks good. Left some comments that I'd like you to address. Finally, and at some point this should be automated, once the comments are addressed, could you please confirm that you ran the end to end test suite as described in the README?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants