Git Product home page Git Product logo

Comments (25)

Jamonek avatar Jamonek commented on September 23, 2024

Lets create it!

from personal-sites.

bryangarza avatar bryangarza commented on September 23, 2024

Any update on this?

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

Yeah - I'm in DC for the week so I'll finish it up next week.

from personal-sites.

zmughal avatar zmughal commented on September 23, 2024

++

from personal-sites.

zmughal avatar zmughal commented on September 23, 2024

Also check for duplicates and make all the GitHub URLs normalised to use https://.

from personal-sites.

robbyoconnor avatar robbyoconnor commented on September 23, 2024

I support this

from personal-sites.

zmughal avatar zmughal commented on September 23, 2024

Also check if someone does a pull request, suggest that their GitHub profile should be in the GitHub list too. That would save me some time since I often go through and add all the PR profiles myself.

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

Flow seems to be:
webhook for pull request => get commit hash from webhook => push pending status to github => run checks on the commit's diff => push good/bad status to github

Gonna have to work out how to parse the diff.

Uses: https://developer.github.com/v3/repos/statuses/

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

https://github.com/iangcarroll/pr-bot/pull/9 shows a demonstration of statuses. Webhook is partially working now.

from personal-sites.

zmughal avatar zmughal commented on September 23, 2024

Do you need to parse the diff? I would apply the patch using git-apply or patch and then see if the file checker fails on the changed file.

from personal-sites.

zmughal avatar zmughal commented on September 23, 2024

Now that I think about it, you could write something really quickly that just runs on Travis-CI.

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

That's a good idea, but we don't have a file checker (yet).

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

Given the webhook logic is mostly done, moving it to Travis would be more work. Applying the .patch version would be interesting, though.

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

URL extraction and testing via preg_match_all is done, although cURL currently throws an exception if the domain doesn't exist that we're not catching (and thus the PR gets stuck on pending).

What's left:

  • VT result check
  • ABC order

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

VT results done: https://github.com/iangcarroll/pr-bot/pull/21

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

Until I wrap this up, I put the source up at https://github.com/iangcarroll/pr-bot-src, if anyone wants to submit a PR for ABC ordering.

from personal-sites.

robbyoconnor avatar robbyoconnor commented on September 23, 2024

PHP?
On 07/10/2015 12:29 PM, Ian Carroll wrote:

Until I wrap this up, I put the source up at
https://github.com/iangcarroll/pr-bot-src, if anyone wants to submit a
PR for ABC ordering.


Reply to this email directly or view it on GitHub
#207 (comment).

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

It's a Laravel 5.0 app, yes.

from personal-sites.

robbyoconnor avatar robbyoconnor commented on September 23, 2024

:( Node.js is the only real dev language -- everything else...is just lame :P Esp. php.
On 07/10/2015 01:39 PM, Ian Carroll wrote:

It's a Laravel 5.0 app, yes.


Reply to this email directly or view it on GitHub
#207 (comment).

from personal-sites.

tjhorner avatar tjhorner commented on September 23, 2024

Do we really need something as heavy as a MVC app? We can just have a worker in the background.

from personal-sites.

tjhorner avatar tjhorner commented on September 23, 2024

Written in Node.js.

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

Heavy, maybe, but its maintainability, speed or functionality are not impeded by it. All the logic is in app/Http/Controllers/PullRequestController.php, for those inclined to contribute.

I'm running into a problem parsing the .diff. What I think I'm going to do is perform alphabetical sorting on the sections in it, and not the entire file. This will validate sorting on the three names above and below each addition, which I believe is acceptable. The reason for this is that the .diff is not a complete version of the file, and only stores additions, deletions, and the 3 lines above and below any aforementioned changes. This also dodges the problem of changes to both the personal site and GitHub section.

The only other way would be fetching the resulting Markdown from the commit and parsing that, which seems a bit much (given we'd still have to parse the .diff to extract the URL additions so we don't re-check every URL every PR).

I'll have to re-do part of the validation logic, but I should have something shortly.

from personal-sites.

hellyeah avatar hellyeah commented on September 23, 2024

What will it take to bring this to fruition?

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

I'm way too busy (as usual, unfortunately) but I'll lay out the approach I took for future takers per @hellyeah's request:

  • Receive a GitHub webhook, verify its signature and discard anything that isn't a newly opened pull request
  • Pull the commit hash from the webhook and fetch it via the GitHub API
  • Download the .diff from the previous response
  • (flawed approach that I took) Regex the .diff for URLs and run checks on them
    (correct approach) Parse each line, assuming the last "word" is the URL and everything else is the name, and check the alphabetical order on the names

Of course, both approaches suffer from the 3-line limitation on how diffs are created. @zmughal had suggested applying the .diff to a local file which could work, but was not especially easy with PHP.

I'll remove myself as the assigned person.

from personal-sites.

iangcarroll avatar iangcarroll commented on September 23, 2024

I setup a Buildkite job using the script from #345, but I'm waiting on an admin to add the webhook. PR statuses should start showing once that's in place.

from personal-sites.

Related Issues (18)

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.