Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Notifier] Add Google Chat bridge#36488

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromGromNaN:google-chat
Aug 7, 2020

Conversation

@GromNaN
Copy link
Member

@GromNaNGromNaN commentedApr 18, 2020
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix#35875
LicenseMIT
Doc PRsymfony/symfony-docs#14018

Uses the webhook to send messages.

$transport = (newGoogleChatTransportFactory())    ->create(Dsn::fromString('googlechat://<key>:<token>@default/<space>?threadKey=<thread>'));

ThethreadKey can be any string, it allows to post all messages to the same thread instead of creating a new thread for each message.

Example of notification for exceptions:
image

if ('googlechat' === $scheme) {
$space = explode('/', $dsn->getPath())[3];
$accessKey = $dsn->getOption('key');
$accessToken = $dsn->getOption('token');
Copy link
Member

Choose a reason for hiding this comment

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

You should probably throw an exception of the key and/or token is empty. Or perhaps better, user the username/password like other providers.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I like the simplicity of copy-paste the webhook url without too much alteration. Changing the scheme is already a trap I fell into while coding this bridge.

But maybe it's a good thing to move apart from the url provided by Google in order to make clear for developers that they have to parse it in their mind and rewrite it following a custom pattern.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Regarding how other DSN are made, I chose to use a DSN totally different from the webhook url.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

After a review ofexisting DSN, I applied the following format:

googlechat://ACCESS_KEY:ACCESS_TOKEN@default/SPACE?threadKey=THREAD

WhereTHREAD is optional.

@GromNaN
Copy link
MemberAuthor

GromNaN commentedJul 31, 2020
edited
Loading

This PR was not getting much attention.

Since the scope was a little too large, I've removed some non-essential features (card DSL, create transform from webhookUrl) in1b1946c. I hope It can be accepted with this scope.

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

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

LGTM with some minor comments.

@GromNaN
Copy link
MemberAuthor

Thanks for the review. Each comment has been treated.

@fabpot
Copy link
Member

Thank you@GromNaN.

@fabpotfabpot merged commit669b3df intosymfony:masterAug 7, 2020
@GromNaNGromNaN deleted the google-chat branchAugust 7, 2020 21:11
@fabpot
Copy link
Member

@GromNaN Can you submit a PR on symfony/recipes (you can have a look at other notifier bridge recipes to get some inspiration)?

xabbuh added a commit to symfony/symfony-docs that referenced this pull requestAug 21, 2020
…transports (GromNaN)This PR was squashed before being merged into the master branch.Discussion----------[Notifier] Add GoogleChat to the list of supported chat transportsDocumentation forsymfony/symfony#36488Commits-------7bfacde [Notifier] Add GoogleChat to the list of supported chat transports
@nicolas-grekasnicolas-grekas modified the milestones:next,5.2Oct 5, 2020
@fabpotfabpot mentioned this pull requestOct 5, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

[Notifier] Support Google Chat

4 participants

@GromNaN@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp