freeCodeCamp / open-api

freeCodeCamp's open-api Intiative
BSD 3-Clause "New" or "Revised" License
89 stars 28 forks source link

CI : build notification webhook URL should be under variable #105

Closed raisedadead closed 6 years ago

raisedadead commented 6 years ago

https://github.com/freeCodeCamp/open-api/blob/staging/serverless.yml#L37

This is going deliver payloads from all forks

image

ojongerius commented 6 years ago

@raisedadead I dont understand. serverless.yml configures deployment, not build notifications.

raisedadead commented 6 years ago

Yes, I was confused as well, but this is the place where the webhook is configured

https://github.com/freeCodeCamp/open-api/blob/a339616dbf9bf7ccb3e091dc931c3310d677a916/serverless.yml#L37

ojongerius commented 6 years ago

Actually in 2 places: serverless.yml and .travis.yml. You can't configure Travis notifications much and it would surprise me if it would notify for forks. If it does we probably want to look in alternative way of doing notifications. See https://docs.travis-ci.com/user/notifications/#Default-notification-settings

ojongerius commented 6 years ago

Btw, you are right that forks that use sls deploy will not notify our channel, which we probably do not want. Agreed that is enough reason to put it under a variable.

That still leaves Travis notifications. I'm not convinced they work at the moment, I did get a green buid notification when staging recovered in my mailbox but see nothing on the Gitter channel.

Happy to look into both issues I mentioned above tomorrow.

Notes to self: the Travis integrations works, but only show in the 'activity stream in the right'. This is not what is configured in .travis.yml. If I hit the endpoint in the room settings for "custom" I get a {"error":"Not Found"}. Is this "custom" integration broken? Need to do some testing here..

Ooh annoying, I can't get anything to send to the "custom" integration I've configured, but if I create a new one it works. It's a bit disappointing in that it only shows up in right pane and is very easy to miss.

raisedadead commented 6 years ago

Yes, that's how gitter is setup for notification. I think it in future, we can have a combination of the camperbot and camper-gh-bot doing this for us.

raisedadead commented 6 years ago

I did get a green buid notification when staging recovered in my mailbox but see nothing on the Gitter channel.

Yup.. I have no clue on that, but my fork's builds do end up showing on that sidebar. Which we as a org do not want.

ojongerius commented 6 years ago

Sounds like we want to:

How does that approach sound to you @raisedadead ?

ojongerius commented 6 years ago

A day of Yak shaving! Today I learned:

Webhooks, Gitter and Travis 🤨

Related PR: https://github.com/freeCodeCamp/open-api/pull/118 -sparing you the spurious PRs and commits of me adding ngrok webhooks to see if Travis was actually sending anything and if so what, and adding silly things to break builds.

Yarn vs NPM 💩

serverless-pluging-notification has a maintainer that package accepted changes but did not publish a new NPM package. I fairly quickly found out -as expected that you can just add the git url including commit you want and it Just Works. however if you then think you are clever and use Yarn, things can fall apart if your toolchain relies on NPM -I guess I hit a bug but am currently out of time, energy or interest to chase that up. In this cases Serverless uses NPM internally and expects npm ls to work as expected. Well it won't 🤪 My hack was to fork the NPM package, bump the version and publish my copied package -I've notified the maintainer of the original package that I'd be happy to nuke it after he gets his act together. Related PRs https://github.com/maasglobal/serverless-plugin-notification/pull/5 https://github.com/freeCodeCamp/open-api/pull/112

/cc @Bouncey for your entertainment 🍿