Skip to content

Commit

Permalink
Merge pull request #38 from JuliaWeb/MB/issues
Browse files Browse the repository at this point in the history
Added GitLab Issues endpoint
  • Loading branch information
mattBrzezinski authored Jul 7, 2022
2 parents 9f7a48c + e0e74a3 commit bf0613d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GitForge"
uuid = "8f6bce27-0656-5410-875b-07a5572985df"
authors = ["Chris de Graaf <me@cdg.dev>"]
version = "0.2.8"
version = "0.2.9"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
7 changes: 7 additions & 0 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 11 additions & 0 deletions src/forges/GitLab/projects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand Down Expand Up @@ -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}

2 comments on commit bf0613d

@mattBrzezinski
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/63826

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.9 -m "<description of version>" bf0613d45c7134bee3660d48bfbbd0321ea50084
git push origin v0.2.9

Please sign in to comment.