Code Monkey home page Code Monkey logo

Comments (7)

grrowl avatar grrowl commented on May 14, 2024 2

Would love this — my initial idea (not knowing about metadata) was to append a <!-- probot comment[<id>] --> marker to the comment, then (on update) paginate comments until a comment with that marker (including id) was found

from ideas.

gr2m avatar gr2m commented on May 14, 2024 2

Either way I think @grrowl you can start creating the plugin, we will figure out how to get it into probot later :)

from ideas.

JasonEtco avatar JasonEtco commented on May 14, 2024 1

I’m not yet sure how you’d load the plugin in Probot though? @JasonEtco is robot.github set so it could be done in the Probot app’s entry point function?

That's a good point. We'd need to load the plugin in the handler itself I guess? We don't currently expose the GitHub client until its created in robot.auth (as part of robot.on). An interesting conversation though, as Octokit plugins become more mature we'll definitely want to help folks out in that area.

from ideas.

gr2m avatar gr2m commented on May 14, 2024

maybe probot/friction would be a better place to discuss this?

from ideas.

gr2m avatar gr2m commented on May 14, 2024

@grrowl sounds like a good plan to me :)

from ideas.

JasonEtco avatar JasonEtco commented on May 14, 2024

@grrowl that'd likely be the right implementation - I think the challenge is around designing a good looking API. I don't think it should be part of Probot, but would make a nice third-party lib (or even an Octokit plugin, what do you think @gr2m?)

Something like:

context.github.createOrUpdateComment({
  owner, repo, issue,
  body: '...', // First body, when comment is created
  transform: oldComment => oldComment + 'New content', // Transform the original comment if it needs to update
  marker: 'probot:APP_ID' // resolve to <!-- probot:APP_ID -->
})

from ideas.

gr2m avatar gr2m commented on May 14, 2024

sounds like a great plan to me :) @octokit/rest plugins API is still work-in-progress but they already work. See https://github.com/octokit/rest.js/tree/master/lib/plugins for some info and reference plugin implementation. You could create a repository/npm package for the plugin and then load it like this

octokit.plugin(require('octokit-plugin-create-or-update-comment'))

I’m not yet sure how you’d load the plugin in Probot though? @JasonEtco is robot.github set so it could be done in the Probot app’s entry point function?

GitHub
rest.js - GitHub REST API client for Node.js

from ideas.

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.