[WIP] rb-gateway

Review Request #6825 — Created Jan. 23, 2015 and discarded

Information

Reviewers

This is the beginnings of the rb-gateway project. It is meant to extend existing ReviewBoard functionalities to provide better support for repositories.

Currently, this is a wireframe set up using Google Go (no additional frameworks).

Structure is as followed:
- repository.go : Base repository structure and interface
- git_repository.go : The Git implementation of repository.go
- web_service.go : Handles all web services and routing
- util.go : Handles configuration loading and repository lookup
- config.json : Sample configuration file using .json format
- main.go : main() lives here

Currently as a test, the web server runs on port 8888. A sample works as follows:
1. Specify repo_name = path in config.json (see file attachment)
2. After the server is started, go to ./localhost:8888?repo=repo_name&id=sha
3. A file should download, however my shell exec command isn't currently working in Go - need to fix.


 

Description From Last Updated

It might be worthwhile to just set the Dir directly and then run git, instead of cd'ing. cmd := exec.Command("git", …

TB tbelaire

Might want to return a 404 if it's not there.

TB tbelaire

You don't really wan't to be executing shell scripts ever, just in case something is misconfigured.

brenniebrennie
TB
  1. 
      
  2. Same here, the status code is a nice and easy way to check if it exists. It's like an exit code on a command line tool compared to checking the stdout.

  3. Show all issues

    Might want to return a 404 if it's not there.

  4. 
      
TB
  1. 
      
  2. Git Repository (Revision 1)
    24
        out, _ := exec.Command("cd", repo.Path, ";", "git", "show", id).Output()
    Show all issues

    It might be worthwhile to just set the Dir directly and then run git, instead of cd'ing.

    cmd := exec.Command("git", "show", id)
    cmd.Dir := repo.Path
    out, _ := cmd.Output()
    
    1. Hmm it seems cmd.Dir might not be a valid property ("non-name cmd.Dir on left side of :=") but I'm going to drop this issue since I will be testing git2go for now.

  3. 
      
brennie
  1. 
      
  2. Git Repository (Revision 1)
    24
        out, _ := exec.Command("cd", repo.Path, ";", "git", "show", id).Output()
    Show all issues

    You don't really wan't to be executing shell scripts ever, just in case something is misconfigured.

    1. Barret, is there a library that you would recommend I use to communicate with the git repos in this case? I think you mentioned libgit2.

    2. git2go is a wrapper around libgit2 that is maintained by the people who write libgit2.

  3. 
      
JY
Review request changed
Status:
Discarded
Change Summary:

Opening a new review request that points at rb-gateway