Title: | 'Rstudio' Addin for Version Control and Assignment Management using Git |
---|---|
Description: | An 'Rstudio' addin for version control that allows users to clone repositories, create and delete branches, and sync forks on GitHub, GitLab, etc. Furthermore, the addin uses the GitLab API to allow instructors to create forks and merge requests for all students/teams with one click of a button. |
Authors: | Vincent Nijs [aut, cre], Sanjiv Erat [aut] |
Maintainer: | Vincent Nijs <[email protected]> |
License: | GPL-3 |
Version: | 0.8.0 |
Built: | 2024-10-15 03:45:23 UTC |
Source: | https://github.com/vnijs/gitgadget |
Add users to a repo
add_users_repo( token, repo, userfile, permission = 20, server = "https://api.github.com/" )
add_users_repo( token, repo, userfile, permission = 20, server = "https://api.github.com/" )
token |
GitHub token |
repo |
Repo to update |
userfile |
A csv file with student information (i.e., username, token, and email) |
permission |
Permission setting for the repo (default is 20, i.e., reporter) |
server |
The GitLab API server |
See https://github.com/vnijs/gitgadget for additional documentation
Assign work to each student/team by creating a fork of the main repo
assign_work( token, groupname, assignment, userfile, tafile = "", type = "individual", pre = "", server = "https://api.github.com/" )
assign_work( token, groupname, assignment, userfile, tafile = "", type = "individual", pre = "", server = "https://api.github.com/" )
token |
GitLab token |
groupname |
Group to create on GitLab (defaults to user's namespace) |
assignment |
Name of the assignment to assign |
userfile |
A csv file with student information (i.e., username, token, and email) |
tafile |
A optional csv file with TA information (i.e., username, token, and email) |
type |
Individual or Team work |
pre |
Pre-amble for the assignment name, usually groupname + "-" |
server |
The GitLab API server |
See https://github.com/vnijs/gitgadget for additional documentation
Check student tokens
check_tokens( userfile, server = Sys.getenv("git.server", "https://api.github.com/") )
check_tokens( userfile, server = Sys.getenv("git.server", "https://api.github.com/") )
userfile |
A csv file with student information (i.e., username, token, and email) |
server |
The GitLab API server |
See https://github.com/vnijs/gitgadget for additional documentation
Check error status
checkerr(code)
checkerr(code)
code |
Code returned by an API request |
See https://github.com/vnijs/gitgadget for additional documentation
Create merge requests for each student/team
collect_work( token, assignment, userfile, type = "individual", server = "https://api.github.com/" )
collect_work( token, assignment, userfile, type = "individual", server = "https://api.github.com/" )
token |
GitHub token |
assignment |
Name of the assignment (e.g., "class345/class345-assignment1") |
userfile |
A csv file with student information (i.e., username, token, and email) |
type |
Individual or Team work |
server |
The GitLab API server |
See https://github.com/vnijs/gitgadget for additional documentation
Create a group on GitLab using the API
create_group( token, groupname = "", userfile = "", permission = 20, server = "https://api.github.com/" )
create_group( token, groupname = "", userfile = "", permission = 20, server = "https://api.github.com/" )
token |
GitLab token |
groupname |
Group to create on GitLab (defaults to user's namespace) |
userfile |
A csv file with student information (i.e., username, token, and email) |
permission |
Permission setting for the group (default is 20, i.e., reporter) |
server |
The GitLab API server |
See https://github.com/vnijs/gitgadget for additional documentation
Create the main repo from a local directory
create_repo( username = Sys.getenv("git.user"), token = Sys.getenv("GITHUB_PAT"), repo = basename(getwd()), base_dir = dirname(getwd()), groupname = "", pre = "", ssh = FALSE, server = "https://api.github.com/" )
create_repo( username = Sys.getenv("git.user"), token = Sys.getenv("GITHUB_PAT"), repo = basename(getwd()), base_dir = dirname(getwd()), groupname = "", pre = "", ssh = FALSE, server = "https://api.github.com/" )
username |
Username |
token |
Token (e.g., Sys.getenv("GITHUB_PAT") or Sys.getenv("GITHUB_PAT")) |
repo |
Name of the repo (assignment) |
base_dir |
Base directory for the repo. file.path(directory, assignment) should exist |
groupname |
Group to create on GitLab (defaults to user's namespace) |
pre |
Pre-amble for the repo (assignment) name |
ssh |
Use SSH for authentication |
server |
The GitLab API server |
See https://github.com/vnijs/gitgadget for additional documentation
Fetch all merge requests as local branches and link to a remote
fetch_work(token, assignment, page = 1, server = "https://api.github.com/")
fetch_work(token, assignment, page = 1, server = "https://api.github.com/")
token |
GitLab token |
assignment |
Name of the assignment (e.g., "class345/class345-assignment1") |
page |
Number of the results page to select |
server |
The GitLab API server |
See https://github.com/vnijs/gitgadget for additional documentation
Run gitgadget in the Rstudio viewer if available
gitgadget(port = get_port(), host = "127.0.0.1", launch.browser = TRUE)
gitgadget(port = get_port(), host = "127.0.0.1", launch.browser = TRUE)
port |
Port to use for the app |
host |
Host ip to use |
launch.browser |
Launch app in viewer (browsers) or only show the URL |
See https://github.com/vnijs/gitgadget for documentation
Launch gitgadget in a separate process
gitgadget_callr()
gitgadget_callr()
Using the callr
package to launch gitgadget in a separate process so
the console is not blocked. Rstudio viewer is used if available. See
https://github.com/vnijs/gitgadget for documentation
Start gitgadget and show url to open the application in an external browser
gitgadget_url()
gitgadget_url()
See https://github.com/vnijs/gitgadget for documentation
Find project ID
projID(path_with_namespace, token, server, owned = TRUE, search = "")
projID(path_with_namespace, token, server, owned = TRUE, search = "")
path_with_namespace |
Repo name together with the group or user namespace |
token |
GitLab token |
server |
The GitLab API server |
owned |
Restrict listing to only repos owned by the user? TRUE or FALSE |
search |
Search term to use to narrow down the set of projects |
See https://github.com/vnijs/gitgadget for additional documentation
Reach user file
read_ufile(userfile, cols = c("userid", "team", "token"))
read_ufile(userfile, cols = c("userid", "team", "token"))
userfile |
File with student information |
cols |
Column names that must exists in the file |
See https://github.com/vnijs/gitgadget for additional documentation
Remove a project
remove_project(token, id, server)
remove_project(token, id, server)
token |
GitLab token |
id |
Project ID |
server |
The GitLab API server |
See https://github.com/vnijs/gitgadget for additional documentation
Remove users from a repo
remove_users_repo(token, repo, userfile, server = "https://api.github.com/")
remove_users_repo(token, repo, userfile, server = "https://api.github.com/")
token |
GitLab token |
repo |
Repo the update |
userfile |
A csv file with student information (i.e., username, token, and email) |
server |
The GitLab API server |
See https://github.com/vnijs/gitgadget for additional documentation