Class RepositoryController
java.lang.Object
edu.ucsb.cs156.frontiers.controllers.ApiController
edu.ucsb.cs156.frontiers.controllers.RepositoryController
@RestController
@RequestMapping("/api/repos")
public class RepositoryController
extends ApiController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionedu.ucsb.cs156.jobs.entities.JobcreateRepos(Long courseId, String repoPrefix, Optional<Boolean> isPrivate, RepositoryPermissions permissions, RepositoryCreationOption creationOption) Fires a job that creates a repo for every RosterStudent with a linked user with a GitHub account.edu.ucsb.cs156.jobs.entities.JobcreateTeamRepos(Long courseId, String repoPrefix, Optional<Boolean> isPrivate, Optional<String> teamRegex, RepositoryPermissions permissions) Fires a job that creates team repos shared by all TeamMembers of each Team in a Course .edu.ucsb.cs156.jobs.entities.JobdeleteRepos(Long courseId, String prefix) Fires a job that deletes every empty repository in the course's GitHub organization whose name starts with the given prefix.
-
Constructor Details
-
RepositoryController
public RepositoryController()
-
-
Method Details
-
createRepos
@PostMapping("/createRepos") @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") public edu.ucsb.cs156.jobs.entities.Job createRepos(@RequestParam Long courseId, @RequestParam String repoPrefix, @RequestParam Optional<Boolean> isPrivate, @RequestParam RepositoryPermissions permissions, @RequestParam(required=false,defaultValue="STUDENTS_ONLY") RepositoryCreationOption creationOption) Fires a job that creates a repo for every RosterStudent with a linked user with a GitHub account.- Parameters:
courseId- ID of course to create repos forrepoPrefix- each repo created will begin with this prefix, followed by a dash and the student's GitHub usernameisPrivate- determines whether the repository being created is private- Returns:
- the
Jobstarted to create the repos.
-
createTeamRepos
@PostMapping("/createTeamRepos") @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") public edu.ucsb.cs156.jobs.entities.Job createTeamRepos(@RequestParam Long courseId, @RequestParam String repoPrefix, @RequestParam Optional<Boolean> isPrivate, @RequestParam Optional<String> teamRegex, @RequestParam RepositoryPermissions permissions) Fires a job that creates team repos shared by all TeamMembers of each Team in a Course .- Parameters:
courseId- ID of course to create team repos forrepoPrefix- each team repo created will begin with this prefix, followed by a dash and the team's nameisPrivate- determines whether the repository being created is private- Returns:
- the
Jobstarted to create the repos.
-
deleteRepos
@DeleteMapping("") @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") public edu.ucsb.cs156.jobs.entities.Job deleteRepos(@RequestParam Long courseId, @RequestParam String prefix) Fires a job that deletes every empty repository in the course's GitHub organization whose name starts with the given prefix. Repositories that contain commits are never deleted.- Parameters:
courseId- ID of the course whose organization is searchedprefix- only repositories whose names start with this prefix are considered- Returns:
- the
Jobstarted to delete the repos.
-