Skip to content

Commit 66ca6ad

Browse files
committed
fix: Add missing fields to repository model.
1 parent 2e48de8 commit 66ca6ad

File tree

6 files changed

+131
-125
lines changed

6 files changed

+131
-125
lines changed

BUILD.bazel

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ haskell_library(
1010
"src/GitHub/Types/Base/*.hs",
1111
"src/GitHub/Types/Base*.hs",
1212
]),
13-
ghcopts = ["-j4"],
1413
src_strip_prefix = "src",
1514
tags = [
1615
"haskell",
@@ -34,7 +33,6 @@ haskell_library(
3433
"src/GitHub/Types/Events/*.hs",
3534
"src/GitHub/Types/Event*.hs",
3635
]),
37-
ghcopts = ["-j4"],
3836
src_strip_prefix = "src",
3937
tags = [
4038
"haskell",
@@ -101,9 +99,7 @@ haskell_library(
10199

102100
hspec_test(
103101
name = "testsuite",
104-
size = "small",
105102
args = [
106-
"-j4",
107103
"+RTS",
108104
"-N4",
109105
],

github-tools.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ library
5656
GitHub.Types.Base.Deployment
5757
GitHub.Types.Base.DeploymentPayload
5858
GitHub.Types.Base.DeploymentStatus
59+
GitHub.Types.Base.EditRepo
5960
GitHub.Types.Base.Hook
6061
GitHub.Types.Base.HookConfig
6162
GitHub.Types.Base.Installation

src/GitHub/Types/Base/Repository.hs

Lines changed: 124 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -17,96 +17,98 @@ import GitHub.Types.Base.RepoOwner
1717
-- Repository
1818

1919
data Repository = Repository
20-
{ repositoryAllowAutoMerge :: Maybe Bool
21-
, repositoryAllowForking :: Bool
22-
, repositoryAllowMergeCommit :: Maybe Bool
23-
, repositoryAllowRebaseMerge :: Maybe Bool
24-
, repositoryAllowSquashMerge :: Maybe Bool
25-
, repositoryAllowUpdateBranch :: Maybe Bool
26-
, repositoryArchived :: Bool
27-
, repositoryArchiveUrl :: Text
28-
, repositoryAssigneesUrl :: Text
29-
, repositoryBlobsUrl :: Text
30-
, repositoryBranchesUrl :: Text
31-
, repositoryCloneUrl :: Text
32-
, repositoryCollaboratorsUrl :: Text
33-
, repositoryCommentsUrl :: Text
34-
, repositoryCommitsUrl :: Text
35-
, repositoryCompareUrl :: Text
36-
, repositoryContentsUrl :: Text
37-
, repositoryContributorsUrl :: Text
38-
, repositoryCreatedAt :: DateTime
39-
, repositoryCustomProperties :: Value -- TODO(iphydf): Figure out what this actually is.
40-
, repositoryDefaultBranch :: Text
41-
, repositoryDeleteBranchOnMerge :: Maybe Bool
42-
, repositoryDeploymentsUrl :: Text
43-
, repositoryDescription :: Maybe Text
44-
, repositoryDisabled :: Bool
45-
, repositoryDownloadsUrl :: Text
46-
, repositoryEventsUrl :: Text
47-
, repositoryFork :: Bool
48-
, repositoryForks :: Int
49-
, repositoryForksCount :: Int
50-
, repositoryForksUrl :: Text
51-
, repositoryFullName :: Text
52-
, repositoryGitCommitsUrl :: Text
53-
, repositoryGitRefsUrl :: Text
54-
, repositoryGitTagsUrl :: Text
55-
, repositoryGitUrl :: Text
56-
, repositoryIsTemplate :: Bool
57-
, repositoryHasDiscussions :: Bool
58-
, repositoryHasDownloads :: Bool
59-
, repositoryHasIssues :: Bool
60-
, repositoryHasPages :: Bool
61-
, repositoryHasProjects :: Bool
62-
, repositoryHasWiki :: Bool
63-
, repositoryHomepage :: Maybe Text
64-
, repositoryHooksUrl :: Text
65-
, repositoryHtmlUrl :: Text
66-
, repositoryId :: Int
67-
, repositoryIssueCommentUrl :: Text
68-
, repositoryIssueEventsUrl :: Text
69-
, repositoryIssuesUrl :: Text
70-
, repositoryKeysUrl :: Text
71-
, repositoryLabelsUrl :: Text
72-
, repositoryLanguage :: Maybe Text
73-
, repositoryLanguagesUrl :: Text
74-
, repositoryLicense :: Maybe License
75-
, repositoryMasterBranch :: Maybe Text
76-
, repositoryMergesUrl :: Text
77-
, repositoryMilestonesUrl :: Text
78-
, repositoryMirrorUrl :: Maybe Text
79-
, repositoryName :: Text
80-
, repositoryNodeId :: Text
81-
, repositoryNotificationsUrl :: Text
82-
, repositoryOpenIssues :: Int
83-
, repositoryOpenIssuesCount :: Int
84-
, repositoryOrganization :: Maybe Text
85-
, repositoryOwner :: RepoOwner
86-
, repositoryPrivate :: Bool
87-
, repositoryPublic :: Maybe Bool
88-
, repositoryPullsUrl :: Text
89-
, repositoryPushedAt :: Maybe DateTime
90-
, repositoryReleasesUrl :: Text
91-
, repositorySize :: Int
92-
, repositorySshUrl :: Text
93-
, repositoryStargazers :: Maybe Int
94-
, repositoryStargazersCount :: Int
95-
, repositoryStargazersUrl :: Text
96-
, repositoryStatusesUrl :: Text
97-
, repositorySubscribersUrl :: Text
98-
, repositorySubscriptionUrl :: Text
99-
, repositorySvnUrl :: Text
100-
, repositoryTagsUrl :: Text
101-
, repositoryTeamsUrl :: Text
102-
, repositoryTopics :: [Text]
103-
, repositoryTreesUrl :: Text
104-
, repositoryUpdatedAt :: DateTime
105-
, repositoryUrl :: Text
106-
, repositoryVisibility :: Text
107-
, repositoryWatchers :: Int
108-
, repositoryWatchersCount :: Int
109-
, repositoryWebCommitSignoffRequired :: Bool
20+
{ repositoryAllowAutoMerge :: Maybe Bool
21+
, repositoryAllowForking :: Bool
22+
, repositoryAllowMergeCommit :: Maybe Bool
23+
, repositoryAllowRebaseMerge :: Maybe Bool
24+
, repositoryAllowSquashMerge :: Maybe Bool
25+
, repositoryAllowUpdateBranch :: Maybe Bool
26+
, repositoryArchived :: Bool
27+
, repositoryArchiveUrl :: Text
28+
, repositoryAssigneesUrl :: Text
29+
, repositoryBlobsUrl :: Text
30+
, repositoryBranchesUrl :: Text
31+
, repositoryCloneUrl :: Text
32+
, repositoryCollaboratorsUrl :: Text
33+
, repositoryCommentsUrl :: Text
34+
, repositoryCommitsUrl :: Text
35+
, repositoryCompareUrl :: Text
36+
, repositoryContentsUrl :: Text
37+
, repositoryContributorsUrl :: Text
38+
, repositoryCreatedAt :: DateTime
39+
, repositoryCustomProperties :: Value -- TODO(iphydf): Figure out what this actually is.
40+
, repositoryDefaultBranch :: Text
41+
, repositoryDeleteBranchOnMerge :: Maybe Bool
42+
, repositoryDeploymentsUrl :: Text
43+
, repositoryDescription :: Maybe Text
44+
, repositoryDisabled :: Bool
45+
, repositoryDownloadsUrl :: Text
46+
, repositoryEventsUrl :: Text
47+
, repositoryFork :: Bool
48+
, repositoryForks :: Int
49+
, repositoryForksCount :: Int
50+
, repositoryForksUrl :: Text
51+
, repositoryFullName :: Text
52+
, repositoryGitCommitsUrl :: Text
53+
, repositoryGitRefsUrl :: Text
54+
, repositoryGitTagsUrl :: Text
55+
, repositoryGitUrl :: Text
56+
, repositoryIsTemplate :: Bool
57+
, repositoryHasDiscussions :: Bool
58+
, repositoryHasDownloads :: Bool
59+
, repositoryHasIssues :: Bool
60+
, repositoryHasPages :: Bool
61+
, repositoryHasProjects :: Bool
62+
, repositoryHasPullRequests :: Maybe Bool
63+
, repositoryHasWiki :: Bool
64+
, repositoryHomepage :: Maybe Text
65+
, repositoryHooksUrl :: Text
66+
, repositoryHtmlUrl :: Text
67+
, repositoryId :: Int
68+
, repositoryIssueCommentUrl :: Text
69+
, repositoryIssueEventsUrl :: Text
70+
, repositoryIssuesUrl :: Text
71+
, repositoryKeysUrl :: Text
72+
, repositoryLabelsUrl :: Text
73+
, repositoryLanguage :: Maybe Text
74+
, repositoryLanguagesUrl :: Text
75+
, repositoryLicense :: Maybe License
76+
, repositoryMasterBranch :: Maybe Text
77+
, repositoryMergesUrl :: Text
78+
, repositoryMilestonesUrl :: Text
79+
, repositoryMirrorUrl :: Maybe Text
80+
, repositoryName :: Text
81+
, repositoryNodeId :: Text
82+
, repositoryNotificationsUrl :: Text
83+
, repositoryOpenIssues :: Int
84+
, repositoryOpenIssuesCount :: Int
85+
, repositoryOrganization :: Maybe Text
86+
, repositoryOwner :: RepoOwner
87+
, repositoryPrivate :: Bool
88+
, repositoryPullRequestCreationPolicy :: Maybe Text
89+
, repositoryPublic :: Maybe Bool
90+
, repositoryPullsUrl :: Text
91+
, repositoryPushedAt :: Maybe DateTime
92+
, repositoryReleasesUrl :: Text
93+
, repositorySize :: Int
94+
, repositorySshUrl :: Text
95+
, repositoryStargazers :: Maybe Int
96+
, repositoryStargazersCount :: Int
97+
, repositoryStargazersUrl :: Text
98+
, repositoryStatusesUrl :: Text
99+
, repositorySubscribersUrl :: Text
100+
, repositorySubscriptionUrl :: Text
101+
, repositorySvnUrl :: Text
102+
, repositoryTagsUrl :: Text
103+
, repositoryTeamsUrl :: Text
104+
, repositoryTopics :: [Text]
105+
, repositoryTreesUrl :: Text
106+
, repositoryUpdatedAt :: DateTime
107+
, repositoryUrl :: Text
108+
, repositoryVisibility :: Text
109+
, repositoryWatchers :: Int
110+
, repositoryWatchersCount :: Int
111+
, repositoryWebCommitSignoffRequired :: Bool
110112
} deriving (Eq, Show, Read)
111113

112114

@@ -154,6 +156,7 @@ instance FromJSON Repository where
154156
<*> x .: "has_issues"
155157
<*> x .: "has_pages"
156158
<*> x .: "has_projects"
159+
<*> x .:? "has_pull_requests"
157160
<*> x .: "has_wiki"
158161
<*> x .: "homepage"
159162
<*> x .: "hooks_url"
@@ -179,6 +182,7 @@ instance FromJSON Repository where
179182
<*> x .:? "organization"
180183
<*> x .: "owner"
181184
<*> x .: "private"
185+
<*> x .:? "pull_request_creation_policy"
182186
<*> x .:? "public"
183187
<*> x .: "pulls_url"
184188
<*> x .: "pushed_at"
@@ -249,6 +253,7 @@ instance ToJSON Repository where
249253
, "has_issues" .= repositoryHasIssues
250254
, "has_pages" .= repositoryHasPages
251255
, "has_projects" .= repositoryHasProjects
256+
, "has_pull_requests" .= repositoryHasPullRequests
252257
, "has_wiki" .= repositoryHasWiki
253258
, "homepage" .= repositoryHomepage
254259
, "hooks_url" .= repositoryHooksUrl
@@ -271,32 +276,33 @@ instance ToJSON Repository where
271276
, "notifications_url" .= repositoryNotificationsUrl
272277
, "open_issues" .= repositoryOpenIssues
273278
, "open_issues_count" .= repositoryOpenIssuesCount
274-
, "organization" .= repositoryOrganization
275-
, "owner" .= repositoryOwner
276-
, "private" .= repositoryPrivate
277-
, "public" .= repositoryPublic
278-
, "pulls_url" .= repositoryPullsUrl
279-
, "pushed_at" .= repositoryPushedAt
280-
, "releases_url" .= repositoryReleasesUrl
281-
, "size" .= repositorySize
282-
, "ssh_url" .= repositorySshUrl
283-
, "stargazers" .= repositoryStargazers
284-
, "stargazers_count" .= repositoryStargazersCount
285-
, "stargazers_url" .= repositoryStargazersUrl
286-
, "statuses_url" .= repositoryStatusesUrl
287-
, "subscribers_url" .= repositorySubscribersUrl
288-
, "subscription_url" .= repositorySubscriptionUrl
289-
, "svn_url" .= repositorySvnUrl
290-
, "tags_url" .= repositoryTagsUrl
291-
, "teams_url" .= repositoryTeamsUrl
292-
, "topics" .= repositoryTopics
293-
, "trees_url" .= repositoryTreesUrl
294-
, "updated_at" .= repositoryUpdatedAt
295-
, "url" .= repositoryUrl
296-
, "visibility" .= repositoryVisibility
297-
, "watchers" .= repositoryWatchers
298-
, "watchers_count" .= repositoryWatchersCount
299-
, "web_commit_signoff_required" .= repositoryWebCommitSignoffRequired
279+
, "organization" .= repositoryOrganization
280+
, "owner" .= repositoryOwner
281+
, "private" .= repositoryPrivate
282+
, "pull_request_creation_policy" .= repositoryPullRequestCreationPolicy
283+
, "public" .= repositoryPublic
284+
, "pulls_url" .= repositoryPullsUrl
285+
, "pushed_at" .= repositoryPushedAt
286+
, "releases_url" .= repositoryReleasesUrl
287+
, "size" .= repositorySize
288+
, "ssh_url" .= repositorySshUrl
289+
, "stargazers" .= repositoryStargazers
290+
, "stargazers_count" .= repositoryStargazersCount
291+
, "stargazers_url" .= repositoryStargazersUrl
292+
, "statuses_url" .= repositoryStatusesUrl
293+
, "subscribers_url" .= repositorySubscribersUrl
294+
, "subscription_url" .= repositorySubscriptionUrl
295+
, "svn_url" .= repositorySvnUrl
296+
, "tags_url" .= repositoryTagsUrl
297+
, "teams_url" .= repositoryTeamsUrl
298+
, "topics" .= repositoryTopics
299+
, "trees_url" .= repositoryTreesUrl
300+
, "updated_at" .= repositoryUpdatedAt
301+
, "url" .= repositoryUrl
302+
, "visibility" .= repositoryVisibility
303+
, "watchers" .= repositoryWatchers
304+
, "watchers_count" .= repositoryWatchersCount
305+
, "web_commit_signoff_required" .= repositoryWebCommitSignoffRequired
300306
]
301307

302308

@@ -392,3 +398,5 @@ instance Arbitrary Repository where
392398
<*> arbitrary
393399
<*> arbitrary
394400
<*> arbitrary
401+
<*> arbitrary
402+
<*> arbitrary

stack.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
packages: [.]
3-
resolver: lts-21.9
3+
resolver: lts-21.25
44
extra-deps:
5+
- Diff-1.0.2
56
- suspend-0.2.0.0
67
- timers-0.2.0.4

tools/check-workflows.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ showDiff a b = Text.pack . PP.render . toDoc $ diff
7878
where
7979
toDoc = Diff.prettyContextDiff (PP.text "payload")
8080
(PP.text "value")
81-
(PP.text . Text.unpack)
81+
(\(Diff.Numbered _ t) -> PP.text . Text.unpack $ t)
8282
diff = Diff.getContextDiff linesOfContext (Text.lines a) (Text.lines b)
83-
linesOfContext = 3
83+
linesOfContext = Just 3

web/TokTok/Webhooks.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ showDiff a b = Text.pack . PP.render . toDoc $ diff
4848
where
4949
toDoc = Diff.prettyContextDiff (PP.text "payload")
5050
(PP.text "value")
51-
(PP.text . Text.unpack)
51+
(\(Diff.Numbered _ t) -> PP.text . Text.unpack $ t)
5252
diff = Diff.getContextDiff linesOfContext (Text.lines a) (Text.lines b)
53-
linesOfContext = 3
53+
linesOfContext = Just 3
5454

5555

5656
showError :: Error -> Text

0 commit comments

Comments
 (0)