From fe7e0892fc29ca0f0623210616ab6cb7c0fb451f Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Mon, 18 Sep 2023 12:52:27 +0000 Subject: [PATCH] schema - add the GithubUser provider --- schemas/monocle/config/Crawler/Provider.dhall | 1 + schemas/monocle/config/Provider/GithubUser/Type.dhall | 4 ++++ schemas/monocle/config/Provider/GithubUser/default.dhall | 1 + schemas/monocle/config/Provider/GithubUser/package.dhall | 1 + src/Macroscope/Main.hs | 1 + src/Monocle/Config.hs | 4 ++++ 6 files changed, 12 insertions(+) create mode 100644 schemas/monocle/config/Provider/GithubUser/Type.dhall create mode 100644 schemas/monocle/config/Provider/GithubUser/default.dhall create mode 100644 schemas/monocle/config/Provider/GithubUser/package.dhall diff --git a/schemas/monocle/config/Crawler/Provider.dhall b/schemas/monocle/config/Crawler/Provider.dhall index 378f5b8b1..af56ae0a7 100644 --- a/schemas/monocle/config/Crawler/Provider.dhall +++ b/schemas/monocle/config/Crawler/Provider.dhall @@ -1,6 +1,7 @@ -- | The provider service for a worker < GitlabProvider : ../Provider/Gitlab/Type.dhall | GithubProvider : ../Provider/Github/Type.dhall +| GithubUserProvider : ../Provider/GithubUser/Type.dhall | GithubApplicationProvider : ../Provider/GithubApplication/Type.dhall | GerritProvider : ../Provider/Gerrit/Type.dhall | BugzillaProvider : ../Provider/Bugzilla/Type.dhall diff --git a/schemas/monocle/config/Provider/GithubUser/Type.dhall b/schemas/monocle/config/Provider/GithubUser/Type.dhall new file mode 100644 index 000000000..653f69b16 --- /dev/null +++ b/schemas/monocle/config/Provider/GithubUser/Type.dhall @@ -0,0 +1,4 @@ +{ github_url : Optional Text +, github_token : Optional Text +, github_users : List Text +} diff --git a/schemas/monocle/config/Provider/GithubUser/default.dhall b/schemas/monocle/config/Provider/GithubUser/default.dhall new file mode 100644 index 000000000..3c240a74d --- /dev/null +++ b/schemas/monocle/config/Provider/GithubUser/default.dhall @@ -0,0 +1 @@ +{ github_url = None Text, github_users = List Text, github_token = None Text } diff --git a/schemas/monocle/config/Provider/GithubUser/package.dhall b/schemas/monocle/config/Provider/GithubUser/package.dhall new file mode 100644 index 000000000..3cfe62ebf --- /dev/null +++ b/schemas/monocle/config/Provider/GithubUser/package.dhall @@ -0,0 +1 @@ +{ Type = ./Type.dhall, default = ./default.dhall } diff --git a/src/Macroscope/Main.hs b/src/Macroscope/Main.hs index 494a6772c..a5f38d3d9 100644 --- a/src/Macroscope/Main.hs +++ b/src/Macroscope/Main.hs @@ -372,6 +372,7 @@ getCrawler inf@(InfoCrawler _ _ crawler idents) = getCompose $ fmap addInfos (Co <> [ghIssuesCrawler ghClient] <> [ghPRCrawler ghClient getIdentByAliasCB] pure $ Just (k, crawlers) + Config.GithubUserProvider _ -> pure Nothing -- Not yet implemented Config.GithubApplicationProvider _ -> pure Nothing -- "Not (yet) implemented" Config.TaskDataProvider -> pure Nothing -- This is a generic crawler, not managed by the macroscope getIdentByAliasCB :: Text -> Maybe Text diff --git a/src/Monocle/Config.hs b/src/Monocle/Config.hs index d7a2aa086..b9d32d4d5 100644 --- a/src/Monocle/Config.hs +++ b/src/Monocle/Config.hs @@ -114,6 +114,7 @@ Dhall.TH.makeHaskellTypes , provider "Gerrit" , provider "Gitlab" , provider "Github" + , provider "GithubUser" , provider "GithubApplication" , provider "Bugzilla" , authProvider "OIDC" @@ -154,6 +155,9 @@ deriving instance Show Gerrit deriving instance Eq Github deriving instance Show Github +deriving instance Eq GithubUser +deriving instance Show GithubUser + deriving instance Eq GithubApplication deriving instance Show GithubApplication