tarides / get-activity Goto Github PK
View Code? Open in Web Editor NEWThis project forked from patricoferris/get-activity
collect activity and format as markdown for a journal
License: MIT License
This project forked from patricoferris/get-activity
collect activity and format as markdown for a journal
License: MIT License
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
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.
reported by @shindere
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!
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.
Most of my work does not appear when using okra genarate
because merges and comments are not taken into accounts
It would be useful if the generate
subcommand also could include activities from a calendar, such as google calendar.
(suggested by @tmattio)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.