Skip to content

Commit

Permalink
Merge pull request #136 from mattpolzin/release-5-0
Browse files Browse the repository at this point in the history
Release version 5.0
  • Loading branch information
mattpolzin authored Jul 5, 2024
2 parents 4c638fa + 83f49a7 commit cf28f1d
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 70 deletions.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
};

harmonyPkg = buildIdris {
version = "4.4.0";
version = "5.0.0";
ipkgName = "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 = 4.4.0
version = 5.0.0
authors = "Mathew Polzin"
license = "MIT"
brief = "Harmony GitHub collaboration tool"
Expand Down
12 changes: 6 additions & 6 deletions node-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@
sha512 = "/5hndP5dCjloafCXns6SZyESp3Ldq7YjH3zwzwczYnjxIT0Fqzk5ROSYVGfFyczIue7IUEj8hkvLbPoLQ18vQw==";
};
};
"@types/node-20.14.9" = {
"@types/node-20.14.10" = {
name = "_at_types_slash_node";
packageName = "@types/node";
version = "20.14.9";
version = "20.14.10";
src = fetchurl {
url = "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz";
sha512 = "06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==";
url = "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz";
sha512 = "MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==";
};
};
"aggregate-error-3.1.0" = {
Expand Down Expand Up @@ -607,7 +607,7 @@
args = {
name = "_at_mattpolzin_slash_harmony";
packageName = "@mattpolzin/harmony";
version = "4.4.0";
version = "5.0.0";
src = ./.;
dependencies = [
sources."@kwsites/file-exists-1.1.1"
Expand Down Expand Up @@ -666,7 +666,7 @@
sources."@types/aws-lambda-8.10.140"
sources."@types/btoa-lite-1.0.2"
sources."@types/jsonwebtoken-9.0.6"
sources."@types/node-20.14.9"
sources."@types/node-20.14.10"
sources."aggregate-error-3.1.0"
sources."before-after-hook-2.2.3"
sources."bottleneck-2.19.5"
Expand Down
10 changes: 5 additions & 5 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": "4.4.0",
"version": "5.0.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 = "4.4.0"
appVersion = "5.0.0"

export
printVersion : HasIO io => io ()
Expand Down
8 changes: 0 additions & 8 deletions src/BashCompletion.idr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Data.String
allRootCmds : List String
allRootCmds = [ "request"
, "rq"
, "assign" -- TODO 5.0.0: <- remove this alias for the deprecated assign command.
, "branch"
, "config"
, "contribute"
Expand Down Expand Up @@ -173,13 +172,6 @@ opts @{config} "pr" partialArg _ =
then hashify . slugify <$> config.repoLabels
else []
-- TODO 5.0.0: remove all of the following that deals with the alias
-- for the deprecated assign command.
opts @{config} "assign" "--" "assign" = "--dry" :: config.teamSlugs
opts @{config} "assign" "--" _ = config.teamSlugs
opts "assign" partialArg _ =
optsForRequestCmd partialArg
-- finally, request auto-completes with
-- either a team slug or '+' followed by a user login:
opts @{config} "rq" "--" "rq" = "--dry" :: config.teamSlugs
Expand Down
6 changes: 0 additions & 6 deletions src/Config.idr
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ propSetter DefaultRemote = update Just (\s => { defaultRemote := s })
propSetter MainBranch = update Just (\s => { mainBranch := s })
propSetter ThemeProp = update parseString (\t => { theme := t })
propSetter GithubPAT = update Just (\s => { githubPAT := Just $ hide s })
propSetter AssignTeams = update parseBool (\b => { requestTeams := b })
propSetter AssignUsers = update parseBool (\b => { requestUsers := b })
propSetter CommentOnAssign = update parseCommentConfig (\b => { commentOnRequest := b })

||| Attempt to set a property and value given String representations.
||| After setting, write the config and return the updated result.
Expand All @@ -164,9 +161,6 @@ propGetter DefaultRemote = show . defaultRemote
propGetter MainBranch = show . mainBranch
propGetter ThemeProp = show . theme
propGetter GithubPAT = maybe "Not set (will use $GITHUB_PAT environment variable)" show . githubPAT
propGetter AssignTeams = show . requestTeams
propGetter AssignUsers = show . requestUsers
propGetter CommentOnAssign = show . commentOnRequest

export
getConfig : Config =>
Expand Down
30 changes: 7 additions & 23 deletions src/Data/Config.idr
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,6 @@ data SettableProp : (name : String) -> (help : String) -> Type where
want to set a PAT via the GITHUB_PAT environment variable.
"""

-- TODO 5.0.0: remove deprecated aliases below
AssignTeams : SettableProp
"assignTeams"
"[true/false] Deprecated alias for the 'requestTeams' config option."
AssignUsers : SettableProp
"assignUsers"
"[true/false] Deprecated alias for the 'requestUsers' config option."
CommentOnAssign : SettableProp
"commentOnAssign"
"[true/false] Deprecated alias for the 'commentOnRequest' config option."

public export
SomeSettableProp : Type
SomeSettableProp = (n ** h ** SettableProp n h)
Expand All @@ -193,9 +182,6 @@ settablePropNamed "mainBranch" = Just $ Evidence _ MainBranch
settablePropNamed "theme" = Just $ Evidence _ ThemeProp
settablePropNamed "githubPAT" = Just $ Evidence _ GithubPAT
settablePropNamed "requestUsers" = Just $ Evidence _ RequestUsers
settablePropNamed "assignTeams" = Just $ Evidence _ AssignTeams
settablePropNamed "assignUsers" = Just $ Evidence _ AssignUsers
settablePropNamed "commentOnAssign" = Just $ Evidence _ CommentOnAssign
settablePropNamed _ = Nothing

namespace SettablePropNamedProperties
Expand All @@ -215,9 +201,6 @@ settableProps = [
, (_ ** _ ** MainBranch)
, (_ ** _ ** ThemeProp)
, (_ ** _ ** GithubPAT)
, (_ ** _ ** AssignUsers)
, (_ ** _ ** AssignTeams)
, (_ ** _ ** CommentOnAssign)
]

namespace SettablePropsProperties
Expand Down Expand Up @@ -336,6 +319,9 @@ parseConfig ephemeral = (mapFst (const "Failed to parse JSON") . parseJSON Virtu
, defaultRemote
, repoLabels
, ignoredPRs
, requestTeams
, requestUsers
, commentOnRequest
] <-
lookupAll [
"updatedAt"
Expand All @@ -347,12 +333,10 @@ parseConfig ephemeral = (mapFst (const "Failed to parse JSON") . parseJSON Virtu
, "defaultRemote"
, "repoLabels"
, "ignoredPRs"
, "requestTeams"
, "requestUsers"
, "commentOnRequest"
] config
-- TODO 5.0.0: Stop supporting the old aliases "assign..." and move the
-- new "request..." versions into the required lookup above.
requestTeams <- exactlyOneOf "assignTeams" "requestTeams"
requestUsers <- exactlyOneOf "assignUsers" "requestUsers"
commentOnRequest <- exactlyOneOf "commentOnAssign" "commentOnRequest"
let maybeGithubPAT = lookup "githubPAT" config
let maybeTheme = lookup "theme" config
ua <- cast <$> integer updatedAt
Expand All @@ -369,7 +353,7 @@ parseConfig ephemeral = (mapFst (const "Failed to parse JSON") . parseJSON Virtu
om <- array string orgMembers
ip <- array integer ignoredPRs
gp <- maybe (Right Nothing) (optional string) maybeGithubPAT
-- TODO 5.0.0: Make theme required part of config file (default to dark still)
-- TODO 6.0.0: Make theme required part of config file (default to dark still)
-- theme lookup can be moved to the required lookupAll above.
th <- maybe (Right Dark)
(stringy "dark or light" parseString)
Expand Down
6 changes: 1 addition & 5 deletions src/Help.idr
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ subcommandHelp' n@"reflect" = subcommand n [] [reflow "Reflect on the current st
subcommandHelp' n@"list" = subcommand n [argument False "<team-slug>"] ["List all teams or the members of the given GitHub Team."]
subcommandHelp' n@"health" = subcommand n [] [reflow "Graph all open PRs grouped by the month they were created."]
subcommandHelp' n@"rq" = subcommand n [] ["Alias for 'request' command."]
subcommandHelp' n@"assign" = subcommand n [] [warning "Deprecated alias for 'request' command."]
-- TODO 5.0.0: ^ remove deprecated command help
subcommandHelp' c = pretty "Unreconized command: \{c}"

||| Print help for a particular subcommand.
Expand All @@ -121,9 +119,7 @@ helpDocs : Doc AnsiStyle
helpDocs = vsep
[ "harmony" <++> subcommand' "<subcommand>"
, heading "Subcommands" $ vsep
[ subcommandHelp' "assign"
-- TODO 5.0.0: ^ remove deprecated command help
, subcommandHelp' "branch"
[ subcommandHelp' "branch"
, subcommandHelp' "config"
, subcommandHelp' "contribute"
, subcommandHelp' "graph"
Expand Down
9 changes: 0 additions & 9 deletions src/Main.idr
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,6 @@ handleAuthenticatedArgs @{config} ("graph" :: args) =
case (parseGraphArgs args) of
Right args => Commands.graph args
Left err => exitError err

-- TODO 5.0.0: Remove the aliases for the deprecated assign command.
handleAuthenticatedArgs ("assign" :: "--dry" :: requestRest) = do
printWarning "The 'assign' command is a deprecated alias for the new 'request' command."
Commands.request requestRest {dry=True}
handleAuthenticatedArgs ("assign" :: requestRest) = do
printWarning "The 'assign' command is a deprecated alias for the new 'request' command."
Commands.request requestRest

handleAuthenticatedArgs ("rq" :: "--dry" :: requestRest) =
Commands.request requestRest {dry=True}
handleAuthenticatedArgs ("request" :: "--dry" :: requestRest) =
Expand Down
5 changes: 1 addition & 4 deletions test/expected_help.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
harmony <subcommand>

Subcommands:
assign
Deprecated alias for 'request' command.
branch
Print the GitHub URI for the currently checked out branch.
config {<property>} [<value>]
Get or set the value of a configuration property. Not all properties can
be set and read via this subcommand.
properties: requestTeams, requestUsers, commentOnRequest, defaultRemote,
mainBranch, theme, githubPAT, assignUsers, assignTeams,
commentOnAssign
mainBranch, theme, githubPAT
contribute [-c/--checkout | -l/--list] [-<num>] [-i/--ignore {<uri>/<pr-number>}]
Contribute to an open PR. Prints a URL. Prioritizes PRs you are requested
to review but will also return other PRs.
Expand Down

0 comments on commit cf28f1d

Please sign in to comment.