Add support for Mercurial repositories

Review Request #9409 — Created Nov. 29, 2017 and submitted

Information

rb-gateway
master
974ed29...

Reviewers

RB Gateway now supports Mercurial repositories. Setting scm to hg
in a repository entry in the configuration file will enable this
behaviour.

Co-authored-by: Henri-Philippe Marceau hmarceau@laurentian.ca

Ran go fmt ./....
Ran go test ./....

Configured a Mercurial repository and made HTTP requests to verify
API responses were correct.

Description From Last Updated

This is a small nitpick but I've looked in a few other files, and I think there should be a …

RC rcreagha

Not sure if this applies to go but this line is longer than 78 characters.

GR GrahamS

I think this import list should be alphabetical.

RC rcreagha

This line is also longer than 78 characters.

GR GrahamS

Should be "On success" rather than "On a success"

daviddavid

Shouldn't this be returning false, err?

daviddavid

Shouldn't this be returning false, err?

daviddavid

This should have documentation.

daviddavid

Typo: repsonsible -> responsible

daviddavid

Can we say "Mercurial repository" instead of "Hg repository", so it's less of a tautology?

daviddavid
hmarceau
hmarceau
RC
  1. I'll say upfront that I know nothing about Go, so all I can really comment on is a few stylistic things.

  2. hg_repository.go (Diff revision 3)
     
     
     
     
     
     
     
     
    Show all issues

    This is a small nitpick but I've looked in a few other files, and I think there should be a space between 'import' and the parenthesis.

    Also I think this import list should be alphabetical.

    1. You are right, thanks!

  3. hg_repository.go (Diff revision 3)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    There are a few spots like this where a few more line breaks could make this a little nicer looking.
    I've been comparing against git_repository.go and that file has linebreaks after most if-statements.
    However, I don't understand Go, so there may be a valid reason to group it together in some places.

  4. hg_repository.go (Diff revision 3)
     
     
     
     
     

    This is another example of where I think an extra line would be good to have, just between the end of the if block and the last return statement

  5. hg_repository_test.go (Diff revision 3)
     
     
     
     
     
     
     
     
     
    Show all issues

    I think this import list should be alphabetical.

  6. All in all the styling is nice and the comments are good. Good work!

GR
  1. 
      
  2. hg_repository.go (Diff revision 3)
     
     
    Show all issues

    Not sure if this applies to go but this line is longer than 78 characters.

  3. hg_repository_test.go (Diff revision 3)
     
     
    Show all issues

    This line is also longer than 78 characters.

  4. 
      
hmarceau
TB
  1. 
      
  2. hg_repository.go (Diff revision 4)
     
     
     
     
     
    I don't know if the multiple line-comments are due to a style-guide or anything, but if not I believe you can do C-style /* */ multi-line comments in Go!
  3. 
      
brennie
brennie
david
  1. 
      
  2. repositories/hg.go (Diff revision 5)
     
     
    Show all issues

    Should be "On success" rather than "On a success"

  3. repositories/hg.go (Diff revision 5)
     
     
    Show all issues

    Shouldn't this be returning false, err?

  4. repositories/hg.go (Diff revision 5)
     
     
    Show all issues

    Shouldn't this be returning false, err?

  5. 
      
brennie
brennie
brennie
brennie
brennie
david
  1. 
      
  2. helpers/hg.go (Diff revision 10)
     
     
    Show all issues

    This should have documentation.

  3. repositories/hg.go (Diff revision 10)
     
     
    Show all issues

    Can we say "Mercurial repository" instead of "Hg repository", so it's less of a tautology?

  4. 
      
brennie
david
  1. 
      
  2. helpers/hg.go (Diff revisions 10 - 11)
     
     
    Show all issues

    Typo: repsonsible -> responsible

  3. 
      
brennie
brennie
brennie
brennie
david
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to master (aefa014)