-
Notifications
You must be signed in to change notification settings - Fork 7
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
handle pr notifications on the same thread #161
Conversation
* origin/master: Revert "DM only when user breaks a step (#160)"
* origin/master: dune: remove unused result dependency github: use ubuntu-22.04 github: remove manual apt update github: add dependabot make status notifications minimal config_docs.md: clarify why GH handle matching is needed readme.md, config_docs.md: add documentation on slack mentions
7f264e2
to
3843e84
Compare
|
||
let get_thread_permalink ~ctx:_ (thread : State_t.slack_thread) = | ||
Lwt.return_some | ||
@@ Printf.sprintf "https://monorobot.slack.com/archives/%s/p%s?thread_ts=%s&cid=%s" thread.cid |
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.
is it the correct url?
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.
no, this is a dummy url. The structure is correct, but the domain is not. i didn't want to use the real one. This is only used for tests, I don't think it matters.
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.
Can put as a comment in code please?
is it waiting on anything? Can you show how the messages will look like? |
@Khady can we merge this? |
| Some a -> Some (sprintf "New comment by %s in <%s|%s>" sender.login comment.html_url a) | ||
| Some a -> Some (sprintf "Commented in file <%s|%s>" comment.html_url a) |
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.
this change is unrelated to the PR
| "commented" -> "commented on" | ||
| "commented" -> "reviewed" |
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 change is unrelated to the PR
| Opened | Ready_for_review -> | ||
let labels_banner = show_labels labels in | ||
( "opened", | ||
body | ||
|> Option.map (fun body' -> | ||
Option.map_default (fun labels' -> sprintf "%s\n%s" body' labels') body' labels_banner) ) |
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 change is unrelated to the PR
let url_args = Web.make_url_args [ "channel", thread.cid; "message_ts", thread.ts ] in | ||
match%lwt | ||
request_token_auth ~name:"retrieve message permalink" ~ctx `GET | ||
(sprintf "chat.getPermalink?%s" url_args) |
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.
(sprintf "chat.getPermalink?%s" url_args) | |
"chat.getPermalink" |
this is confusing, should pass url_args
as another param to request_token_auth
@@ -144,6 +146,13 @@ type auth_test_res = { | |||
user_id: string; | |||
} | |||
|
|||
type permalink_res = { | |||
ok: bool; |
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 field is unnecessary, it is handled by http_response below
This PR handles PR and PR-related github notifications on monorobot. Tackles #154 and #155.
When a PR is