github: Remove GithubEntity
authorAlexandre Terrasa <alexandre@moz-code.org>
Fri, 21 Jun 2019 03:08:12 +0000 (23:08 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Thu, 11 Jul 2019 01:42:16 +0000 (21:42 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/github/api.nit
lib/github/cache.nit

index 67a9fac..cc2abf4 100644 (file)
@@ -507,7 +507,7 @@ class GithubAPIError
        var requested_uri: String
 end
 
-# An Error returned while deserializing GithubEntity objects
+# An Error returned while deserializing objects from the API
 class GithubDeserializerErrors
        super GithubError
 
@@ -515,16 +515,6 @@ class GithubDeserializerErrors
        var deserizalization_errors: Array[Error]
 end
 
-# Something returned by the Github API.
-#
-# Mainly a Nit wrapper around a JSON objet.
-abstract class GithubEntity
-       serialize
-
-       # Github page url.
-       var html_url: nullable String is writable
-end
-
 # A Github user
 #
 # Provides access to [Github user data](https://developer.github.com/v3/users/).
@@ -554,7 +544,6 @@ end
 # Provides access to [Github repo data](https://developer.github.com/v3/repos/).
 # Should be accessed from `GithubAPI::get_repo`.
 class Repo
-       super GithubEntity
        serialize
 
        # Repo full name on Github.
@@ -576,7 +565,6 @@ end
 #
 # See <https://developer.github.com/v3/repos/#list-branches>.
 class Branch
-       super GithubEntity
        serialize
 
        # Branch name.
@@ -592,7 +580,6 @@ end
 #
 # See <https://developer.github.com/v3/repos/commits/>.
 class Commit
-       super GithubEntity
        serialize
 
        # Commit SHA.
@@ -639,7 +626,6 @@ end
 
 # A Git Commit representation
 class GitCommit
-       super GithubEntity
        serialize
 
        # Commit SHA.
@@ -660,7 +646,6 @@ end
 
 # Git user authoring data
 class GitUser
-       super GithubEntity
        serialize
 
        # Authoring date.
@@ -680,7 +665,6 @@ end
 #
 # See <https://developer.github.com/v3/issues/>.
 class Issue
-       super GithubEntity
        serialize
 
        # Issue Github ID.
@@ -841,7 +825,6 @@ end
 #
 # See <https://developer.github.com/v3/issues/labels/>.
 class Label
-       super GithubEntity
        serialize
 
        # Label name.
@@ -857,7 +840,6 @@ end
 #
 # See <https://developer.github.com/v3/issues/milestones/>.
 class Milestone
-       super GithubEntity
        serialize
 
        # The milestone id on Github.
@@ -930,7 +912,6 @@ end
 # * `IssueComment` are made on an issue or pull request page.
 # * `ReviewComment` are made on the diff associated to a pull request.
 abstract class Comment
-       super GithubEntity
        serialize
 
        # Identifier of this comment.
@@ -1040,7 +1021,6 @@ end
 #
 # See <https://developer.github.com/v3/issues/events/>.
 class IssueEvent
-       super GithubEntity
        serialize
 
        # Event id on Github.
index 8384030..a34bb4e 100644 (file)
@@ -60,7 +60,7 @@ redef class GithubAPI
                if store.has_key(key) then
                        message(1, "Get {key} (cache)")
                        was_error = false
-                       return deserialize(store.load_object(key).to_json).as(nullable GithubEntity)
+                       return deserialize(store.load_object(key).to_json)
                end
                var obj = super
                if not was_error and obj isa Serializable then