commit ghc-github for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-github for openSUSE:Factory checked in at 2017-08-31 20:47:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-github (Old) and /work/SRC/openSUSE:Factory/.ghc-github.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-github" Thu Aug 31 20:47:16 2017 rev:3 rq:513253 version:0.16.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-github/ghc-github.changes 2017-05-10 20:49:30.439400258 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-github.new/ghc-github.changes 2017-08-31 20:47:16.704806348 +0200 @@ -1,0 +2,5 @@ +Thu Jul 27 14:07:55 UTC 2017 - psimons@suse.com + +- Update to version 0.16.0. + +------------------------------------------------------------------- Old: ---- github-0.15.0.tar.gz github.cabal New: ---- github-0.16.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-github.spec ++++++ --- /var/tmp/diff_new_pack.109juq/_old 2017-08-31 20:47:17.496695195 +0200 +++ /var/tmp/diff_new_pack.109juq/_new 2017-08-31 20:47:17.500694634 +0200 @@ -19,14 +19,13 @@ %global pkg_name github %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.15.0 +Version: 0.16.0 Release: 0 Summary: Access to the GitHub API, v3 License: BSD-3-Clause Group: Development/Languages/Other Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz -Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/3.cabal#/%{pkg_name}.cabal BuildRequires: ghc-Cabal-devel BuildRequires: ghc-aeson-compat-devel BuildRequires: ghc-aeson-devel @@ -92,7 +91,6 @@ %prep %setup -q -n %{pkg_name}-%{version} -cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ github-0.15.0.tar.gz -> github-0.16.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/CHANGELOG.md new/github-0.16.0/CHANGELOG.md --- old/github-0.15.0/CHANGELOG.md 2016-11-04 19:15:15.000000000 +0100 +++ new/github-0.16.0/CHANGELOG.md 2017-07-24 17:00:33.000000000 +0200 @@ -1,3 +1,11 @@ +Changes for 0.16.0 +- Add support for `mergeable_state = "blocked".` +- Fix HTTP status code of merge PR +- Supports newest versions of dependencies +- user events +- release endpoints +- forkExistingRepo + Changes for 0.15.0 - Reworked `PullRequest` (notably `pullRequestsFor`) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/github.cabal new/github-0.16.0/github.cabal --- old/github-0.15.0/github.cabal 2016-11-04 19:15:15.000000000 +0100 +++ new/github-0.16.0/github.cabal 2017-07-24 17:00:33.000000000 +0200 @@ -1,5 +1,5 @@ name: github -version: 0.15.0 +version: 0.16.0 synopsis: Access to the GitHub API, v3. description: The GitHub API provides programmatic access to the full @@ -25,7 +25,7 @@ copyright: Copyright 2012-2013 Mike Burns, Copyright 2013-2015 John Wiegley, Copyright 2016 Oleg Grenrus category: Network build-type: Simple -tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.1 +tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.1 cabal-version: >=1.10 extra-source-files: README.md, @@ -81,6 +81,7 @@ GitHub.Data.Name GitHub.Data.Options GitHub.Data.PullRequests + GitHub.Data.Releases GitHub.Data.Repos GitHub.Data.Request GitHub.Data.Search @@ -111,20 +112,21 @@ GitHub.Endpoints.Repos.Collaborators GitHub.Endpoints.Repos.Comments GitHub.Endpoints.Repos.Commits + GitHub.Endpoints.Repos.DeployKeys GitHub.Endpoints.Repos.Forks + GitHub.Endpoints.Repos.Releases GitHub.Endpoints.Repos.Webhooks - GitHub.Endpoints.Repos.DeployKeys GitHub.Endpoints.Search GitHub.Endpoints.Users GitHub.Endpoints.Users.Followers GitHub.Request -- Packages needed in order to build this package. - build-depends: base >=4.7 && <4.10, - aeson >=0.7.0.6 && <1.1, + build-depends: base >=4.7 && <4.11, + aeson >=0.7.0.6 && <1.3, base-compat >=0.9.1 && <0.10, base16-bytestring >=0.1.1.6 && <0.2, - binary >=0.7.1.0 && <0.9, + binary >=0.7.1.0 && <0.10, binary-orphans >=0.1.0.0 && <0.2, byteable >=0.1.1 && <0.2, bytestring >=0.10.4.0 && <0.11, @@ -143,12 +145,12 @@ network-uri >=2.6.0.3 && <2.7, semigroups >=0.16.2.2 && <0.19, text >=1.2.0.6 && <1.3, - time >=1.4 && <1.7, + time >=1.4 && <1.9, transformers >=0.3.0.0 && <0.6, transformers-compat >=0.4.0.3 && <0.6, unordered-containers >=0.2 && <0.3, - vector >=0.10.12.3 && <0.12, - vector-instances >=3.3.0.1 && <3.4, + vector >=0.10.12.3 && <0.13, + vector-instances >=3.3.0.1 && <3.5, tls >=1.3.5 @@ -169,9 +171,11 @@ GitHub.OrganizationsSpec GitHub.IssuesSpec GitHub.PullRequestsSpec + GitHub.ReleasesSpec GitHub.ReposSpec GitHub.SearchSpec GitHub.UsersSpec + GitHub.EventsSpec main-is: Spec.hs ghc-options: -Wall build-depends: base, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/spec/GitHub/EventsSpec.hs new/github-0.16.0/spec/GitHub/EventsSpec.hs --- old/github-0.15.0/spec/GitHub/EventsSpec.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/github-0.16.0/spec/GitHub/EventsSpec.hs 2017-07-24 17:00:33.000000000 +0200 @@ -0,0 +1,36 @@ +{-# LANGUAGE OverloadedStrings #-} +module GitHub.EventsSpec where + +import Data.Either (isRight) +import Data.String (fromString) +import Prelude () +import Prelude.Compat +import System.Environment (lookupEnv) +import Test.Hspec (Spec, describe, it, shouldSatisfy, + pendingWith) + +import qualified GitHub +import GitHub.Data (Auth(..)) + +fromRightS :: Show a => Either a b -> b +fromRightS (Left xs) = error $ "Should be Right" ++ show xs +fromRightS (Right xs) = xs + +withAuth :: (Auth -> IO ()) -> IO () +withAuth action = do + mtoken <- lookupEnv "GITHUB_TOKEN" + case mtoken of + Nothing -> pendingWith "no GITHUB_TOKEN" + Just token -> action (OAuth $ fromString token) + +spec :: Spec +spec = do + describe "repositoryEventsR" $ do + it "returns non empty list of events" $ shouldSucceed $ + GitHub.repositoryEventsR "phadej" "github" 1 + describe "userEventsR" $ do + it "returns non empty list of events" $ shouldSucceed $ GitHub.userEventsR "phadej" 1 + where shouldSucceed f = withAuth $ \auth -> do + cs <- GitHub.executeRequest auth $ f + cs `shouldSatisfy` isRight + length (fromRightS cs) `shouldSatisfy` (> 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/spec/GitHub/ReleasesSpec.hs new/github-0.16.0/spec/GitHub/ReleasesSpec.hs --- old/github-0.15.0/spec/GitHub/ReleasesSpec.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/github-0.16.0/spec/GitHub/ReleasesSpec.hs 2017-07-24 17:00:33.000000000 +0200 @@ -0,0 +1,54 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TemplateHaskell #-} +module GitHub.ReleasesSpec where + +import qualified GitHub + +import GitHub.Auth (Auth (..)) +import GitHub.Endpoints.Repos.Releases + (Release (..), latestReleaseR, releaseByTagNameR, releaseR, releasesR) +import GitHub.Request (executeRequest) + +import Data.Either.Compat (isRight) +import Data.Proxy (Proxy (..)) +import Data.String (fromString) +import System.Environment (lookupEnv) +import Test.Hspec + (Spec, describe, it, pendingWith, shouldBe, shouldSatisfy) + +import qualified Data.Vector as V + +fromRightS :: Show a => Either a b -> b +fromRightS (Right b) = b +fromRightS (Left a) = error $ "Expected a Right and got a Left" ++ show a + +withAuth :: (Auth -> IO ()) -> IO () +withAuth action = do + mtoken <- lookupEnv "GITHUB_TOKEN" + case mtoken of + Nothing -> pendingWith "no GITHUB_TOKEN" + Just token -> action (OAuth $ fromString token) + +spec :: Spec +spec = do + let v154Id = GitHub.mkId (Proxy :: Proxy Release) 5254449 + v154Text = "v1.5.4" + describe "releasesR" $ do + it "works" $ withAuth $ \auth -> do + rs <- executeRequest auth $ releasesR "calleerlandsson" "pick" GitHub.FetchAll + rs `shouldSatisfy` isRight + V.length (fromRightS rs) `shouldSatisfy` (> 14) + describe "releaseR" $ do + it "works" $ withAuth $ \auth -> do + rs <- executeRequest auth $ releaseR "calleerlandsson" "pick" v154Id + rs `shouldSatisfy` isRight + releaseTagName (fromRightS rs)`shouldBe` v154Text + describe "latestReleaseR" $ do + it "works" $ withAuth $ \auth -> do + rs <- executeRequest auth $ latestReleaseR "calleerlandsson" "pick" + rs `shouldSatisfy` isRight + describe "releaseByTagNameR" $ do + it "works" $ withAuth $ \auth -> do + rs <- executeRequest auth $ releaseByTagNameR "calleerlandsson" "pick" v154Text + rs `shouldSatisfy` isRight + releaseId (fromRightS rs)`shouldBe` v154Id diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Data/Options.hs new/github-0.16.0/src/GitHub/Data/Options.hs --- old/github-0.15.0/src/GitHub/Data/Options.hs 2016-11-04 19:15:15.000000000 +0100 +++ new/github-0.16.0/src/GitHub/Data/Options.hs 2017-07-24 17:00:33.000000000 +0200 @@ -95,6 +95,7 @@ | StateClean | StateDirty | StateUnstable + | StateBlocked deriving (Eq, Ord, Show, Enum, Bounded, Generic, Typeable, Data) @@ -103,13 +104,15 @@ toJSON StateClean = String "clean" toJSON StateDirty = String "dirty" toJSON StateUnstable = String "unstable" + toJSON StateBlocked = String "blocked" instance FromJSON MergeableState where parseJSON (String "unknown") = pure StateUnknown parseJSON (String "clean") = pure StateClean parseJSON (String "dirty") = pure StateDirty parseJSON (String "unstable") = pure StateUnstable - parseJSON v = typeMismatch "MergeableState" v + parseJSON (String "blocked") = pure StateBlocked + parseJSON v = typeMismatch "MergeableState" v instance NFData MergeableState where rnf = genericRnf instance Binary MergeableState diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Data/PullRequests.hs new/github-0.16.0/src/GitHub/Data/PullRequests.hs --- old/github-0.15.0/src/GitHub/Data/PullRequests.hs 2016-11-04 19:15:15.000000000 +0100 +++ new/github-0.16.0/src/GitHub/Data/PullRequests.hs 2017-07-24 17:00:33.000000000 +0200 @@ -90,6 +90,9 @@ { editPullRequestTitle :: !(Maybe Text) , editPullRequestBody :: !(Maybe Text) , editPullRequestState :: !(Maybe IssueState) + , editPullRequestBase :: !(Maybe Text) + , editPullRequestMaintainerCanModify + :: !(Maybe Bool) } deriving (Show, Generic) @@ -198,8 +201,15 @@ <*> o .: "id" instance ToJSON EditPullRequest where - toJSON (EditPullRequest t b s) = - object $ filter notNull [ "title" .= t, "body" .= b, "state" .= s ] + toJSON (EditPullRequest t b s base mcm) = + object $ filter notNull + [ "title" .= t + , "body" .= b + , "state" .= s + , "base" .= base + , "maintainer_can_modify" + .= mcm + ] where notNull (_, Null) = False notNull (_, _) = True @@ -299,7 +309,7 @@ statusMerge :: StatusMap MergeResult statusMerge = - [ (204, MergeSuccessful) + [ (200, MergeSuccessful) , (405, MergeCannotPerform) , (409, MergeConflict) ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Data/Releases.hs new/github-0.16.0/src/GitHub/Data/Releases.hs --- old/github-0.15.0/src/GitHub/Data/Releases.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/github-0.16.0/src/GitHub/Data/Releases.hs 2017-07-24 17:00:33.000000000 +0200 @@ -0,0 +1,85 @@ +module GitHub.Data.Releases where + +import GitHub.Data.Definitions +import GitHub.Data.Id (Id) +import GitHub.Data.URL (URL) +import GitHub.Internal.Prelude +import Prelude () + +data Release = Release + { releaseUrl :: !URL + , releaseHtmlUrl :: !URL + , releaseAssetsurl :: !URL + , releaseUploadUrl :: !URL + , releaseTarballUrl :: !URL + , releaseZipballUrl :: !URL + , releaseId :: !(Id Release) + , releaseTagName :: !Text + , releaseTargetCommitish :: !Text + , releaseName :: !Text + , releaseBody :: !Text + , releaseDraft :: !Bool + , releasePrerelease :: !Bool + , releaseCreatedAt :: !UTCTime + , releasePublishedAt :: !(Maybe UTCTime) + , releaseAuthor :: !SimpleUser + , releaseAssets :: !(Vector ReleaseAsset) + } + deriving (Show, Data, Typeable, Eq, Ord, Generic) + +instance FromJSON Release where + parseJSON = withObject "Event" $ \o -> Release + <$> o .: "url" + <*> o .: "html_url" + <*> o .: "assets_url" + <*> o .: "upload_url" + <*> o .: "tarball_url" + <*> o .: "zipball_url" + <*> o .: "id" + <*> o .: "tag_name" + <*> o .: "target_commitish" + <*> o .: "name" + <*> o .: "body" + <*> o .: "draft" + <*> o .: "prerelease" + <*> o .: "created_at" + <*> o .:? "published_at" + <*> o .: "author" + <*> o .: "assets" + +instance NFData Release where rnf = genericRnf +instance Binary Release + +data ReleaseAsset = ReleaseAsset + { releaseAssetUrl :: !URL + , releaseAssetBrowserDownloadUrl :: !Text + , releaseAssetId :: !(Id ReleaseAsset) + , releaseAssetName :: !Text + , releaseAssetLabel :: !(Maybe Text) + , releaseAssetState :: !Text + , releaseAssetContentType :: !Text + , releaseAssetSize :: !Int + , releaseAssetDownloadCount :: !Int + , releaseAssetCreatedAt :: !UTCTime + , releaseAssetUpdatedAt :: !UTCTime + , releaseAssetUploader :: !SimpleUser + } + deriving (Show, Data, Typeable, Eq, Ord, Generic) + +instance FromJSON ReleaseAsset where + parseJSON = withObject "Event" $ \o -> ReleaseAsset + <$> o .: "url" + <*> o .: "browser_download_url" + <*> o .: "id" + <*> o .: "name" + <*> o .:? "label" + <*> o .: "state" + <*> o .: "content_type" + <*> o .: "size" + <*> o .: "download_count" + <*> o .: "created_at" + <*> o .: "updated_at" + <*> o .: "uploader" + +instance NFData ReleaseAsset where rnf = genericRnf +instance Binary ReleaseAsset diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Data.hs new/github-0.16.0/src/GitHub/Data.hs --- old/github-0.15.0/src/GitHub/Data.hs 2016-11-04 19:15:15.000000000 +0100 +++ new/github-0.16.0/src/GitHub/Data.hs 2017-07-24 17:00:33.000000000 +0200 @@ -43,6 +43,7 @@ module GitHub.Data.Milestone, module GitHub.Data.Options, module GitHub.Data.PullRequests, + module GitHub.Data.Releases, module GitHub.Data.Repos, module GitHub.Data.Request, module GitHub.Data.Search, @@ -69,6 +70,7 @@ import GitHub.Data.Name import GitHub.Data.Options import GitHub.Data.PullRequests +import GitHub.Data.Releases import GitHub.Data.Repos import GitHub.Data.Request import GitHub.Data.Search diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Endpoints/Activity/Events.hs new/github-0.16.0/src/GitHub/Endpoints/Activity/Events.hs --- old/github-0.15.0/src/GitHub/Endpoints/Activity/Events.hs 2016-11-04 19:15:15.000000000 +0100 +++ new/github-0.16.0/src/GitHub/Endpoints/Activity/Events.hs 2017-07-24 17:00:33.000000000 +0200 @@ -7,6 +7,7 @@ module GitHub.Endpoints.Activity.Events ( -- * Events repositoryEventsR, + userEventsR, module GitHub.Data, ) where @@ -19,3 +20,9 @@ repositoryEventsR :: Name Owner -> Name Repo -> FetchCount -> Request 'RO (Vector Event) repositoryEventsR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "events"] [] + +-- | List user public events. +-- See <https://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user> +userEventsR :: Name User -> FetchCount -> Request 'RO (Vector Event) +userEventsR user = + pagedQuery ["users", toPathPart user, "events", "public"] [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Endpoints/PullRequests.hs new/github-0.16.0/src/GitHub/Endpoints/PullRequests.hs --- old/github-0.15.0/src/GitHub/Endpoints/PullRequests.hs 2016-11-04 19:15:15.000000000 +0100 +++ new/github-0.16.0/src/GitHub/Endpoints/PullRequests.hs 2017-07-24 17:00:33.000000000 +0200 @@ -7,6 +7,7 @@ -- <http://developer.github.com/v3/pulls/>. module GitHub.Endpoints.PullRequests ( pullRequestsFor, + pullRequestsFor', pullRequestsForR, pullRequest', pullRequest, @@ -40,6 +41,13 @@ pullRequestsFor user repo = executeRequest' $ pullRequestsForR user repo mempty FetchAll +-- | All open pull requests for the repo, by owner and repo name. +-- +-- > pullRequestsFor "rails" "rails" +pullRequestsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimplePullRequest)) +pullRequestsFor' auth user repo = + executeRequestMaybe auth $ pullRequestsForR user repo mempty FetchAll + -- | List pull requests. -- See <https://developer.github.com/v3/pulls/#list-pull-requests> pullRequestsForR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Endpoints/Repos/Releases.hs new/github-0.16.0/src/GitHub/Endpoints/Repos/Releases.hs --- old/github-0.15.0/src/GitHub/Endpoints/Repos/Releases.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/github-0.16.0/src/GitHub/Endpoints/Repos/Releases.hs 2017-07-24 17:00:33.000000000 +0200 @@ -0,0 +1,110 @@ +-- The Release API, as described at +-- <https://developer.github.com/v3/repos/releases/>. +module GitHub.Endpoints.Repos.Releases ( + releases, + releases', + releasesR, + release, + release', + releaseR, + latestRelease, + latestRelease', + latestReleaseR, + releaseByTagName, + releaseByTagName', + releaseByTagNameR, + module GitHub.Data, + ) where + +import GitHub.Data +import GitHub.Internal.Prelude +import GitHub.Request +import Prelude () + +-- | All releases for the given repo. +-- +-- > releases "calleerlandsson" "pick" +releases :: Name Owner -> Name Repo -> IO (Either Error (Vector Release)) +releases = releases' Nothing + +-- | All releases for the given repo with authentication. +-- +-- > releases' (Just (User (user, password))) "calleerlandsson" "pick" +releases' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Release)) +releases' auth user repo = + executeRequestMaybe auth $ releasesR user repo FetchAll + +-- | List releases for a repository. +-- See <https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository> +releasesR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Release) +releasesR user repo = + pagedQuery ["repos", toPathPart user, toPathPart repo, "releases"] [] + +-- | Query a single release. +-- +-- > release "calleerlandsson" "pick" +release :: Name Owner -> Name Repo -> Id Release -> IO (Either Error Release) +release = release' Nothing + +-- | Query a single release with authentication. +-- +-- > release' (Just (User (user, password))) "calleerlandsson" "pick" +release' :: Maybe Auth -> Name Owner -> Name Repo -> Id Release -> IO (Either Error Release) +release' auth user repo reqReleaseId = + executeRequestMaybe auth $ releaseR user repo reqReleaseId + +-- | Get a single release. +-- See <https://developer.github.com/v3/repos/releases/#get-a-single-release> +releaseR :: Name Owner -> Name Repo -> Id Release -> Request k Release +releaseR user repo reqReleaseId = + query ["repos", toPathPart user, toPathPart repo, "releases", toPathPart reqReleaseId ] [] + +-- | Query latest release. +-- +-- > latestRelease "calleerlandsson" "pick" +latestRelease :: Name Owner -> Name Repo -> IO (Either Error Release) +latestRelease = latestRelease' Nothing + +-- | Query latest release with authentication. +-- +-- > latestRelease' (Just (User (user, password))) "calleerlandsson" "pick" +latestRelease' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Release) +latestRelease' auth user repo = + executeRequestMaybe auth $ latestReleaseR user repo + +-- | Get the latest release. +-- See <https://developer.github.com/v3/repos/releases/#get-the-latest-release> +latestReleaseR :: Name Owner -> Name Repo -> Request k Release +latestReleaseR user repo = + query ["repos", toPathPart user, toPathPart repo, "releases", "latest" ] [] + +-- | Query release by tag name. +-- +-- > releaseByTagName "calleerlandsson" "pick" +releaseByTagName :: Name Owner -> Name Repo -> Text -> IO (Either Error Release) +releaseByTagName = releaseByTagName' Nothing + +-- | Query release by tag name with authentication. +-- +-- > releaseByTagName' (Just (User (user, password))) "calleerlandsson" "pick" +releaseByTagName' :: Maybe Auth -> Name Owner -> Name Repo -> Text -> IO (Either Error Release) +releaseByTagName' auth user repo reqTagName = + executeRequestMaybe auth $ releaseByTagNameR user repo reqTagName + +-- | Get a release by tag name +-- See <https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name> +releaseByTagNameR :: Name Owner -> Name Repo -> Text -> Request k Release +releaseByTagNameR user repo reqTagName = + query ["repos", toPathPart user, toPathPart repo, "releases", "tags" , reqTagName ] [] + +{- +-- TODO: implement the following: + https://developer.github.com/v3/repos/releases/#create-a-release + https://developer.github.com/v3/repos/releases/#edit-a-release + https://developer.github.com/v3/repos/releases/#delete-a-release + https://developer.github.com/v3/repos/releases/#list-assets-for-a-release + https://developer.github.com/v3/repos/releases/#upload-a-release-asset + https://developer.github.com/v3/repos/releases/#get-a-single-release-asset + https://developer.github.com/v3/repos/releases/#edit-a-release-asset + https://developer.github.com/v3/repos/releases/#delete-a-release-asset +-} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub/Endpoints/Repos.hs new/github-0.16.0/src/GitHub/Endpoints/Repos.hs --- old/github-0.15.0/src/GitHub/Endpoints/Repos.hs 2016-11-04 19:15:15.000000000 +0100 +++ new/github-0.16.0/src/GitHub/Endpoints/Repos.hs 2017-07-24 17:00:33.000000000 +0200 @@ -42,6 +42,7 @@ createRepoR, createOrganizationRepo', createOrganizationRepoR, + forkExistingRepoR, -- ** Edit editRepo, @@ -172,6 +173,13 @@ createRepoR nrepo = command Post ["user", "repos"] (encode nrepo) +-- | Fork an existing repository. +-- See <https://developer.github.com/v3/repos/forks/#create-a-fork> +-- TODO: The third paramater (an optional Organisation) is not used yet. +forkExistingRepoR :: Name Owner -> Name Repo -> Maybe (Name Owner) -> Request 'RW Repo +forkExistingRepoR owner repo _morg = + command Post ["repos", toPathPart owner, toPathPart repo, "forks" ] mempty + -- | Create a new repository for an organization. -- -- > createOrganizationRepo (BasicAuth (user, password)) "thoughtbot" (newRepo "some_repo") {newRepoHasIssues = Just False} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/github-0.15.0/src/GitHub.hs new/github-0.16.0/src/GitHub.hs --- old/github-0.15.0/src/GitHub.hs 2016-11-04 19:15:15.000000000 +0100 +++ new/github-0.16.0/src/GitHub.hs 2017-07-24 17:00:33.000000000 +0200 @@ -18,7 +18,7 @@ -- ** Events -- | See https://developer.github.com/v3/activity/events/#events repositoryEventsR, - + userEventsR, -- ** Starring -- | See <https://developer.github.com/v3/activity/starring/> -- @@ -270,6 +270,12 @@ pingRepoWebhookR, deleteRepoWebhookR, + -- * Releases + releasesR, + releaseR, + latestReleaseR, + releaseByTagNameR, + -- * Search -- | See <https://developer.github.com/v3/search/> -- @@ -334,6 +340,7 @@ import GitHub.Endpoints.Repos.Comments import GitHub.Endpoints.Repos.Commits import GitHub.Endpoints.Repos.Forks +import GitHub.Endpoints.Repos.Releases import GitHub.Endpoints.Repos.Webhooks import GitHub.Endpoints.Search import GitHub.Endpoints.Users
participants (1)
-
root@hilbert.suse.de