Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explanation on how to read GitLab doc in vignette: "d-go-further-understand-and-build" #42

Open
statnmap opened this issue Aug 1, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@statnmap
Copy link
Member

statnmap commented Aug 1, 2021

Improve vignette: "d-Go further: understand and build your functions": https://statnmap.github.io/gitlabr/articles/d-go-further-understand-and-build.html

Explain how to build custom requests using Gitlab doc.

For instance, use this documentation and the explanations below: https://docs.gitlab.com/ee/api/issues.html

The API possibilities

GET /issues
GET /issues?assignee_id=5
GET /issues?author_id=5
GET /issues?confidential=true
GET /issues?iids[]=42&iids[]=43
GET /issues?labels=foo
GET /issues?labels=foo,bar
GET /issues?labels=foo,bar&state=opened
GET /issues?milestone=1.0.0
GET /issues?milestone=1.0.0&state=opened
GET /issues?my_reaction_emoji=star
GET /issues?search=foo&in=title
GET /issues?state=closed
GET /issues?state=opened

{gitlabr} use:

Command GET /issues to use in

gitlab(req = 'issues'', verb = httr::GET)

Options in the table lik assignee_id to be used as extra parameters like

gitlab(req = 'issues'', verb = httr::GET, assignee_id = 5)

Show some extra possible uses

  • Uses not added as single functions to avoid a too huge maintenance of the package and too long unit tests

Milestones

id <- 317

all_milestones <- gitlabr::gitlab(
 req = c("projects" , id, "milestones"),
 verb = httr::GET
)

# Get milestones issues
gl_list_issues(project = 317, milestone = all_milestones$title[2])

Get all groups available to me

all_groups <- gitlab(req = paste0("groups"), verb = httr::GET)

Get all subgroups of one group

id <- 123
gitlabr::gitlab(
  req = c("groups", id, "subgroups"),
  verb = httr::GET
)

Project / group members

id <- 317

gitlab(c("projects", id, "members"))
gitlab(c("groups", id, "members"))

Releases

  • Publish a new release on the last commit in main branch
id <- 123
gitlabr::gitlab(
        req = c("projects", id  "releases"),
        verb = httr::POST,
        tag_name = "v0.0.1",
        description = "test desc",
        name = "test release name"
      )
@statnmap statnmap added the good first issue Good for newcomers label Aug 1, 2021
@statnmap statnmap added the documentation Improvements or additions to documentation label Aug 11, 2021
@statnmap statnmap changed the title Add explanation on how to read GitLab doc Add explanation on how to read GitLab doc in vignette: "d-go-further-understand-and-build" Oct 10, 2021
@statnmap statnmap mentioned this issue Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant