From c40e95a2acee763dc7f9e25a62baf034dc6c9ac4 Mon Sep 17 00:00:00 2001 From: Matt Brzezinski Date: Thu, 7 Jul 2022 15:06:48 +0100 Subject: [PATCH 1/2] GitLab Issues --- src/api.jl | 7 +++++++ src/forges/GitLab/projects.jl | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/api.jl b/src/api.jl index 464ad08..d889d23 100644 --- a/src/api.jl +++ b/src/api.jl @@ -279,3 +279,10 @@ List all existing pipeline schedules for a project. """ @endpoint list_pipeline_schedules(project::Integer) @endpoint list_pipeline_schedules(owner::AStr, repo::AStr) + +""" + list_issues(::Forge, project::Integer; kwargs...) + +List all issues for a project. +""" +@endpoint list_issues(project::Integer) diff --git a/src/forges/GitLab/projects.jl b/src/forges/GitLab/projects.jl index 7562fd7..9630f23 100644 --- a/src/forges/GitLab/projects.jl +++ b/src/forges/GitLab/projects.jl @@ -111,6 +111,13 @@ end last_commit_id::String end +@json struct Issue + description::String + due_date::String + labels::Vector{String} + title::String +end + endpoint(::GitLabAPI, ::typeof(get_user_repos)) = Endpoint(:GET, "/projects"; query=Dict("membership" => true)) endpoint(::GitLabAPI, ::typeof(get_user_repos), name::AStr) = @@ -141,3 +148,7 @@ endpoint(::GitLabAPI, ::typeof(get_file_contents), id::Integer, path::AStr) = endpoint(::GitLabAPI, ::typeof(get_file_contents), owner::AStr, repo::AStr, path::AStr) = Endpoint(:GET, "/projects/$(encode(owner, repo))/repository/files/$path"; query=Dict(:ref => "master")) into(::GitLabAPI, ::typeof(get_file_contents)) = FileContents + +endpoint(::GitLabAPI, ::typeof(list_issues), project::Integer) = + Endpoint(:GET, "/projects/$project/issues") +into(::GitLabAPI, ::typeof(list_issues)) = Vector{Issue} From e0e74a3653de5c428b7d41cec1197893b6249428 Mon Sep 17 00:00:00 2001 From: Matt Brzezinski Date: Thu, 7 Jul 2022 15:16:24 +0100 Subject: [PATCH 2/2] v0.2.9 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4c6cfd8..7c925f4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GitForge" uuid = "8f6bce27-0656-5410-875b-07a5572985df" authors = ["Chris de Graaf "] -version = "0.2.8" +version = "0.2.9" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"