ONEARMY / community-platform

A platform to build useful communities that aim to tackle global problems
https://platform.onearmy.earth
MIT License
1.14k stars 386 forks source link

Add research update webhook #3684

Closed pizzaisdavid closed 3 months ago

pizzaisdavid commented 3 months ago

PR Type

feature

Description

Make message in Discord when a new Research Update is created.

Git Issues

Doesn't close, but for: https://github.com/ONEARMY/community-platform/issues/3533

Screenshots/Videos

demo: https://www.youtube.com/watch?v=LD1Rj0OrHDg

davehakkens commented 3 months ago

very nice! :)

How will this go for Precious Plastic VS Project Kamp? Since I think atm Project Kamp doesnt have a Discord webhook installed yet

pizzaisdavid commented 3 months ago

How will this go for Precious Plastic VS Project Kamp? Since I think atm Project Kamp doesnt have a Discord webhook installed yet

Good question.

After reviewing the codebase, I think it would not work but not crash the backend generally.

I've added some checks, so if there is no Discord webhook, then to just exit that part safely. I am not totally sure what the config looks like on Project Kamp, so I had to guess (checking for empty string, null, and undefined.)

Summary: should work fine.

pizzaisdavid commented 3 months ago

changes applied, successfully rebased, ready for dev review

pizzaisdavid commented 3 months ago

@benfurber unfortunately there is no preexisting infrastructure for testing webhooks in an automated way, so... uh.. nope!

Anyone can feel free to add tests to any webhook and then I will copy what they did for this one here. 😉

davehakkens commented 3 months ago

Perhaps a different issues for after this. But how would we get this up and running for Project Kamp? Seems very useful!

cypress[bot] commented 3 months ago

1 failed test on run #5870 ↗︎

1 74 1 0 Flakiness 0

Details:

chore: check for URL
Project: onearmy-community-platform Commit: f8c2f20b88
Status: Failed Duration: 04:47 💡
Started: Jun 26, 2024 3:05 AM Ended: Jun 26, 2024 3:10 AM
Failed  src/integration/howto/write.spec.ts • 1 failed test • ci-chrome View Output Video
Test Artifacts
[How To] > [Create a how-to] > [By Authenticated] Test Replay Screenshots Video

Review all test suite changes for PR #3684 ↗︎

pizzaisdavid commented 3 months ago

Perhaps a different issues for after this

I have made an issue: https://github.com/ONEARMY/community-platform/issues/3694

pizzaisdavid commented 3 months ago

I looked at the failed test, it seems to be un-related.

Siri, re-run the tests please.

mariojsnunes commented 3 months ago

the failing test looks like the same bug as https://github.com/ONEARMY/community-platform/issues/3691. Could be solved on another PR

onearmy-bot commented 3 months ago

:tada: This PR is included in version 1.194.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: