diff --git a/.Rbuildignore b/.Rbuildignore
index 931662b..49862c2 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -1,3 +1,5 @@
^.*\.Rproj$
^\.Rproj\.user$
^README\.Rmd$
+^\.travis\.yml$
+^codecov\.yml$
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..eba8c65
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,4 @@
+# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r
+
+language: R
+cache: packages
diff --git a/DESCRIPTION b/DESCRIPTION
index 18bd3e0..03bf40e 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,11 +1,11 @@
Package: gitear
Title: Client to the 'gitea' API
-Version: 0.0.4
+Version: 1.0.0
Authors@R: c(
person(family="ixpantia, SRL", role = "aut", email = "hola@ixpantia.com"),
person("Frans", "van Dunné", role=c("cre", "aut"), email="frans@ixpantia.com"),
person("Francisco", "Sácida", role="aut", email="francisco@delaguayaba.com"),
- person("Ronny", "Hernández Mora", role="ctb", email="ronny@ixpantia.com"))
+ person("Ronny", "Hernández Mora", role="aut", email="ronny@ixpantia.com"))
Description: 'Gitea' is a community managed, lightweight code hosting solution
were projects and their respective git repositories can be managed
The figure sizes have been customised so that you can easily put two images side-by-side. Be aware that you should save this token somewhere because its shown just once. This is going to be your API TOKEN. Then you can use a function like this: For the examples below, we are going to use credentials stored in a .Renviron file, which we are going to call from this variables: gitear is a package that communicates with the gitea API. It makes posible to request your self-hosted Git service data and import it to R in a tidy data frame. The goal of gitear is to request your self-hosted Git service data and import it to R in a tidy data frame. For the installation of the development version, you can install gitear from github: You can install the development version from GitHub with: With gitear you have a set of functions to request your data from the gitea API and also to edit issues. First go to your gitea self hosted service and grab your API Token. Then you should be able to the following: gitear is a package that communicates with the gitea API. It makes posible to request your self-hosted Git service data and import it to R in a tidy data frame. For the installation of the development version, you can install gitear from github: With gitear you have a set of functions to request your data from the gitea API and also to edit issues.
[](https://cran.r-project.org/package=gitear)
+[](https://travis-ci.org/ixpantia/gitear)
+[](https://codecov.io/gh/ixpantia/gitear?branch=master)
The goal of gitear is to request your self-hosted Git service data and import
@@ -52,5 +56,30 @@ issues <- get_issues(base_url = url_ixpantia,
repo = "ixmandash")
```
+## **Environmental variables:**
+
+In order to work with environmental variables to make your scripts safer from
+somebody getting your credentials, you can follow the next workflow:
+
+ 1- Create an .Renviron file with your credentials
+ 2- Restart your R session
+ 3- Store your credentials in an object for using it in your script
+
+Your script could look something like this:
+
+```{r}
+# Storing credentials in an object
+example_key <- Sys.getenv("example_key")
+example_url <- Sys.getenv("example_url")
+
+# Using a function from gitear
+issues <- get_issues(base_url = example_url,
+ api_key = example_key,
+ owner = "ixpantia",
+ repo = "lacrmr")
+
+# Check the output
+glimpse(issues)
+```
diff --git a/README.md b/README.md
index 6e6066b..373d2ac 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,10 @@
[](https://cran.r-project.org/package=gitear)
+[](https://travis-ci.org/ixpantia/gitear)
+[](https://codecov.io/gh/ixpantia/gitear?branch=master)
The goal of gitear is to request your self-hosted Git service data and
@@ -43,3 +47,41 @@ issues <- get_issues(base_url = url_ixpantia,
owner = "ixpantia",
repo = "ixmandash")
```
+
+## **Environmental variables:**
+
+In order to work with environmental variables to make your scripts safer
+from somebody getting your credentials, you can follow the next
+workflow:
+
+1- Create an .Renviron file with your credentials 2- Restart your R
+session 3- Store your credentials in an object for using it in your
+script
+
+Your script could look something like this:
+
+``` r
+# Storing credentials in an object
+example_key <- Sys.getenv("example_key")
+example_url <- Sys.getenv("example_url")
+
+# Using a function from gitear
+issues <- get_issues(base_url = example_url,
+ api_key = example_key,
+ owner = "ixpantia",
+ repo = "lacrmr")
+
+# Check the output
+glimpse(issues)
+#> Observations: 4
+#> Variables: 9
+#> $ number
Access different issues of different instances
ixpantia
- 2020-02-01
+ 2020-02-09
Access-diff-issues-on-diff-instances.Rmd
2020-02-01
Get information about your issues of differents instances
base_url <- Sys.getenv("URI")
-api_key <- Sys.getenv("TOKEN")
-owner <- Sys.getenv("USUARIO")
-repo1 <- Sys.getenv("REPOSITORIO_1")
-repo2 <- Sys.getenv("REPOSITORIO_2")
-repo3 <- Sys.getenv("REPOSITORIO_3")
-
-base_local <- Sys.getenv("URL_LOCAL")
-owner_local <- Sys.getenv("OWNER_LOCAL")
-api_key_local <- Sys.getenv("TOKEN_LOCAL")
-
-instancia_1 <- c(base_url, api_key, owner, repo1)
-instancia_2 <- c(base_url, api_key, owner,repo2)
-instancia_3 <- c(base_local, api_key_local, owner_local,repo3)
-
-lista <- list()
-lista$inst1 <- instancia_1
-lista$inst2 <- instancia_2
-lista$inst3 <- instancia_3
-
-diff_inst_open_issues <- function(lista_intancia) {
- # lista_resultado <- data.frame(titulo = character(0), contenido = character(0))
- if (missing(lista_intancia)) {
- warning("Please add a valid list")
- } else {
- try({
- for (ins in lista) {
- issues <- (gitear::get_issues_open_state(ins[1], ins[2], ins[3],
- ins[4]))
-
- for(i in 1:length(issues)){
- if(!is.na(issues[i, 5])){
- print (c(issues[i, 5], issues[i, 6]))
- }
- }
- }
- })
- }
-}
-
-diff_inst_open_issues(lista)
-#> Error in curl::curl_fetch_memory(url, handle = handle) :
-#> URL using bad/illegal format or missing URL
-#> Error in gitear::get_issues_open_state(ins[1], ins[2], ins[3], ins[4]) :
-#> object 'content_issues' not found
base_url <- Sys.getenv("URI")
+api_key <- Sys.getenv("TOKEN")
+owner <- Sys.getenv("USUARIO")
+repo1 <- Sys.getenv("REPOSITORIO_1")
+repo2 <- Sys.getenv("REPOSITORIO_2")
+repo3 <- Sys.getenv("REPOSITORIO_3")
+
+base_local <- Sys.getenv("URL_LOCAL")
+owner_local <- Sys.getenv("OWNER_LOCAL")
+api_key_local <- Sys.getenv("TOKEN_LOCAL")
+
+instancia_1 <- c(base_url, api_key, owner, repo1)
+instancia_2 <- c(base_url, api_key, owner,repo2)
+instancia_3 <- c(base_local, api_key_local, owner_local,repo3)
+
+lista <- list()
+lista$inst1 <- instancia_1
+lista$inst2 <- instancia_2
+lista$inst3 <- instancia_3
+
+diff_inst_open_issues <- function(lista_intancia) {
+ # lista_resultado <- data.frame(titulo = character(0), contenido = character(0))
+ if (missing(lista_intancia)) {
+ warning("Please add a valid list")
+ } else {
+ try({
+ for (ins in lista) {
+ issues <- (gitear::get_issues_open_state(ins[1], ins[2], ins[3],
+ ins[4]))
+
+ for(i in 1:length(issues)){
+ if(!is.na(issues[i, 5])){
+ print (c(issues[i, 5], issues[i, 6]))
+ }
+ }
+ }
+ })
+ }
+}
+
+diff_inst_open_issues(lista)
+#> Error in curl::curl_fetch_memory(url, handle = handle) : <url> malformed
+#> Error in gitear::get_issues_open_state(ins[1], ins[2], ins[3], ins[4]) :
+#> object 'content_issues' not found
Access Gitea from R
ixpantia
- 2020-02-01
+ 2020-02-09
Access-gitea-from-R.Rmd
## Credenciales
-key <- "gfdsgfd8ba18a866bsdfgsdfgs3a2dc9303453b0c92dcfb19"
-url_ixpantia <- "https://secure.ixpantia.com"
-
-## Prueba funcion
-issues <- get_issues(base_url = url_prueba,
- api_key = llave,
- owner = "ixpantia",
- repo = "ixmandash")
## Library
+library(gitear)
+
+## Credentials
+api_token <- "gfdsgfd8ba18a866bsdfgsdfgs3a2dc9303453b0c92dcfb19"
+url_ixpantia <- "https://secure.ixpantia.com"
+
+## Example function use:
+issues <- get_issues(base_url = url_ixpantia,
+ api_key = api_token,
+ owner = "ixpantia",
+ repo = "ixmandash")
+Get info from one project
+repos <- get_list_repos_org(base_url = example_url,
+ api_key = example_key,
+ org = "ixpantia")
+
+glimpse(repos)
+#> Observations: 15
+#> Variables: 33
+#> $ id <int> 52, 63, 93, 159, 144, 65, 146, 139, 62, 1…
+#> $ owner <df[,10]> <data.frame[15 x 10]>
+#> $ name <chr> "ixcom", "lacrmr", "ixblog", "ixtiempo", …
+#> $ full_name <chr> "ixpantia/ixcom", "ixpantia/lacrmr", "ixp…
+#> $ description <chr> "Website principal de ixpantia en www.ixp…
+#> $ empty <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,…
+#> $ private <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,…
+#> $ fork <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,…
+#> $ parent <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
+#> $ mirror <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,…
+#> $ size <int> 34271, 1952, 34431, 0, 1852, 3008, 272, 2…
+#> $ html_url <chr> "https://secure.ixpantia.com/ixpantia/ixc…
+#> $ ssh_url <chr> "git@secure.ixpantia.com:ixpantia/ixcom.g…
+#> $ clone_url <chr> "https://secure.ixpantia.com/ixpantia/ixc…
+#> $ website <chr> "", "", "", "", "", "", "", "", "", "", "…
+#> $ stars_count <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
+#> $ forks_count <int> 2, 2, 3, 1, 1, 4, 3, 1, 3, 2, 1, 0, 0, 2,…
+#> $ watchers_count <int> 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,…
+#> $ open_issues_count <int> 13, 4, 12, 0, 4, 10, 3, 0, 9, 5, 1, 3, 3,…
+#> $ default_branch <chr> "master", "master", "master", "master", "…
+#> $ archived <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,…
+#> $ created_at <chr> "2019-01-03T23:09:59Z", "2019-01-31T21:12…
+#> $ updated_at <chr> "2020-02-01T09:25:04Z", "2020-01-24T22:57…
+#> $ permissions <df[,3]> <data.frame[15 x 3]>
+#> $ has_issues <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,…
+#> $ has_wiki <lgl> TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE…
+#> $ has_pull_requests <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,…
+#> $ ignore_whitespace_conflicts <lgl> TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, …
+#> $ allow_merge_commits <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,…
+#> $ allow_rebase <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,…
+#> $ allow_rebase_explicit <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,…
+#> $ allow_squash_merge <lgl> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,…
+#> $ avatar_url <chr> "", "", "", "", "", "", "", "", "", "", "…
Contents
diff --git a/docs/index.html b/docs/index.html
index d15ead4..3f9b7ac 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -77,129 +77,38 @@
-Overview
-gitear
is a package that communicates with the gitea API.
Installation
-
+devtools::install_github("ixpantia/gitear")
Usage
-
-
+
-
-
-Function
-Output
-
-
-add_tracked_time_issue
-
-
-
-create_comment_issue
-
-
-
-create_issue
-
-
-
-edit_comment
-
-
-
-edit_issue
-
-
-
-get_an_issue
-
-
-
-get_an_organization
-
-
-
-get_issues_closed_state
-
-
-
-get_issues_open_state
-
-
-
-get_label_issue
-
-
-
-get_list_org_teams
-
-
-
-get_list_comments_issue
-
-
-
-get_list_comments_repository
-
-
-
-get_list_org_members
-
-
-
-get_list_repos_org
-
-
-
-get_org_hook
-
-
-
-get_org_list_hooks
-
-
-
-get_organizations
-
-
-
-get_repositories
-
-
-
-get_times_issue
-
-
-
-get_version
-
-
-
-
-get_commits
-
- gitear
+
+Overview
+
+Installation
+
+devtools::install_github("ixpantia/gitear")
+Usage
+
+
+
+
+
+Function
+Output
+
+
+add_tracked_time_issue
+
+
+
+create_comment_issue
+A table with the columns: id, html_url, pull_request_url, issue_url, user.id, user.login, user.full_name, user.email, user.avatar_url, user.language, user.username, body, created_at, updated_at
+
+
+create_issue
+A list with $id, $url, $number, $user, $title, $body, $labels, $milestone, $assignee, $assignees, $state, $comments, $created_at, $updated_at, $closed_at, $due_date, $pull_request
+
+
+edit_comment
+A list containing $id, $html_url, $pull_request_url, $issue_url, $user, $body, $created_at, $updated_at
+
+
+edit_issue
+A list containing $id, $url, $number, $user, $title, $body, $labels, $milestone, $assignee, $assignees, $state, $comments, $created_at, $updated_at, $closed_at, $due_date, $pull_request
+
+
+get_an_issue
+
+
+
+get_an_organization
+A dataframe with the variables id, username, full_name, avatar_url, description, website, location
+
+
+get_issues_closed_state
+A dataframe containing id, url, number, title, body, labels, milestones, assignees, state, comments, created_at, updated_at, closed_at, due_date, pull_request, user.id, user.login, user.full_name, user.email, user.avatar_url, user.language, user.username, assignee.id, assignee.login, assignee.full_name, asignee.email, assignee.avatar_url, assignee.language, assignee.username
+
+
+get_issues_open_state
+A dataframe containing id, url, number, title, body, labels, milestones, assignees, state, comments, created_at, updated_at, closed_at, due_date, pull_request, user.id, user.login, user.full_name, user.email, user.avatar_url, user.language, user.username, assignee.id, assignee.login, assignee.full_name, asignee.email, assignee.avatar_url, assignee.language, assignee.username
+
+
+get_label_issue
+A dataframe with one variable: content_label_issue
+
+
+get_list_org_teams
+Dataframe with id, name, description, permission and units
+
+
+get_list_comments_issue
+A dataframe containing id, html_url, pull_request_url, issue_url, user, body, created_at, updated_at
+
+
+get_list_comments_repository
+A dataframe containing id, html_url, pull_request_url, issue_url, user, body, created_at, updated_at
+
+
+get_list_org_members
+A dataframe with id, login, full_name, email, avatar_url, language, username
+
+
+get_list_repos_org
+A data frame containing id, owner, name, full_name, description, empty, private, fork, parent, mirror, size, html_url, ssh_url, clone_url, website, stars_count, forks_count, watchers_count, open_issues_count, default_branch, archived, created_at, updated_at, permissions
+
+
+get_org_hook
+
+
+
+get_org_list_hooks
+
+
+
+get_organizations
+id, username, full_name, avatar_url, description, website, location
+
+
+get_repositories
+
+
+
+get_times_issue
+A data frame with message and url
+
+
+get_version
+A data frame with one variable: version
+
+
+
+get_commits
+
+ get_organizations()
Returns the organizations of the user
Returns the organizations of the user