Coder Social home page Coder Social logo

Comments (11)

williamkapke avatar williamkapke commented on June 3, 2024 1

Github API token(s) are controlled by the @nodejs/build team. This should probably be integrated in the @nodejs/github-bot which worked with the them to get a token and server(s) for the bot. You'll want to get involved there.

A snag you'll need to work with is that org-wide events are not allowed for security reasons. This means you'd need to get a webhook setup for all repos individually.

from badges.

williamkapke avatar williamkapke commented on June 3, 2024 1

@amiller-gh I'll defer to @nodejs/github-bot team to make the call.

from badges.

ryzokuken avatar ryzokuken commented on June 3, 2024 1

@amiller-gh It has been well over 2 days since I made the issue in https://github.com/nodejs/github-bot, and I have received no response yet. Could you please contact the team on a more personal level, make sure somebody helps me with the accesses we'd need to make this happen?

Thanks.

from badges.

ryzokuken avatar ryzokuken commented on June 3, 2024

Badger's API: https://api.badgr.io/docs/v2/

GitHub's API: https://developer.github.com/v3/
GitHub webhooks (precisely what we need): https://developer.github.com/webhooks/

Node module for Badgr: https://www.npmjs.com/package/badgr-client
(This should work, atleast for simply issuing badges)
Node module for accessing GitHub's API: https://www.npmjs.com/package/@octokit/rest
Creating hooks using the module: https://octokit.github.io/rest.js/#api-Repos-createHook

@amiller-gh I believe I could prototype this, awaiting your approval.

from badges.

ryzokuken avatar ryzokuken commented on June 3, 2024

@williamkapke I think that's doable too, I think GH allows you to get all the repos for an org. We could add a routine check to add hooks for any newly formed repos.

from badges.

ryzokuken avatar ryzokuken commented on June 3, 2024

P.S. The I don't have access to view and/or contact the @nodejs/github-bot team ATM. Any alternative way to get involved?

from badges.

williamkapke avatar williamkapke commented on June 3, 2024

They're at https://github.com/nodejs/github-bot. Just open an issue πŸ‘

from badges.

amiller-gh avatar amiller-gh commented on June 3, 2024

@ryzokuken prototype away πŸ‘Excited to see what you create! Let me know if you need any help getting traction with the github-bot team or have any questions as you're implementing.

@williamkapke, does the org-wide event restriction include listening to team roster changes? That hook would be very valuable for this tool – ex: Awarding a TSC membership badge when a member is added to the organization's TSC team.

from badges.

ryzokuken avatar ryzokuken commented on June 3, 2024

@amiller-gh any updates?

from badges.

amiller-gh avatar amiller-gh commented on June 3, 2024

Hey @ryzokuken, sorry for the delay – busy week!

It looks like @phillipj is the primary code contributor, so he may be able to chime in here, or help point us in the right direction.

Otherwise, I'd seriously recommend just pulling down the app and experimenting with it! I don't believe you need any special permissions to get started here. I took a quick look at the bot app and here's what I've gathered (hopefully @phillipj can let me know if I have anything wrong!):


The project appears to be an Express app at its core and scripts are automagically loaded from the scripts directory.

So, once you pull the repo down and get it started up, you would make a new endpoint(s) in the scripts directory (presumably scripts/badgr.js) that expects to be pinged in response to certain Github webhooks.

The tests directory contains integration tests for all the endpoints in the app. You would presumably add tests for the badgr endpoints here.

It appears that the more complex tests use fixture data to mock out the Github webhook responses for testing. You can add your own fixture data from the samples provided by Github.

It also uses nock and supertest to mock out HTTP requests. This would be used to mock out responses to and from Github and Badgr in our use case.

As for implementation details, it appears that many of the webhooks that we call don't return the user's public email address, so you may also have to hit up the Github API.


All that being said, you shouldn't need any permissions to start mocking out an end to end implementation and writing tests πŸ™‚Does that help?

from badges.

ryzokuken avatar ryzokuken commented on June 3, 2024

from badges.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.