My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2604: REST API to check that a given revision exists in a project
1 person starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  ----
Closed:  Jul 2014


Sign in to add a comment
 
Project Member Reported by david.pu...@sonymobile.com, Apr 13, 2014
The REST API allows to create a branch with:

  PUT /projects/MyProject/branches/stable HTTP/1.0
  Content-Type: application/json;charset=UTF-8
  {
    "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
  }

Before calling this API, I want to be able to verify that the revision being passed is valid.  Something like:

  GET /projects/MyProject/revisions/76016386a0d8ecc7b6be212424978bb45959d668

Note that the revision does not necessarily point to a commit that belongs to a Gerrit change.  It could be a commit that has been directly pushed to the repository.

Apr 14, 2014
#1 dborowitz@google.com
What is the current behavior of that PUT request? If it returns an error, that seems like correct behavior. (If not, we should fix that. :) We could add such an endpoint to check a revision, but the sequence you're describing is inherently racy. Returning an error from the PUT request is not.
Apr 14, 2014
#2 david.pu...@gmail.com
> What is the current behavior of that PUT request?

It returns an error, as expected.

But in this particular use case, issuing the PUT request is not desired as that will actually create the branch when the revision is valid.

Branch creations are going to be queued up in an external tool.  We want to be able to do some kind of pre-validation before executing them.  That includes checking that the given branch point is valid.

Jul 8, 2014
Project Member #3 edwin.ke...@gmail.com
https://gerrit-review.googlesource.com/58332
Status: ChangeUnderReview
Jul 10, 2014
Project Member #4 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Submitted
Labels: FixedIn-2.10
Jan 27, 2015
Project Member #5 ziv...@gmail.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting