Git Product home page Git Product logo

get-activity's People

Contributors

gpetiot avatar samoht avatar talex5 avatar

Watchers

 avatar

Forkers

gpetiot

get-activity's Issues

get-activity.1.0.1 broken?

After updating to okra.0.3.0 I could no longer use okra gen to produce my weekly this morning:

$ okra generate --week=12
okra: Failure("lib/contributions_json_response.ml.PullRequest.Review.contribution_of_yojson: list instead of atom for record expected")

This is with okra.0.3.0, okra-lib.0.3.0, get-activity-lib.1.0.1 on Linux.

Realizing that tarides/okra#184 most likely changed the interface of --week for okra gen I tried some variations - but without luck:

$ okra generate --weeks=12
okra: Failure("lib/contributions_json_response.ml.PullRequest.Review.contribution_of_yojson: list instead of atom for record expected")
$ okra generate -w 12
okra: Failure("lib/contributions_json_response.ml.PullRequest.Review.contribution_of_yojson: list instead of atom for record expected")
$ okra generate -w 12-12
okra: Failure("lib/contributions_json_response.ml.PullRequest.Review.contribution_of_yojson: list instead of atom for record expected")

Downgrading to okra.0.2.1 temporarily fixes the problem for me.

PS. If the interface of okra gen indeed changed with okra.0.3.0 the relevant section in the README needs updating to describe the new interface: https://github.com/tarides/okra?tab=readme-ov-file#engineer-report

Filter for activity by email

It would be nice if Okra could filter the activity by email. While I agree it is a rather exotic setup, I usually separate my private commits from my professional commits by the usage of of the committer email, so if Okra could filter activity by the emails it could exclude the odd opensource stuff I do in my free time.

PR merge events are not present

Hi,
I saw that there are now more events like comments. But there are no merge event for PRs. I think that it would be useful to track PRs that take a long time but just get merged after some point. Thanks!

Feature to query GitHub activity for specific engineer

As mentioned at the TL meeting on 15th of February, it is sometimes useful to query specific engineer's activity.
Okra uses get-activity to get GitHub activity, and it does that using the viewer API, which will provide information regarding the user who's token is used. By using the user API instead, one can specify which user's activity we want to get.

The naive change boils down to:

diff --git a/lib/contributions.ml b/lib/contributions.ml
index 92166ff..013e914 100644
--- a/lib/contributions.ml
+++ b/lib/contributions.ml
@@ -2,9 +2,9 @@ module Json = Yojson.Safe
 
 let ( / ) a b = Json.Util.member b a
 
-let query =
-  {| query($from: DateTime!, $to: DateTime!) {
-   viewer {
+let query = 
+  {| query($from: DateTime!, $to: DateTime! $login: String!) {
+  user(login: $login) {
     contributionsCollection(from: $from, to: $to) {
       user {
         login
@@ -64,8 +64,9 @@ module Fetch (C : Cohttp_lwt.S.Client) = struct
     let variables = [
           "from", `String start;
           "to", `String finish;
+          "login", `String user
       ] in
       G.exec token ~variables query
 end
 
 module Datetime = struct
@@ -165,9 +166,9 @@ type t = {
   activity : item list Repo_map.t
 }
 
let of_json ~from json =
-  let contribs = json / "data" / "viewer" / "contributionsCollection" in
-  let username = json / "data" / "viewer" / "contributionsCollection" / "user" / "login" |> Json.Util.to_string in
let of_json ~from json =
+  let contribs = json / "data" / "user" / "contributionsCollection" in
+  let username = json / "data" / "user" / "contributionsCollection" / "user" / "login" |> Json.Util.to_string in
   let items =
     read_issues  (contribs / "issueContributions") @
     read_prs     (contribs / "pullRequestContributions") @

However, the default behavior should not change, that is an engineer shouldn't have to start specifying their username. Afterall, most okra users do not need to query other engineer's activity.

As a side note, this might be a good time to fork Patrick's fork and bring it under Tarides.

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.