Skip to content

Commit

Permalink
Merge pull request #91 from mattpolzin/fix-github-team-assignments
Browse files Browse the repository at this point in the history
assign individuals and teams separately for GitHub's sake.
  • Loading branch information
mattpolzin authored Aug 19, 2023
2 parents 7c0549a + b38edc9 commit ca8bd95
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
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 = 2.6.0
version = 2.6.1
authors = "Mathew Polzin"
license = "MIT"
-- brief =
Expand Down
4 changes: 2 additions & 2 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": "2.6.0",
"version": "2.6.1",
"publishConfig": {
"access": "public"
},
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 = "2.6.0"
appVersion = "2.6.1"

export
printVersion : HasIO io => io ()
Expand Down
14 changes: 12 additions & 2 deletions src/FFI/GitHub.idr
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,14 @@ prim__addPullReviewers : Ptr OctokitRef
||| Add reviewers to a Pull Request.
|||
||| Will produce a list of applied reviewers.
|||
||| Applies team reviewers first as one API request and then
||| individual reviewers second as a second API request. This
||| implementation detail forces (or allows) GitHub to take a
||| team assignment and pick someone from it whereas if a team
||| and some individuals are assigned in one go then GitHub will
||| never apply its round-robin or weight-balanced selection but
||| instead will leave the team itself assigned.
export
addPullReviewers : Octokit =>
(owner : String)
Expand All @@ -243,8 +251,10 @@ addPullReviewers : Octokit =>
-> (reviewers : List String)
-> (teamReviewers : List String)
-> Promise (List String)
addPullReviewers @{Kit ptr} owner repo pullNumber reviewers teamReviewers =
lines <$> (promiseIO $ prim__addPullReviewers ptr owner repo pullNumber (join "," reviewers) (join "," teamReviewers))
addPullReviewers @{Kit ptr} owner repo pullNumber reviewers teamReviewers = do
teamReviewers <- lines <$> (promiseIO $ prim__addPullReviewers ptr owner repo pullNumber "" (join "," teamReviewers))
individualReviewers <- lines <$> (promiseIO $ prim__addPullReviewers ptr owner repo pullNumber (join "," reviewers) "")
pure $ teamReviewers ++ individualReviewers

%foreign okit_ffi "add_labels"
prim__addLabels : Ptr OctokitRef
Expand Down

0 comments on commit ca8bd95

Please sign in to comment.