top of page

Running AutoCodeRover on Private GitHub Repositories

josephcnsg

In the previous Post,


We have seen how we can easily create Projects and Tasks in AutoCodeRover to generate a patch according to the descriptions we provide. However, the examples we used were for a public GitHub Repository, which are accessible to anyone on the internet. To get AutoCodeRover to work for Projects hosted on private GitHub repos, we will start by configuring a GitHub Personal Access Token with the sufficient permissions, to read and clone the private repo.



Adding A GitHub Personal Access Token


After logging into our AutoCodeRover account, we can find our user centre button on the top right corner of the window, which opens up to various options for us to configure our settings. To add a GitHub token to our account, click on the 'Account' option in the dropdown menu, and navigate to the 'External Integrations' section of our Account page.


As we can see, there are two buttons that allows us to 1) Generate a GitHub User Access Token, and 2) Add an API Key or Token manually. For our purposes of being able to clone a private repository, we will need to take the manual approach, as a User Access Token has the lowest common level of permission that both the user and the app have. (Just a sidenote here: a User Access Token allows us to directly import our Public GitHub Repositories as Projects - instead of adding them manually like we did in the previous post!)




After clicking on the Add Key / Token button, we should specify the following information about the Key / Token:

  • The Service: The type of service that our Key / Token belongs to

  • The Key Name: The unique key name for our Key / Token

  • The API Key Secret: The content of our API Key, usually beginning with 'sk-xxx' or 'ghp_xxx', depending on the service


Once done, click on the 'Add Key / Token' button, and we can now find our GitHub Personal Access Token under the External Integrations section on our Account page. We can also remove our third party keys at any time by clicking on the 'Remove' button next to the key.




Importing a Private GitHub Repository


Now, let us go back to the Projects Tab, and try Importing a Private Project using the token we had just added! Click on the 'Import Projects' button, and select 'From GitHub', and we can see the Token we had just added, along with the same buttons we previously saw, which allows us to generate GitHub User Access Tokens and add keys manually. Let us select our Personal Access Token, and then hit 'Confirm'.




Here, we can see all the Repositories that this token has access to, and we can easily import them as Projects by selecting the repos we want, then hitting that 'Import Selected Repos' button.



And there we have it: our private GitHub repo had just been imported, and the Personal Access Token we had used for the import has also been automatically configured as the 'Default Repo Token' and the 'Issue Tracker Token' for the Github Issue Tracker. Neat!



From this project details page, we can then go on to start manually adding tasks, or importing them from GitHub Issues, just like how we did for a public GitHub repo in the previous post. When AutoCodeRover is requested to perform a run on a private GitHub repo, it clones the repo using the provided Personal Access Token, with both the private token and repo being securely stored.






10 views0 comments

Recent Posts

See All

Comments


bottom of page