-
Notifications
You must be signed in to change notification settings - Fork 203
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(service): Add Web Push #441
feat(service): Add Web Push #441
Conversation
@nikoksr I've implemented the basic webpush notification service in this PR, but I need advice on the testing approach. |
@KaviiSuri thank you so much for this! Looks very promising already. Please excuse the delay, we're both rather busy atm but will come back to this asap! |
Hi @KaviiSuri, so sorry for the big delay. Your PR is next in line, I'll tackle it over the holidays! Once again, appreciate your efforts and patience. |
@nikoksr no problem at all! I completed understand. I hope to contribute and learn more! |
@KaviiSuri going over this now! I'll hit you up with feedback asap. Appreciate your patience so much. Hope things are well with you. |
it’s blocked on static analysis ? |
Hey @gedw99 |
ok thanks ! |
Hey @gedw99, the codacy url shows |
No is their service down ? |
…ush-notification-service * 'main' of https://github.com/nikoksr/notify: (65 commits) fix(deps): update module github.com/aws/aws-sdk-go-v2/config to v1.18.13 (nikoksr#529) fix(deps): update module github.com/plivo/plivo-go/v7 to v7.19.0 (nikoksr#528) fix(deps): update module google.golang.org/api to v0.110.0 (nikoksr#527) fix(deps): update module github.com/bwmarrin/discordgo to v0.27.0 (nikoksr#509) fix(deps): update module github.com/aws/aws-sdk-go-v2/service/sns to v1.20.2 (nikoksr#526) fix(deps): update module github.com/mailgun/mailgun-go/v4 to v4.8.2 (nikoksr#525) fix(deps): update module github.com/aws/aws-sdk-go-v2/service/sns to v1.20.1 (nikoksr#524) fix(deps): update module github.com/aws/aws-sdk-go-v2/service/ses to v1.15.1 (nikoksr#523) fix(deps): update module github.com/aws/aws-sdk-go-v2/config to v1.18.12 (nikoksr#522) fix(deps): update module github.com/aws/aws-sdk-go-v2 to v1.17.4 (nikoksr#521) fix(deps): update module github.com/aws/aws-sdk-go-v2/service/sns to v1.20.0 (nikoksr#520) fix(deps): update module github.com/aws/aws-sdk-go-v2/config to v1.18.11 (nikoksr#519) fix(deps): update module google.golang.org/api to v0.109.0 (nikoksr#518) fix(deps): update module github.com/plivo/plivo-go/v7 to v7.18.0 (nikoksr#517) fix(deps): update module github.com/aws/aws-sdk-go-v2/config to v1.18.10 (nikoksr#515) fix(deps): update module github.com/aws/aws-sdk-go-v2/service/sns to v1.19.1 (nikoksr#514) fix(deps): update module github.com/aws/aws-sdk-go-v2/config to v1.18.9 (nikoksr#512) fix(deps): update module google.golang.org/api to v0.108.0 (nikoksr#511) feat(service): Add Google Chat Service (nikoksr#501) fix(deps): update module github.com/plivo/plivo-go/v7 to v7.17.1 (nikoksr#510) ...
|
@KaviiSuri finally got to give this my full attention.. so sorry for the huge delay. To compensate you for your patience, you don't need to do any refactoring work, it's all done. Your struggles with this PR are absolultely understandable to me. And I agree with you, it's not our obligation to test the webpush library in it's fullness. We just have to make sure that whatever data we touch, manipulate and forward to the library is well tested. I've utilized the httptest.Server for this, similar as with our internal HTTP service. I'm curious for your feedback on this! Also, I made some changes to your implementation that generalize its usage a bit, but overall it was a joy working with your code. Great job, we appreciate it a ton! I'll go ahead fix the remaining linter issues and we'll be ready to merge right after. Hope you're doing well and sorry again for the delay. Edit: Oh, and before I forget, please check if the end-to-end test still works! I may have very well broken your working implementation haha |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #441 +/- ##
==========================================
+ Coverage 75.07% 75.17% +0.09%
==========================================
Files 41 42 +1
Lines 1376 1458 +82
==========================================
+ Hits 1033 1096 +63
- Misses 251 268 +17
- Partials 92 94 +2
☔ View full report in Codecov by Sentry. |
@nikoksr thanks for making the improvements! So happy to contribute to the project, would love to do more work here moving forward! |
MIght be useful to add the following to README https://caniuse.com/notifications IOS needs A2HS. Like ths golang pwa does: https://go-app.dev/ |
@KaviiSuri @gedw99 does any of you happen to know an easy way for us to test this solution end-to-end? It's pretty safe to assume that SherClockHolmes/webpush-go does its job well and just works, but I don't like the idea of just releasing the solution without checking its behavior once. @gedw99 great idea, we'll definitely include this! |
I test E2E locally using Caddy, MkCert for the Server. Gives you a https locally with custom domain name. For the Wasm services worker i use go.app: https://github.com/maxence-charriere/go-app I think it would be a good idea to make a little demo in this repo one day when there is time. In CI, I can run caddy and mkcert, using a makefile as part of github workflows. For CI of the GUI, thats hard. I use screen shots and Goldens. Its brutal but works. I don't have a framework yet i can recommend because i use GIO which has build in screen shotting. It runs on web, desktop and mobile. SO its makes cross devcie testing easier. BUT gio is not used by others. But the idea is to deploy the web app as a github page as part of CI, then you can tell it to screenshot and then you can test you got the right screen shot against your golden screenshot. Because the makefiles are 100% OS independent you can test for all Desktops and their browsers. Again i tres that CI browser testing is HARD and these are only suggestions. I would be happy to work on this with someone. |
Wow, fascinating! Thanks for sharing all that knowledge with us. I wasn't aware of screenshot based browser testing and thus neither of golden. I wonder how or if we could reduce the complexity of this. Here's something I found with a quick Google search. |
Looks pretty old and hacky. I have used this: |
Oh, definitely! My thought process was rather about taking this as a starting point and building a suitable solution on it, but Saucelabs already seems to be doing all that. I would definitely welcome E2E tests for protocol centric services in the future and since we're slowly moving more and more services away from a third-party dependency based implementation towards http service based implementations E2E testing might become more viable even for platform centric services too. |
Lets start a New Issue or Discussion about this ? |
Sure! Would you like to open it? |
@KaviiSuri will merge as soon as you mark this as ready (marked as draft atm)! |
The way depguard is being utilized and configured seems to have changed. Removing it for now as it's blocking the build pipeline until the problem is well understood.
Description
This introduces the web push service as a notifier in the library. It uses webpush-go to handle the notifications.
This PR is still a draft!
Motivation and Context
This PR aims to close #112
How Has This Been Tested?
I need some advice on this as the
webpush-go
package does not provide a client struct that we can mock, rather it's a bunch of global functions.Should the testing be done by creating such an abstraction (client struct)? Or, testing the logic to parse the options from context and payload should be enough?
Types of changes
Checklist: