haskell-github / github Goto Github PK
View Code? Open in Web Editor NEWThe github API for Haskell
Home Page: https://hackage.haskell.org/package/github
License: BSD 3-Clause "New" or "Revised" License
The github API for Haskell
Home Page: https://hackage.haskell.org/package/github
License: BSD 3-Clause "New" or "Revised" License
Building github-0.7.4...
Preprocessing library github-0.7.4...
[ 1 of 26] Compiling Github.Data.Definitions ( Github/Data/Definitions.hs, dist/build/Github/Data/Definitions.o )
[ 2 of 26] Compiling Github.Data ( Github/Data.hs, dist/build/Github/Data.o )
Github/Data.hs:14:1: Warning:
The import of `Data.Monoid' is redundant
except perhaps to import instances from `Data.Monoid'
To import instances alone, use: import Data.Monoid()
Github/Data.hs:539:1: Warning:
Pattern match(es) are non-exhaustive
In an equation for `<.:>': Patterns not matched: _ []
[ 3 of 26] Compiling Github.Private ( Github/Private.hs, dist/build/Github/Private.o )
Github/Private.hs:17:22:
Module `Data.Conduit' does not export `ResourceT'
Prelude> :t Github.commitCommentsFor
Github.commitCommentsFor
:: String -> String -> String -> IO (Either Github.Error [Github.Comment])
At minimum, these should be type aliases but that still permits the possibility of transposition errors and makes consumption of the API in-place still unclear. Ideally, all the Stringly nonsense should be placed with newtypes.
An example from Bloodhound:
posQuery = QueryMatchQuery $ mkMatchQuery (FieldName "user") (QueryString "bitemyapp")
I don't have to guess what "user" and "bitemyapp" are - the code tells me.
You derive Show, why not Read too?
I needed some Read so I had to learn about standalone deriving and use code like this:
{-# LANGUAGE StandaloneDeriving #-} deriving instance Read GithubDate deriving instance Read GithubUser deriving instance Read Repo
Suggestion by @joeyh: implement ToJSON for each data type.
There aren't versions of APIs in Github.Issues.Events that take Maybe GithubAuth. Which hurts when I'm doing enough to get rate-limited.
Support for this part of the API seems missing. http://developer.github.com/v3/repos/hooks/
% runhaskell samples/Issues/ShowIssue.hs
Error: JsonError "when expecting a String, encountered Object instead on the JSON: {\"title\":\"Add docs on how to enable a specific storage type\",\"url\":\"https://api.github.com/repos/thoughtbot/paperclip/issues/549\",\"closed_by\":{\"url\":\"https://api.github.com/users/sikachu\",\"avatar_url\":\"https://secure.gravatar.com/avatar/57240e72c8912c80bec2deda9b57d483?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"57240e72c8912c80bec2deda9b57d483\",\"login\":\"sikachu\",\"id\":4912},\"created_at\":\"2011-08-09T18:45:43Z\",\"labels\":[{\"url\":\"https://api.github.com/repos/thoughtbot/paperclip/labels/docs\",\"color\":\"02e10c\",\"name\":\"docs\"}],\"number\":549,\"body\":\"e.g. `:storage => :s3`\",\"html_url\":\"https://github.com/thoughtbot/paperclip/issues/549\",\"pull_request\":{\"patch_url\":null,\"html_url\":null,\"diff_url\":null},\"assignee\":null,\"updated_at\":\"2011-12-13T19:12:40Z\",\"comments\":3,\"state\":\"closed\",\"milestone\":null,\"id\":1374450,\"closed_at\":\"2011-12-13T19:12:40Z\",\"user\":{\"url\":\"https://api.github.com/users/gabebw\",\"avatar_url\":\"https://secure.gravatar.com/avatar/1a3fec33b61038721fd4e609c1d1a4b7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"1a3fec33b61038721fd4e609c1d1a4b7\",\"login\":\"gabebw\",\"id\":257678}}"
Only 30 items max are returned by any query. This is quite bad for github-backup, which wants every item.
The github api has a pagination interface. See http://developer.github.com/v3/#pagination
The api includes a way to find the parent that a repo was forked off of. For example, see curl -i 'https://api.github.com/repos/martijnvermaat/github-backup'
"parent": { "clone_url": "https://github.com/joeyh/github-backup.git",
(The parent field is not present in repos that were not forked from anywhere.)
Without this info, it's not possible to traverse from a fork to its parents, thus the complete fork graph for an arbitrary repo cannot be walked.
I think that userRepo should return this info. Perhaps by adding to Repo
a field parent :: Maybe Repo
Currently it's not possible to discover the parent repository that a repo was forked from. The API reference says:
"The parent and source objects are present when the repo is a fork. parent is the repo this repo was forked from, source is the ultimate source for the network."
So, please add new fields to Repo like:
repoParent :: Maybe Repo
repoSource :: Maybe Repo
These should be populated by at least userRepo (unsure if other parts of the API expose them, probably not).
I got started on a patch for this, in joeyh/github moreinfo branch, but it fails to parse out Repos from the parent and source fields. The problem is that FromJSON Repo expects a number of fields like open_issues, that are not included in here:
"parent": {
"id": 2677437,
"name": "github",
"full_name": "fpco/github",
"owner": {
"login": "fpco",
"id": 2163372,
"avatar_url": "https://0.gravatar.com/avatar/a8b5fc6144a9383e39cc757ff569da0a?d=https%3A%2F%2Fidenticons.github.com%2Fd2a558032863da5e146585d9260d7402.png&r=x",
"gravatar_id": "a8b5fc6144a9383e39cc757ff569da0a",
"url": "https://api.github.com/users/fpco",
"html_url": "https://github.com/fpco",
"followers_url": "https://api.github.com/users/fpco/followers",
"following_url": "https://api.github.com/users/fpco/following{/other_user}",
"gists_url": "https://api.github.com/users/fpco/gists{/gist_id}",
"starred_url": "https://api.github.com/users/fpco/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/fpco/subscriptions",
"organizations_url": "https://api.github.com/users/fpco/orgs",
"repos_url": "https://api.github.com/users/fpco/repos",
"events_url": "https://api.github.com/users/fpco/events{/privacy}",
"received_events_url": "https://api.github.com/users/fpco/received_events",
"type": "Organization",
"site_admin": false
},
Perhaps instead:
data RepoRef = RepoRef GithubOwner String -- Repo owner and name
repoParent :: Maybe RepoRef
repoSource :: Maybe RepoRef
Hi,
due to rate limiting, I should only use authenticated requests. Unfortunately, not all functions are available in their '
variant, in particular not commit
.
Thanks,
Joachim
There is a new aeson release on hackage, it would be nice to have a matching github release.
After working with this API, and making few others, I found that separating request creation and execution is better (i.e. more flexible) design.
Now one cannot use different network client or add new endpoints.
Shorly
-- New stuff:
data GithubRequest a = GithubRequestGet Url
| ...
-- or alternatively
data GithubRequest a where
GithubRequestGet :: Url -> GithubRequest a
GithubRequestMultiGet :: Url -> GithubRequest [a]
execGithubRequest :: FromJSON a => GithubRequest a -> IO (Either Error a)
execGithubRequest' :: FromJSON a => Maybe GithubAuth -> GithubRequest a -> IO (Either Error a)
publicOrganizationForRequest :: String -> GithubRequest [SimpleOrganisation]
publicOrganizationForRequest org = GithubRequestGet ...
-- Old IO methods become:
publicOrganizationsFor :: String -> IO (Either Error [SimpleOrganization])
publicOrganizationsFor = execGithubRequest . publicOrganizationForRequest
publicOrganizationsFor' :: Maybe GithubAuth -> String -> IO (Either Error [SimpleOrganization])
publicOrganizationsFor' auth = execGithubRequest' auth . publicOrganizationForRequest
How does this sound? I can make a refactoring, it's quite straight-forward.
Debian only ships one version of each haskell library, and http-conduit has been upgraded, so I am trying to get github to build with it. I have the following build failure that I don't know how to fix.
Github/Private.hs:55:16: Couldn't match expected type `resourcet-0.3.2.1:Control.Monad.Trans.Resource.ResourceT IO' with actual type `IO' Expected type: Request (resourcet-0.3.2.1:Control.Monad.Trans.Resource.ResourceT IO) Actual type: Request IO In the first argument of `getResponse', namely `request' In the first argument of `(>>=)', namely `getResponse request'
Github can report language: null for a repo not written in any programming language.
Prelude Github.Repos> userRepo "joeyh" "techtalks" Left (JsonError "when expecting a String, encountered Null instead on the JSON ...
There is a simple fix: Convert the Repo
language
field to Maybe String
.
I was stunned to not need to change any other code. Beautiful code you have here!
Both userRepos
and organizationRepos
cause this 'unknown CA' error. Here's a minimal test case:
module Main where
import Github.Repos
main :: IO ()
main = print =<< userRepos "creswick" All
Results in:
Left (HTTPConnectionError (HandshakeFailed (Error_Protocol ("certificate has unknown CA",True,UnknownCa))))
Here's my complete set of installed dependencies, in the event this is specific to certain versions of libraries:
/home/creswick/myapps/haskell/ghc-7.0.3/lib/ghc-7.0.3/package.conf.d
Cabal-1.10.1.0
array-0.3.0.2
base-4.3.1.0
bin-package-db-0.0.0.0
bytestring-0.9.1.10
containers-0.4.0.0
directory-1.1.0.0
extensible-exceptions-0.1.1.2
ffi-1.0
filepath-1.2.0.0
ghc-7.0.3
ghc-binary-0.5.0.2
ghc-prim-0.2.0.0
haskell2010-1.0.0.0
haskell98-1.1.0.1
hpc-0.5.0.6
integer-gmp-0.2.0.3
old-locale-1.0.0.2
old-time-1.0.0.6
pretty-1.0.1.2
process-1.0.1.5
random-1.0.0.3
rts-1.0
template-haskell-2.5.0.0
time-1.2.0.3
unix-2.4.2.0
/home/creswick/development/github-backup/cabal-dev/packages-7.0.3.conf
HTTP-4000.2.2
aeson-0.6.0.0
asn1-data-0.6.1.3
attoparsec-0.10.1.0
attoparsec-conduit-0.2.0.1
attoparsec-enumerator-0.3
base-unicode-symbols-0.2.2.3
base64-bytestring-0.1.1.1
blaze-builder-0.3.1.0
blaze-builder-conduit-0.2.0.1
case-insensitive-0.4.0.1
cereal-0.3.5.1
certificate-1.1.1
conduit-0.2.2
cookie-0.4.0
cprng-aes-0.2.3
crypto-api-0.9
crypto-pubkey-types-0.1.1
cryptocipher-0.3.0
cryptohash-0.7.4
data-default-0.3.0
deepseq-1.3.0.0
dlist-0.5
entropy-0.2.1
enumerator-0.4.18
failure-0.2.0.1
github-0.2.1
hashable-1.1.2.3
http-conduit-1.2.6
http-types-0.6.10
largeword-1.0.1
lifted-base-0.1.0.3
monad-control-0.3.1.1
mtl-2.0.1.0
network-2.3.0.11
parsec-3.1.2
primitive-0.4.1
regex-base-0.93.2
regex-compat-0.95.1
regex-posix-0.95.1
safe-0.3.3
semigroups-0.8
socks-0.4.1
syb-0.3.6
tagged-0.2.3.1
text-0.11.1.13
tls-0.9.2
tls-extra-0.4.3
transformers-0.2.2.0
transformers-base-0.4.1
unordered-containers-0.1.4.6
uri-0.1.6
utf8-string-0.3.7
vector-0.9.1
zlib-0.5.3.3
zlib-bindings-0.0.3.2
zlib-conduit-0.2.0.1
Spent over an hour looking through the source and Hackage, still not sure if it supports Notifications and Events.
Does this library support every endpoint? If so, please say so.
If not, please say what it does or does not support.
Most of the API now supports authentication, but I found a few functions that don't. This may not be a complete list, it's just all the ones that github-backup uses that don't have a authenticated variant:
userRepo
watchersFor
forksFor
userRepos
(My main interest is not dealing with private repos, but that the API rate limit is quite low when not authenticated.)
As far as I can see, all endpoints like GET /orgs/:org/repos
expose a stargazers_count
parameter for each repository.
The Repo
type has repoWatchers
, repoOpenIssues
, repoForks
but is missing something like repoStargazers
.
Hi,
it seems that this API endpoint is not supported yet:
https://developer.github.com/v3/repos/commits/#compare-two-commits
Greetings,
Joachim
% runhaskell samples/GitData/Blobs/GitHashObject.hs
GitHashObject.hs: StatusCodeException (Status {statusCode = 404, statusMessage = "Not Found"}) [("Server","nginx/1.0.4"),("Date","Sat, 11 Feb 2012 20:29:34 GMT"),("Content-Type","application/json; charset=utf-8"),("Transfer-Encoding","chunked"),("Connection","keep-alive"),("Status","404 Not Found"),("X-RateLimit-Limit","5000"),("ETag","\"e66a7a6c91e2c26803f3f49feb7a883f\""),("X-RateLimit-Remaining","4997"),("Content-Encoding","gzip")]
Right now, in APIv3, watching and starring is the same thing:
λ> Right s <- stargazersFor (Just a) "relrod" "socdiff"
s :: [GithubOwner]
λ> map (T.pack . githubOwnerLogin) s
["Heather","ShadowCreator","relrod","fdelsert"]
it :: [T.Text]
λ> Right s <- watchersFor' (Just a) "relrod" "socdiff"
s :: [GithubOwner]
λ> map (T.pack . githubOwnerLogin) s
["Heather","ShadowCreator","relrod","fdelsert"]
it :: [T.Text]
The way to access real "watcher" info is by using the /subscribers
endpoints.
I will attempt to do this and send a patch over the next few days unless someone gets to it before me. Should be fairly easy to add, I think/hope.
I'll gladly submit a patch. Some things that need to be sorted out:
I'd suggest a signature like this:
verifySecret
:: String -- ^ the secret
-> Maybe String -- ^ the hash provided by the remote party (if any), including 'sha1=...'
-> LBS.ByteString -- ^ the body
-> Bool
(If the hash is Nothing
, it always fails, this is just for convenience.)
Are there any plans to add the GET /user/repos
Endpoint? I can not find it in the documentation.
Current version of http-enumerator is 0.7.2.2 but this module depends on 0.7.2.1. This is blocking getting it packaged for Debian, which already has the new http-enumerator.
Trying to build this library with the newest version of GHC, this error pops up:
Resolving dependencies...
Configuring github-0.13.1...
Building github-0.13.1...
Failed to install github-0.13.1
Build log ( /home/pete/.cabal/logs/github-0.13.1.log ):
Configuring github-0.13.1...
Building github-0.13.1...
Preprocessing library github-0.13.1...
[ 1 of 31] Compiling Github.Repos.Webhooks.Validate ( Github/Repos/Webhooks/Validate.hs, dist/build/Github/Repos/Webhooks/Validate.o )
Github/Repos/Webhooks/Validate.hs:10:1: Warning:
The import of ‘Control.Applicative’ is redundant
except perhaps to import instances from ‘Control.Applicative’
To import instances alone, use: import Control.Applicative()
[ 2 of 31] Compiling Github.Data.Definitions ( Github/Data/Definitions.hs, dist/build/Github/Data/Definitions.o )
[ 3 of 31] Compiling Github.Data ( Github/Data.hs, dist/build/Github/Data.o )
Github/Data.hs:23:20:
Ambiguous occurrence ‘defaultTimeLocale’
It could refer to either ‘Data.Time.defaultTimeLocale’,
imported from ‘Data.Time’ at Github/Data.hs:9:1-16
(and originally defined in ‘time-1.5.0.1:Data.Time.Format.Locale’)
or ‘System.Locale.defaultTimeLocale’,
imported from ‘System.Locale’ at Github/Data.hs:14:23-39
cabal: Error: some packages failed to install:
github-0.13.1 failed during the building phase. The exception was:
ExitFailure 1
I believe this is due to an incompatibility with the newest version of base.
import qualified Github.Gists as Github
main = Github.gist "23084"
returns:
Left (JsonError "Could not build a GithubOwner out of Null on the JSON: ...
Apparently the user information returned by github has changed.
The problem is in:
module Github.Data where
....
instance FromJSON GithubOwner where
....
I've been told that github has changed their API to not work at all unless a user-agent is sent with the request. And apparently, the library does not set one. (Nor provide a way for a client to set one.)
It's horribly long file, which compiles extremely long on GHC 7.10. Is it ok to split it. I'm sure that not all of the types form a single cycle.
Not really an issue, just an idea: Wouldn't GitHub be more appropriate in the hierarchical module names? Say GitHub.Data.Definitions
instead of Github.Data.Definitions
.
Per discussion on #20, I tried building github with certificate-1.2, but http-conduit-1.2.6 requires certificate < 1.2, and bumping the constraint in the github.cabal file to:
http-conduit >= 1.4.1.1 && < 1.4.2
causes the following build failure:
Github/Private.hs:75:16:
Couldn't match expected type `resourcet-0.3.2:Control.Monad.Trans.Resource.ResourceT
IO'
with actual type `IO'
Expected type: Request
(resourcet-0.3.2:Control.Monad.Trans.Resource.ResourceT IO)
Actual type: Request IO
In the first argument of `getResponse', namely `authRequest'
In the first argument of `(>>=)', namely `getResponse authRequest'
cabal: Error: some packages failed to install:
github-0.2.1.1 failed during the building phase. The exception was:
ExitFailure 1
I get this only when building from github master, with the new http-conduit support.
Prelude Github.Issues> Github.Issues.issuesForRepo "aculich" "git-annex" [] *** Exception: StatusCodeException (Status {statusCode = 410, statusMessage = "Gone"}) [("Server","nginx/1.0.4"),("Date","Fri, 27 Jan 2012 19:50:25 GMT"),("Content-Type","application/json; charset=utf-8"),("Connection","keep-alive"),("Status","410 Gone"),("X-RateLimit-Limit","5000"),("ETag","\"814557388adedabd1ec22eb7010d375e\""),("X-RateLimit-Remaining","4500"),("Content-Length","47")]
0.1.2 doesn't throw this exception on http 410, which the API returns when requesting a disabled feature:
Prelude> Github.Issues.issuesForRepo "aculich" "git-annex" [] Left (JsonError "when expecting a [a], encountered Object instead on the JSON: {\"message\":\"Issues are disabled for this repo\"}")
I am trying to delete a repository with this code:
result <- Github.deleteRepo (Github.GithubOAuth token) name repoName
case result of
Left e -> putStrLn $ "Could not delete repository: " ++ show e
_ -> return ())
But I'm always seeing the following error:
Could not delete repository: ParseError "Failed reading: satisfy"
I'll keep tracking this down, just wanted to post it here in case this rings a bell.
The current version of github
doesn't compile for me on Linux/x86_64 with GHC 7.4.2:
Configuring github-0.5.0...
Dependency HTTP -any: using HTTP-4000.2.5
Dependency aeson ==0.6.1.0: using aeson-0.6.1.0
Dependency attoparsec >=0.10.3.0: using attoparsec-0.10.4.0
Dependency base >=4.0 && <5.0: using base-4.5.1.0
Dependency bytestring -any: using bytestring-0.9.2.1
Dependency case-insensitive >=0.4.0.4: using case-insensitive-1.0
Dependency conduit -any: using conduit-1.0.0.2
Dependency containers -any: using containers-0.4.2.1
Dependency data-default -any: using data-default-0.5.0
Dependency failure -any: using failure-0.2.0.1
Dependency http-conduit >=1.8: using http-conduit-1.9.0
Dependency http-types -any: using http-types-0.8.0
Dependency network -any: using network-2.3.1.0
Dependency old-locale -any: using old-locale-1.0.0.4
Dependency text -any: using text-0.11.2.3
Dependency time -any: using time-1.4
Dependency unordered-containers ==0.2.*: using unordered-containers-0.2.3.0
Dependency vector -any: using vector-0.10.0.1
Using Cabal-1.14.0 compiled by ghc-7.4
Using compiler: ghc-7.4.2
Using install prefix:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0
Binaries installed in:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0/bin
Libraries installed in:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0/lib/github-0.5.0/ghc-7.4.2
Private binaries installed in:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0/libexec
Data files installed in:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0/share/github-0.5.0
Documentation installed in:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0/share/doc/github-0.5.0
No alex found
Using ar found on system at:
/nix/store/1iigiim5855m8j7pmwf5xrnpf705s4dh-binutils-2.21.1a/bin/ar
No c2hs found
No cpphs found
No ffihugs found
Using gcc version 4.6.3 found on system at:
/nix/store/xl3kqxs68gzs4h309wjyd32im9n6cnyr-gcc-wrapper-4.6.3/bin/gcc
Using ghc version 7.4.2 found on system at:
/nix/store/gzb4pca6nnb16lw2mbmr68kx2vwx8q56-ghc-7.4.2-wrapper/bin/ghc
Using ghc-pkg version 7.4.2 found on system at:
/nix/store/gzb4pca6nnb16lw2mbmr68kx2vwx8q56-ghc-7.4.2-wrapper/bin/ghc-pkg
No greencard found
Using haddock version 2.11.0 found on system at:
/nix/store/858ww5lrjxca5asa79vwq5rm6m1h3q6k-ghc-7.4.2/bin/haddock
No happy found
No hmake found
Using hpc version 0.6 found on system at:
/nix/store/gzb4pca6nnb16lw2mbmr68kx2vwx8q56-ghc-7.4.2-wrapper/bin/hpc
Using hsc2hs version 0.67 found on system at:
/nix/store/gzb4pca6nnb16lw2mbmr68kx2vwx8q56-ghc-7.4.2-wrapper/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at:
/nix/store/xl3kqxs68gzs4h309wjyd32im9n6cnyr-gcc-wrapper-4.6.3/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
No pkg-config found
Using ranlib found on system at:
/nix/store/1iigiim5855m8j7pmwf5xrnpf705s4dh-binutils-2.21.1a/bin/ranlib
Using strip found on system at:
/nix/store/1iigiim5855m8j7pmwf5xrnpf705s4dh-binutils-2.21.1a/bin/strip
Using tar found on system at:
/nix/store/8aw6jz9v449mdlxdz2jn4v2ys7d35bf2-gnutar-1.26/bin/tar
No uhc found
building
Building github-0.5.0...
Preprocessing library github-0.5.0...
[ 1 of 23] Compiling Github.Data.Definitions ( Github/Data/Definitions.hs, dist/build/Github/Data/Definitions.o )
[ 2 of 23] Compiling Github.Data ( Github/Data.hs, dist/build/Github/Data.o )
[ 3 of 23] Compiling Github.Private ( Github/Private.hs, dist/build/Github/Private.o )
Github/Private.hs:79:37:
Couldn't match expected type `CookieJar -> Maybe E.SomeException'
with actual type `Maybe E.SomeException'
Expected type: Status
-> Network.HTTP.Types.Header.ResponseHeaders
-> CookieJar
-> Maybe E.SomeException
Actual type: Status
-> Network.HTTP.Types.Header.ResponseHeaders
-> Maybe E.SomeException
In the `checkStatus' field of a record
In the expression:
uri
{method = method, secure = True, port = 443,
requestBody = requestBody, requestHeaders = requestHeaders,
checkStatus = successOrMissing}
Github/Private.hs:102:28:
No instance for (E.Exception (CookieJar -> HttpException))
arising from a use of `E.toException'
Possible fix:
add an instance declaration for
(E.Exception (CookieJar -> HttpException))
In the expression: E.toException
In the second argument of `($)', namely
`E.toException $ StatusCodeException s hs'
In the expression: Just $ E.toException $ StatusCodeException s hs
Configuring github-0.5.0...
Dependency HTTP -any: using HTTP-4000.2.5
Dependency aeson ==0.6.1.0: using aeson-0.6.1.0
Dependency attoparsec >=0.10.3.0: using attoparsec-0.10.4.0
Dependency base >=4.0 && <5.0: using base-4.5.1.0
Dependency bytestring -any: using bytestring-0.9.2.1
Dependency case-insensitive >=0.4.0.4: using case-insensitive-1.0
Dependency conduit -any: using conduit-1.0.0.2
Dependency containers -any: using containers-0.4.2.1
Dependency data-default -any: using data-default-0.5.0
Dependency failure -any: using failure-0.2.0.1
Dependency http-conduit >=1.8: using http-conduit-1.9.0
Dependency http-types -any: using http-types-0.8.0
Dependency network -any: using network-2.3.1.0
Dependency old-locale -any: using old-locale-1.0.0.4
Dependency text -any: using text-0.11.2.3
Dependency time -any: using time-1.4
Dependency unordered-containers ==0.2.*: using unordered-containers-0.2.3.0
Dependency vector -any: using vector-0.10.0.1
Using Cabal-1.14.0 compiled by ghc-7.4
Using compiler: ghc-7.4.2
Using install prefix:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0
Binaries installed in:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0/bin
Libraries installed in:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0/lib/github-0.5.0/ghc-7.4.2
Private binaries installed in:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0/libexec
Data files installed in:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0/share/github-0.5.0
Documentation installed in:
/nix/store/nbsix16422prdk1qdnrbrpbhdhn9h5wb-haskell-github-ghc7.4.2-0.5.0/share/doc/github-0.5.0
No alex found
Using ar found on system at:
/nix/store/1iigiim5855m8j7pmwf5xrnpf705s4dh-binutils-2.21.1a/bin/ar
No c2hs found
No cpphs found
No ffihugs found
Using gcc version 4.6.3 found on system at:
/nix/store/xl3kqxs68gzs4h309wjyd32im9n6cnyr-gcc-wrapper-4.6.3/bin/gcc
Using ghc version 7.4.2 found on system at:
/nix/store/gzb4pca6nnb16lw2mbmr68kx2vwx8q56-ghc-7.4.2-wrapper/bin/ghc
Using ghc-pkg version 7.4.2 found on system at:
/nix/store/gzb4pca6nnb16lw2mbmr68kx2vwx8q56-ghc-7.4.2-wrapper/bin/ghc-pkg
No greencard found
Using haddock version 2.11.0 found on system at:
/nix/store/858ww5lrjxca5asa79vwq5rm6m1h3q6k-ghc-7.4.2/bin/haddock
No happy found
No hmake found
Using hpc version 0.6 found on system at:
/nix/store/gzb4pca6nnb16lw2mbmr68kx2vwx8q56-ghc-7.4.2-wrapper/bin/hpc
Using hsc2hs version 0.67 found on system at:
/nix/store/gzb4pca6nnb16lw2mbmr68kx2vwx8q56-ghc-7.4.2-wrapper/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at:
/nix/store/xl3kqxs68gzs4h309wjyd32im9n6cnyr-gcc-wrapper-4.6.3/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
No pkg-config found
Using ranlib found on system at:
/nix/store/1iigiim5855m8j7pmwf5xrnpf705s4dh-binutils-2.21.1a/bin/ranlib
Using strip found on system at:
/nix/store/1iigiim5855m8j7pmwf5xrnpf705s4dh-binutils-2.21.1a/bin/strip
Using tar found on system at:
/nix/store/8aw6jz9v449mdlxdz2jn4v2ys7d35bf2-gnutar-1.26/bin/tar
No uhc found
building
Building github-0.5.0...
Preprocessing library github-0.5.0...
[ 1 of 23] Compiling Github.Data.Definitions ( Github/Data/Definitions.hs, dist/build/Github/Data/Definitions.o )
[ 2 of 23] Compiling Github.Data ( Github/Data.hs, dist/build/Github/Data.o )
[ 3 of 23] Compiling Github.Private ( Github/Private.hs, dist/build/Github/Private.o )
Github/Private.hs:79:37:
Couldn't match expected type `CookieJar -> Maybe E.SomeException'
with actual type `Maybe E.SomeException'
Expected type: Status
-> Network.HTTP.Types.Header.ResponseHeaders
-> CookieJar
-> Maybe E.SomeException
Actual type: Status
-> Network.HTTP.Types.Header.ResponseHeaders
-> Maybe E.SomeException
In the `checkStatus' field of a record
In the expression:
uri
{method = method, secure = True, port = 443,
requestBody = requestBody, requestHeaders = requestHeaders,
checkStatus = successOrMissing}
Github/Private.hs:102:28:
No instance for (E.Exception (CookieJar -> HttpException))
arising from a use of `E.toException'
Possible fix:
add an instance declaration for
(E.Exception (CookieJar -> HttpException))
In the expression: E.toException
In the second argument of `($)', namely
`E.toException $ StatusCodeException s hs'
In the expression: Just $ E.toException $ StatusCodeException s hs
I'm having troubles with installing github-4.0.0 from cabal package's deps.
It's been a long story and after some tries I receive message, that cabal can't resolve deps, even when "github" package is the only one.
It's always stucked on http-enumerators or http-conduit.
But installing package via cloning repo and build/install form there with empty cabal - works fine.
The Github module is a dependency for an application I am trying to install and it keeps failing at this point, I get the same error when using 0.72 or 0.73.
Configuring github-0.7.3...
Building github-0.7.3...
Preprocessing library github-0.7.3...
[ 1 of 26] Compiling Github.Data.Definitions ( Github/Data/Definitions.hs, dist/build/Github/Data/Definitions.o )
[ 2 of 26] Compiling Github.Data ( Github/Data.hs, dist/build/Github/Data.o )
Github/Data.hs:538:37:
Type of kind * used as a constraint
In the type signature for `<.:>':
<.:> :: (FromJSON v, Monoid v) => Object => [T.Text] -> Parser v
As seen in https://travis-ci.org/phadej/github/builds/81235538
builds against aeson-0.10.0.0 fails, but builds against lts snapshots (older aesons) are ok.
This probably doesn't need any action points before haskell/aeson#288 is either accepted, amended or rejected
I know it's not your priority, but it would be nice to have.
At least I get this error:
JsonError "key \"patch\" not present on the JSON: Object (fromList [(\"status\",String \"diverged\"),(\"merge_base_commit\",Object (fromList [(\"sha\",String \"3054cf9a85619efb66a4923367532307477db619\"),(\"committer\",Object (fromList [(\"repos_url\",String \"https://api.github.com/users/pcapriotti/repos\"),(\"following_url\",String \"https://api.github.com/users/pcapriotti/...
I sent you an email about this, but for the record:
Prelude Github.Repos.Watching> watchersFor "doubledrones" "git-annex" Left (JsonError "key \"gravatar_id\" not present on the JSON: [{\"avatar_url\":\"https://secure.gravatar.com/avatar/5e8f179fd7bb03da2093957fd6e1f6e6?d=https://a248.e.akamai.net/assets.githu b.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png\",\"login\":\"doubledrones\",\"url\":\"https://api.github.com/orgs/doubledrones\ ",\"id\":136321}]")
Each response from the underlying JSON API contains rate limiting information: how many requests we've made, and how many remain. It would be good to use this information.
Some proposals:
a) Produce the rate limiting data as part of every response data type, including Error
.
b) Provide a function that makes a request then produces just the rate limiting data.
c) Track the rate limit internally and automatically slow requests as the limit approaches.
Since this API is rather low level still, it makes sense to provide access to this data. (c) should be in a different library, perhaps named github-convenience
or so.
In common use I'd think (a) is most useful; otherwise each request would need to be followed by another request immediately.
This would make it easier for consumers of this library to use api methods which are not yet implemented.
For example, I would like to be able to get a repo readme; looking at the code in #97, it would be very easy to do this if Github.Private were exposed. I suppose you might also want to add a note to the documentation saying "this is not considered part of the public api, use this at your own risk".
The current version of github fails to compile:
Github/Private.hs:108:19:
`RequestBody' is applied to too many type arguments
In the type signature for `doHttps':
doHttps :: Method
-> String
-> Maybe GithubAuth
-> Maybe (RequestBody (ResourceT IO))
-> IO (Either E.SomeException (Response LBS.ByteString))
A complete build log is available at http://hydra.cryp.to/build/28397/nixlog/1/raw.
Would it be possible for a new release to be uploaded to Hackage? I'm trying to use some authenticated endpoints, but the current version on Hackage (0.13.2) doesn't support them yet.
Thanks!
Hi,
Consider this code:
import qualified Github.Repos as Github
import Data.Maybe
import Data.Functor
run = fmap (either (error.show) id)
main = do
repos <- run $ Github.userRepos "nomeata" Github.Owner
let forks = filter (fromMaybe False . Github.repoFork) repos
mapM_ (print . Github.repoParent) forks
It prints all of my repos that are forks, and I would expect it to print the parent repository as well. Unfortunately, it does not (it prints a bunch of Nothing
s). So maybe #43 was not fixed after all?
This is using github-0.13.2.
Sorry to keep these coming, but I seem to have some users now, who are reporting them. Yikes. :)
This time, a due_on field is null, while the code expects a String. Just needs to use a Maybe String to fix.
Prelude Github.Issues.Milestones> milestones "kepstin" "riker"
Left (JsonError "Given something besides a String on the JSON: [{"due_on":"2012-02-29T08:00:00Z","state":"open","creator":{"gravatar_id":"d3ec3cbb9cbd3d292c1abff8d93d1087","login":"kepstin","url":"https://api.github.com/users/kepstin","avatar_url":"https://secure.gravatar.com/avatar/d3ec3cbb9cbd3d292c1abff8d93d1087?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":38788},"open_issues":3,"title":"2012-02 Code Drop","created_at":"2012-01-31T06:44:33Z","number":2,"description":"","closed_issues":0,"url":"https://api.github.com/repos/kepstin/riker/milestones/2"},{"due_on":null,"state":"open","creator":{"gravatar_id":"d3ec3cbb9cbd3d292c1abff8d93d1087","login":"kepstin","url":"https://api.github.com/users/kepstin","avatar_url":"https://secure.gravatar.com/avatar/d3ec3cbb9cbd3d292c1abff8d93d1087?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":38788},"open_issues":12,"title":"Feature Release 1","created_at":"2012-01-31T05:20:22Z","number":1,"description":"","closed_issues":0,"url":"https://api.github.com/repos/kepstin/riker/milestones/1"}]")
I Tried to email the maintainer of this package the the address provided in the cabal file but it seems this information is no longer correct.
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.