Class GithubGraphQLController

java.lang.Object
edu.ucsb.cs156.frontiers.controllers.ApiController
edu.ucsb.cs156.frontiers.controllers.GithubGraphQLController

@RequestMapping("/api/github/graphql/") @RestController public class GithubGraphQLController extends ApiController
  • Constructor Details

  • Method Details

    • getDefaultBranchName

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @GetMapping("defaultBranchName") public String getDefaultBranchName(Long courseId, String owner, String repo) throws Exception
      Return default branch name for a given repository.
      Parameters:
      courseId - the id of the course whose installation is being used for credentails
      owner - the owner of the repository
      repo - the name of the repository
      Returns:
      the default branch name
      Throws:
      Exception
    • getCommits

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @GetMapping("commits") public String getCommits(Long courseId, String owner, String repo, String branch, Integer first, @RequestParam(name="after",required=false) String after) throws Exception
      Return default branch name for a given repository.
      Parameters:
      courseId - the id of the course whose installation is being used for credentails
      owner - the owner of the repository
      repo - the name of the repository
      Returns:
      the default branch name
      Throws:
      Exception
    • loadCommitHistory

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @PostMapping("history") public Job loadCommitHistory(Long courseId, @Valid @RequestBody @Valid List<BranchId> branches) throws Exception
      Returns a job to load the commit data of a number of branches
      Parameters:
      courseId - the id of the course whose installation is being used for credentials
      branches - the list of branches to load
      Returns:
      the job identifier
      Throws:
      Exception
    • getCommitsCsv

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @PostMapping(value="csv", produces="text/csv") public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> getCommitsCsv(Long courseId, Instant start, Instant end, Boolean skipMergeCommits, @Valid @RequestBody @Valid List<BranchId> branches) throws Exception
      Throws:
      Exception