-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(isobot): add locking/cloning functionalities #1392
base: develop
Are you sure you want to change the base?
Conversation
add whitelisting
add endpoints for cloning and locking
change to class
shift to using the class
193da34
to
ec780f9
Compare
@@ -16,11 +23,37 @@ const token = config.get("slackbot.token") | |||
const botReceiver = new ExpressReceiver({ signingSecret, endpoints: "/" }) | |||
export const isobotRouter = botReceiver.router | |||
|
|||
// TODO: add slack ids of isomer user | |||
const ISOMER_USERS_ID = ["U01HTSFC0RY"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we be hardcoding this? Or fetch it dynamically? Else every member movement in team will require a change
An alternative I can think of is to fetch members of the isomer-team
and then check if the user is within this team. I believe the team will be more permanent than a user id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok this sounds good to me, i'll make this change!
await ack() | ||
|
||
const HELP_TEXT = | ||
"Usage: `/clone <github_repo_name>`. Take note that this locks the repo for 15 minutes by default. To bypass this behaviour, add `-n` at the end of the command" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
us clone the right term? we usually refer to it as a repair?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the repair does a lock -> clone -> unlock
under the hood!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct, hence the 3-step process is called repair
await ack() | ||
|
||
const HELP_TEXT = | ||
"Usage: `/lock <github_repo_name> -d <duration_in_minutes>`. Take note that this locks the repo for 15 minutes by default if `-d` is not specified" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should d also have a max time? what if someone puts in an accidental 10000000 mins or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, will make this change
Problem
We want to shift locking/unlocking functionality into a slack bot because using the form is unwieldy. This is because we have to log into form sg -> otp -> find form -> otp again.
Solution
error.cause
inunlock
formutex-utils
. as is, the current return fromunlock
is pretty useless