Skip to content

Commit

Permalink
merge w/ main
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin committed Jan 11, 2024
2 parents 604d209 + b8b0ba5 commit 8b90703
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 44 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ version:
sed -I '' "s/appVersion = \".*\"/appVersion = \"${v}\"/" ./src/AppVersion.idr
sed -I '' "s/\"version\": \".*\"/\"version\": \"${v}\"/" ./package.json
sed -I '' "s/version = \".*\";/version = \"${v}\";/" ./default.nix
@npm update
@$(node2nix) -- --composition node2nix.nix # -l # <- can't use -l for lockfile because lockfile version 3 not supported yet.

package: build
./version-check.sh
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
};

harmonyPkg = buildIdris {
version = "3.1.0";
version = "3.2.0";
projectName = "harmony";
src = ./.;

Expand Down
2 changes: 1 addition & 1 deletion harmony.ipkg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package harmony
version = 3.1.0
version = 3.2.0
authors = "Mathew Polzin"
license = "MIT"
brief = "Harmony GitHub collaboration tool"
Expand Down
42 changes: 21 additions & 21 deletions node-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@
sha512 = "FLWs/AvZllw/AGVs+nJ+ELCDZZJk+kY0zMen118xhL2zD0s1etIUHm1odgjP7epxYU1ln7SZxEUWYop5bhsdgQ==";
};
};
"@octokit/webhooks-12.0.10" = {
"@octokit/webhooks-12.0.11" = {
name = "_at_octokit_slash_webhooks";
packageName = "@octokit/webhooks";
version = "12.0.10";
version = "12.0.11";
src = fetchurl {
url = "https://registry.npmjs.org/@octokit/webhooks/-/webhooks-12.0.10.tgz";
sha512 = "Q8d26l7gZ3L1SSr25NFbbP0B431sovU5r0tIqcvy8Z4PrD1LBv0cJEjvDLOieouzPSTzSzufzRIeXD7S+zAESA==";
url = "https://registry.npmjs.org/@octokit/webhooks/-/webhooks-12.0.11.tgz";
sha512 = "YEQOb7v0TZ662nh5jsbY1CMgJyMajCEagKrHWC30LTCwCtnuIrLtEpE20vq4AtH0SuZI90+PtV66/Bnnw0jkvg==";
};
};
"@octokit/webhooks-methods-4.0.0" = {
Expand All @@ -252,13 +252,13 @@
sha512 = "y92CpG4kFFtBBjni8LHoV12IegJ+KFxLgKRengrVjKmGE5XMeCuGvlfRe75lTRrgXaG6XIWJlFpIDTlkoJsU8w==";
};
};
"@types/aws-lambda-8.10.130" = {
"@types/aws-lambda-8.10.131" = {
name = "_at_types_slash_aws-lambda";
packageName = "@types/aws-lambda";
version = "8.10.130";
version = "8.10.131";
src = fetchurl {
url = "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.130.tgz";
sha512 = "HxTfLeGvD1wTJqIGwcBCpNmHKenja+We1e0cuzeIDFfbEj3ixnlTInyPR/81zAe0Ss/Ip12rFK6XNeMLVucOSg==";
url = "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.131.tgz";
sha512 = "IWmFpqnVDvskYWnNSiu/qlRn80XlIOU0Gy5rKCl/NjhnI95pV8qIHs6L5b+bpHhyzuOSzjLgBcwgFSXrC1nZWA==";
};
};
"@types/btoa-lite-1.0.2" = {
Expand All @@ -279,13 +279,13 @@
sha512 = "VRLSGzik+Unrup6BsouBeHsf4d1hOEgYWTm/7Nmw1sXoN1+tRly/Gy/po3yeahnP4jfnQWWAhQAqcNfH7ngOkA==";
};
};
"@types/node-20.10.6" = {
"@types/node-20.10.7" = {
name = "_at_types_slash_node";
packageName = "@types/node";
version = "20.10.6";
version = "20.10.7";
src = fetchurl {
url = "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz";
sha512 = "Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==";
url = "https://registry.npmjs.org/@types/node/-/node-20.10.7.tgz";
sha512 = "fRbIKb8C/Y2lXxB5eVMj4IU7xpdox0Lh8bUPEdtLysaylsml1hOOx1+STloRs/B9nf7C6kPRmmg/V7aQW7usNg==";
};
};
"aggregate-error-3.1.0" = {
Expand Down Expand Up @@ -558,13 +558,13 @@
sha512 = "JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==";
};
};
"universal-github-app-jwt-1.1.1" = {
"universal-github-app-jwt-1.1.2" = {
name = "universal-github-app-jwt";
packageName = "universal-github-app-jwt";
version = "1.1.1";
version = "1.1.2";
src = fetchurl {
url = "https://registry.npmjs.org/universal-github-app-jwt/-/universal-github-app-jwt-1.1.1.tgz";
sha512 = "G33RTLrIBMFmlDV4u4CBF7dh71eWwykck4XgaxaIVeZKOYZRAAxvcGMRFTUclVY6xoUPQvO4Ne5wKGxYm/Yy9w==";
url = "https://registry.npmjs.org/universal-github-app-jwt/-/universal-github-app-jwt-1.1.2.tgz";
sha512 = "t1iB2FmLFE+yyJY9+3wMx0ejB+MQpEVkH0gQv7dR6FZyltyq+ZZO0uDpbopxhrZ3SLEO4dCEkIujOMldEQ2iOA==";
};
};
"universal-user-agent-6.0.1" = {
Expand Down Expand Up @@ -598,7 +598,7 @@
args = {
name = "_at_mattpolzin_slash_harmony";
packageName = "@mattpolzin/harmony";
version = "3.0.0";
version = "3.2.0";
src = ./.;
dependencies = [
sources."@kwsites/file-exists-1.1.1"
Expand All @@ -625,13 +625,13 @@
sources."@octokit/request-8.1.6"
sources."@octokit/request-error-5.0.1"
sources."@octokit/types-12.4.0"
sources."@octokit/webhooks-12.0.10"
sources."@octokit/webhooks-12.0.11"
sources."@octokit/webhooks-methods-4.0.0"
sources."@octokit/webhooks-types-7.1.0"
sources."@types/aws-lambda-8.10.130"
sources."@types/aws-lambda-8.10.131"
sources."@types/btoa-lite-1.0.2"
sources."@types/jsonwebtoken-9.0.5"
sources."@types/node-20.10.6"
sources."@types/node-20.10.7"
sources."aggregate-error-3.1.0"
sources."before-after-hook-2.2.3"
sources."bottleneck-2.19.5"
Expand Down Expand Up @@ -670,7 +670,7 @@
})
sources."simple-git-3.22.0"
sources."undici-types-5.26.5"
sources."universal-github-app-jwt-1.1.1"
sources."universal-github-app-jwt-1.1.2"
sources."universal-user-agent-6.0.1"
sources."wrappy-1.0.2"
sources."yallist-4.0.0"
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mattpolzin/harmony",
"version": "3.1.0",
"version": "3.2.0",
"engines" : {
"node" : ">=18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/AppVersion.idr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module AppVersion

export
appVersion : String
appVersion = "3.1.0"
appVersion = "3.2.0"

export
printVersion : HasIO io => io ()
Expand Down
25 changes: 21 additions & 4 deletions src/Graph.idr
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Data.PullRequest
import Text.PrettyPrint.Prettyprinter
import Text.PrettyPrint.Prettyprinter.Render.Terminal
import Text.PrettyPrint.Prettyprinter.Symbols
import Text.PrettyPrint.Prettyprinter.Util

%default total

Expand Down Expand Up @@ -147,8 +148,7 @@ healthGraph openPullRequests org repo =
, Just $ emptyDoc
]

||| Produce a graph of relative review workload for all developers matching the given
||| filter.
||| Produce a graph of relative review workload for developers.
||| @ closedReviews The logins of each reviewer of each closed PR (duplicates intact).
||| @ openReviews The logins of each reviewer of each open PR (duplicates intact).
||| @ candidates The logins of all potential reviewers that should be considered.
Expand All @@ -172,7 +172,10 @@ reviewsGraph closedReviews openReviews candidates completedReviews =
[] => emptyDoc
((MkScore _ s c) :: _) =>
let highScore = c + (s `minus` c) + maxBonus
in header <+> graph (if highScore > 0 then highScore else 1) augmentedOptions <+> line
in vsep [ header
, graph (if highScore > 0 then highScore else 1) augmentedOptions
, footer
]
where
yellowDot : Doc AnsiStyle
yellowDot = annotate (color Yellow) "·"
Expand All @@ -192,9 +195,23 @@ reviewsGraph closedReviews openReviews candidates completedReviews =
, if (null completedReviews) then Nothing else Just $ pretty "1x the number of completed reviews" <++> parens greenBox
, Just $ parens $ redDot <++> pretty "overlayed on" <++> yellowDot
, Just $ emptyDoc
, Just $ emptyDoc
]

note : Doc AnsiStyle -> Doc AnsiStyle
note doc = (annotate bold "Note:") <++> doc

footer : Doc AnsiStyle
footer = vsep
[ emptyDoc
, note $ reflow """
It is a strongly held opinion of Harmony that the above graph is not a measure of each developers' productivity.
It is a proxy for each developers' existing PR review workload that may help to understand how Harmony is
choosing reviewers or similarly help one developer decide which other developers have capacity to help review
their work.
"""
, emptyDoc
]

augment : (completedReviews : SortedMap login Nat) -> ReviewScore login -> AugmentedReviewScore login
augment completed score =
Augmented score (maybe 0 id $ lookup score.user completed)
Expand Down

0 comments on commit 8b90703

Please sign in to comment.