Commit Graph

50 Commits (c9432d716811796392685470536a4eeccabcf697)

Author SHA1 Message Date
Aaron Gable 6f5a8d9987 Flip gerrit_util to raise exceptions on 404 by default
This makes the library behave more like what we'd expect,
while still allowing certain function to specify that
returning 204 or 404 is expected/acceptable behavior.

Change-Id: If3ce5598d1603819ee97aaeab0072a9e786ed96d
Reviewed-on: https://chromium-review.googlesource.com/481043
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable 19ee16c860 Reland "Refactor ReadHttpResponse to be error-friendlier"
Gerrit sometimes returns a full response json object at
the same time as returning a non-200 status code. This
refactor makes it easier for calling code to request
access to that object and handle error cases on its own.

The original version of this commit had a bug where
ReadHttpResponse properly set the default value for
accept_statuses, but all calls which came through
ReadHttpJsonResponse were setting None instead.

Bug: 710028
Change-Id: I8cee435d8acd487fb777b3fd69b5e48e19d2e5a3
Reviewed-on: https://chromium-review.googlesource.com/481060
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable 382674be12 Revert "Refactor ReadHttpResponse to be error-friendlier"
This reverts commit 6d7ab1bfe5.

Reason for revert: Stacktrace:
 File "/s/depot_tools/gerrit_util.py", line 816, in GetAccountDetails
   return ReadHttpJsonResponse(conn)
 File "/s/depot_tools/gerrit_util.py", line 376, in ReadHttpJsonResponse
   fh = ReadHttpResponse(conn, accept_statuses)
 File "/s/depot_tools/gerrit_util.py", line 365, in ReadHttpResponse
   if response.status not in accept_statuses:
TypeError: argument of type 'NoneType' is not iterable

Original change's description:
> Refactor ReadHttpResponse to be error-friendlier
> 
> Gerrit sometimes returns a full response json object at
> the same time as returning a non-200 status code. This
> refactor makes it easier for calling code to request
> access to that object and handle error cases on its own.
> 
> Bug: 710028
> Change-Id: Id1017d580d2fb843d5ca6287efcfed8775c52cd6
> Reviewed-on: https://chromium-review.googlesource.com/479450
> Commit-Queue: Aaron Gable <agable@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> 

TBR=agable@chromium.org,tandrii@chromium.org,chromium-reviews@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ia9d9ce835e207a32e7cc8ee35c0cf40c823c7b78
Reviewed-on: https://chromium-review.googlesource.com/481059
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable 6d7ab1bfe5 Refactor ReadHttpResponse to be error-friendlier
Gerrit sometimes returns a full response json object at
the same time as returning a non-200 status code. This
refactor makes it easier for calling code to request
access to that object and handle error cases on its own.

Bug: 710028
Change-Id: Id1017d580d2fb843d5ca6287efcfed8775c52cd6
Reviewed-on: https://chromium-review.googlesource.com/479450
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov 4956f798fb git cl: suggest git cl creds-check if Gerrit API returns 401.
R=sergiyb@chromium.org
BUG=708785

Change-Id: Id25d3ef9a1449a0c259ed48b782e1b766e1a5fc9
Reviewed-on: https://chromium-review.googlesource.com/472906
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Aaron Gable d2db5a2240 gerrit_util: stop accidentally using hostname as cache path
httplib2 uses an on-disk cache whose path is given by the
first argument to the httplib2.Http constructor. The `(host)`
parameter was left over from some earlier edition of this
code that didn't do on-disk caching.

Bug: 705046
Change-Id: I061324e4d1bbd680502230aefc73fe66daccaba1
Reviewed-on: https://chromium-review.googlesource.com/458967
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Andrii Shyshkalov bb86fbbef1 git cl upload for Gerrit: warn if uploader is not CL owner.
R=agable@chromium.org
BUG=653172

Change-Id: I141a1422a8f526040fe80522a41d14e2cd8cfc07
Reviewed-on: https://chromium-review.googlesource.com/458421
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
8 years ago
Raphael Kubo da Costa 89d04858c8 gerrit_util: Use httplib2 for communication instead of httplib.
Retain the httplib import to continue using its constants, but actually make
the http(s) connections using httplib2. The latter has built-in support for
proxy settings, which then actually allows people behind proxies to interact
with Gerrit.

Compared to httplib, the biggest changes are:
- There's only one Http class instead of HTTPConnection and HTTPSConnection.
- Http.request() returns a tuple (response, contents).
- Http.request() expects a full URI instead of just a path, as Http's
  constructor does not take a host parameter.
- The response object inherits from dict.
- All headers in a response are lower-cased.

All in all, it is possible to see that httplib2 support was retro-fitted
into the code, but that should not worsen its readability.

Changes since https://chromium-review.googlesource.com/c/458221/:
- Catch httplib2.ServerNotFoundError exceptions in GceAuthenticator, as httplib2
  catches socket.gaierror (which was previously being used to detect when
  metadata.google.internal was not accessible) and throws a ServerNotFoundError
  exception instead.

Patch written in collaboration with Alexis Menard <alexis.menard@intel.com>.

BUG=672729
R=alexis.menard@intel.com,agable@chromium.org,tandrii@chromium.org

Change-Id: Iaefa9caf3d8c0bc6ff67f562cd0b6bd9fade2f24
Reviewed-on: https://chromium-review.googlesource.com/458480
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Raphael Kubo da Costa (rakuco) <raphael.kubo.da.costa@intel.com>
8 years ago
Aaron Gable 25ab6a34c2 Revert "gerrit_util: Use httplib2 for communication instead of httplib."
This reverts commit d75686454b.

Reason for revert:
third_party.httplib2.ServerNotFoundError: Unable to find the server at metadata.google.internal

Original change's description:
> gerrit_util: Use httplib2 for communication instead of httplib.
> 
> Retain the httplib import to continue using its constants, but actually make
> the http(s) connections using httplib2. The latter has built-in support for
> proxy settings, which then actually allows people behind proxies to interact
> with Gerrit.
> 
> Compared to httplib, the biggest changes are:
> - There's only one Http class instead of HTTPConnection and HTTPSConnection.
> - Http.request() returns a tuple (response, contents).
> - Http.request() expects a full URI instead of just a path, as Http's
>   constructor does not take a host parameter.
> - The response object inherits from dict.
> - All headers in a response are lower-cased.
> 
> All in all, it is possible to see that httplib2 support was retro-fitted
> into the code, but that should not worsen its readability overall.
> 
> Patch written in collaboration with Alexis Menard <alexis.menard@intel.com>.
> 
> BUG=672729
> R=​alexis.menard@intel.com,agable@chromium.org,tandrii@chromium.org
> 
> Change-Id: Ic40e804064e74e89bc2ad979572628f1bd78c19a
> Reviewed-on: https://chromium-review.googlesource.com/458221
> Reviewed-by: Aaron Gable <agable@chromium.org>
> Commit-Queue: Raphael Kubo da Costa (rakuco) <raphael.kubo.da.costa@intel.com>
> 

TBR=agable@chromium.org,alexis.menard@intel.com,raphael.kubo.da.costa@intel.com,tandrii@chromium.org,chromium-reviews@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=672729

Change-Id: Idfacd314b381232733bb92a02ec2fb85f016effd
Reviewed-on: https://chromium-review.googlesource.com/457792
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Raphael Kubo da Costa d75686454b gerrit_util: Use httplib2 for communication instead of httplib.
Retain the httplib import to continue using its constants, but actually make
the http(s) connections using httplib2. The latter has built-in support for
proxy settings, which then actually allows people behind proxies to interact
with Gerrit.

Compared to httplib, the biggest changes are:
- There's only one Http class instead of HTTPConnection and HTTPSConnection.
- Http.request() returns a tuple (response, contents).
- Http.request() expects a full URI instead of just a path, as Http's
  constructor does not take a host parameter.
- The response object inherits from dict.
- All headers in a response are lower-cased.

All in all, it is possible to see that httplib2 support was retro-fitted
into the code, but that should not worsen its readability overall.

Patch written in collaboration with Alexis Menard <alexis.menard@intel.com>.

BUG=672729
R=alexis.menard@intel.com,agable@chromium.org,tandrii@chromium.org

Change-Id: Ic40e804064e74e89bc2ad979572628f1bd78c19a
Reviewed-on: https://chromium-review.googlesource.com/458221
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Raphael Kubo da Costa (rakuco) <raphael.kubo.da.costa@intel.com>
8 years ago
Andrii Shyshkalov 0a0b067e6b git cl creds-check: add reporting.
BUG=689543

Change-Id: I2c5dd9e1ef4a23ba805c8c057ad44c87cfb65a5b
Reviewed-on: https://chromium-review.googlesource.com/455782
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
8 years ago
Aaron Gable b7cb65a58d git-cl: Make 'failed to add as cc' message less scary
BUG=665263

Change-Id: If72f3e5369ea0df170916c353be5188167c7aecb
Reviewed-on: https://chromium-review.googlesource.com/454977
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Andrii Shyshkalov 892e9c2674 gerrit_util and my_activity: fix fetching >400 changes from Gerrit.
BUG=698625

Change-Id: I892f09e8b7ff752b6a45c556a594f486000530e8
Reviewed-on: https://chromium-review.googlesource.com/451383
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov 1897532850 Python style fixes + unused imports removal in git cl and friends.
R=sergiyb@chromium.org
BUG=

Change-Id: I9b886100557bf6efa9be07d40175f7bb919f5294
Reviewed-on: https://chromium-review.googlesource.com/432456
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov 9c3a464bf7 For Gerrit: use CURRENT_COMMIT option to get description, not gitiles.
R=sergiyb@chromium.org
BUG=681704

Change-Id: I48804955d8e5e579eae6e60fccac304aaaa9230e
Reviewed-on: https://chromium-review.googlesource.com/430625
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov 5b04a57ab2 git cl + gerrit_util: improve diagnostic logging.
BUG=681704

Change-Id: I1a774350aea901d4e9f2468cff111cbbcd7f3388
Reviewed-on: https://chromium-review.googlesource.com/430794
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
8 years ago
dimu 833c94c6fb Create recipe_modules/gerrit to interact with gerrit REST API
BUG=
R=mmoss,agable

Change-Id: I6410c28280ed05cf384a3da93e6b154c6081e039
Reviewed-on: https://chromium-review.googlesource.com/427375
Reviewed-by: Michael Moss <mmoss@chromium.org>
8 years ago
Aaron Gable 59f4851751 Don't send email to CCs by default on initial upload
It looks like this regressed when we switched from specifying CCs
via the refspec arguments to using the API.

BUG=680605

Change-Id: Iabd397b639989f050932188b1a1aa488639ffbbe
Reviewed-on: https://chromium-review.googlesource.com/427344
Reviewed-by: Andrew Bonventre <andybons@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable e9373d6e92 Clean up after failed gerrit cl description edits
If either the edit creation or edit publishing fail, we're left with
an unpublished edit hanging around. This can result in a follow-up
invocation of 'git cl desc' (e.g. if the user changes their mind, or
retries) will also fail. So, clean up after ourselves.

BUG=671091

Change-Id: Icfe53996acf2555b82be0695a3c86ebb8c50b936
Reviewed-on: https://chromium-review.googlesource.com/418449
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Andrii Shyshkalov ea4fc839ce Gerrit git cl desc: don't notify reviwers.
R=agable@chromium.org
BUG=644101
TEST=manual

Change-Id: I82b7209981a834c8f26d65d2701d665a4eb2ba51
Reviewed-on: https://chromium-review.googlesource.com/415829
Reviewed-by: Aaron Gable <agable@chromium.org>
8 years ago
Ravi Mistry 0bfa9ad781 Allow overriding via env var path to .gitcookies in gerrit_util.py
This is to make it easy to specify a different .gitcookies for bots.

BUG=skia:5979

Change-Id: Iaeb148d25f1c2c3d06ab5e1b155999566ef5f294
Reviewed-on: https://chromium-review.googlesource.com/413075
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Ravi Mistry <rmistry@google.com>
8 years ago
Ravi Mistry fad941ba3d Add env variable to skip GceAuthenticator for Gerrit CLs
BUG=skia:5979

Change-Id: I063a79a3877f4ad778bfbcbca3ddee49e6504ede
Reviewed-on: https://chromium-review.googlesource.com/411386
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Ravi Mistry <rmistry@google.com>
8 years ago
Dan Jacques 8d11e482fe Strip netrc hack, rewrite file.
Strip the netrc hack; apparently it only works on some versions of
Python, and the bots have many different versions.

Instead, we will actually emit the modified netrc as a new file without
comments or newlines, then read that directly from the vanilla netrc
module.

BUG=chromium:664664
TEST=None

Change-Id: I245759e2eae4e6ddcdffa0aaef59866a62bd0240
Reviewed-on: https://chromium-review.googlesource.com/411416
Commit-Queue: Daniel Jacques <dnj@chromium.org>
Reviewed-by: Ryan Tseng <hinoka@chromium.org>
Reviewed-by: Michael Moss <mmoss@chromium.org>
8 years ago
Dan Jacques 1d949fd373 "netrc" hack to strip comments before processing.
Processing comments seems to trigger a bug on (some?) Windows systems
due to a negative seek. This CL runs a comment-free version of the
"netrc" file through the parser.

BUG=chromium:664664
TEST=local
  - Uploaded this CL with the change.

Change-Id: I65f5d2f8c1162b3b3a13c66d8becb1cfccf27991
Reviewed-on: https://chromium-review.googlesource.com/411455
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Daniel Jacques <dnj@chromium.org>
8 years ago
Dan Jacques 6d5bcc2bb6 gerrit_util: work with all paths.
BUG=chromium:664664
TEST=local
  - Didn't work locally, now it does.

Change-Id: I5d470feda420342b0fb00a56e42a2b7d00257920
Reviewed-on: https://chromium-review.googlesource.com/411284
Reviewed-by: Aaron Gable <agable@chromium.org>
8 years ago
smut 43906384aa Fix authorization support
The path always starts with a / so we need to check if it starts with /a/ to see if it's already authorized, not a/.

BUG=664664

Change-Id: I2bf6abe36dd88bc7d096e67d5e7a56fe9f143f47
Reviewed-on: https://chromium-review.googlesource.com/410721
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: First Last <smut@chromium.org>
8 years ago
Andrii Shyshkalov c6c8b4c99b presubmit_support for Gerrit: don't ignore 404.
Before, presubmit_support would fail with not very useful stacktrace if
Gerrit returns 404, which is usually due to missing/invalid credentials.

This CL fixes that and improves the exception message, and also improves
logic in git_cl.

R=agable@chromium.org
BUG=

Change-Id: Iae8f0c24422c46af70929c7d5d71993164887511
Reviewed-on: https://chromium-review.googlesource.com/409650
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable df86e30194 Clean up gerrit_util's handling of unknown reviewer/cc
This is still important, but at least now it won't result
in a stacktrace.

Change-Id: If6e7e15a98b0a03df7e978201762fea670312ede
Reviewed-on: https://chromium-review.googlesource.com/408660
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
agable 32978d969c git-cl-land: print url of final commit location
BUG=661187

Review-Url: https://codereview.chromium.org/2466953003
8 years ago
tandrii 8818977467 Reland of Add CC_LIST and --cc to Gerrit issues via API to be similar to CCs in Rietveld
Originally landed as issue 2378703002 at patchset 60001
(http://crrev.com/2378703002#ps60001).

BUG=chromium:649660
TBR=rmistry@chromium.org

Review-Url: https://codereview.chromium.org/2376323002
9 years ago
tandrii 31d165a5c1 Revert of Add CC_LIST and --cc to Gerrit issues via API to be similar to CCs in Rietveld (patchset #4 id:60001 of https://codereview.chromium.org/2378703002/ )
Reason for revert:
Actually, it doesn't break uploads, add cc-ed emails post-upload fails with exception and confuses users, and I couldn't find workaround.

Original issue's description:
> Add CC_LIST and --cc to Gerrit issues via API to be similar to CCs in Rietveld
>
> BUG=chromium:649660
>
> Committed: 3574740929

TBR=rmistry@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:649660

Review-Url: https://codereview.chromium.org/2375393002
9 years ago
rmistry 3574740929 Add CC_LIST and --cc to Gerrit issues via API to be similar to CCs in Rietveld
BUG=chromium:649660

Review-Url: https://codereview.chromium.org/2378703002
9 years ago
dsansome e2d6fd987e Prompt to delete pending edits before changing the Gerrit CL description.
BUG=641838

Review-Url: https://codereview.chromium.org/2318903002
9 years ago
qyearsley 12fa6ff69b Run auto-spell-checker (codespell) on files in depot_tools.
This should only change spelling in:
 - messages that are printed
 - comments
 - docstrings

Review-Url: https://codereview.chromium.org/2277513002
9 years ago
tandrii@chromium.org c767e3f297 GetChangeDescriptionFromGitiles followup: future todo for no gitiles.
R=andybons@chromium.org
BUG=603207, 605563

Review URL: https://codereview.chromium.org/1913913002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300194 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
scottmg@chromium.org 6d1266eef6 Make `git cl description` work for Gerrit
Example change at https://chromium-review.googlesource.com/c/340430/.

R=tandrii@chromium.org
BUG=603207

Review URL: https://codereview.chromium.org/1917473002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300188 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
hinoka@chromium.org 56d0de79a7 Revert of Make `git cl description` work for Gerrit (patchset #2 id:20001 of https://codereview.chromium.org/1917473002/ )
Reason for revert:
Broke presubmit

Original issue's description:
> Make `git cl description` work for Gerrit
> 
> This works in that it actually changes the description, but after
> multiple changes, there's multiple footers added. I'm not sure if they
> should be stripped in setting the description? Or is the problem in
> FetchDescription() where it shouldn't be returning
> 'commit_with_footers', but rather something else?
> 
> Example change at https://chromium-review.googlesource.com/c/340430/.
> 
> R=tandrii@chromium.org
> BUG=603207
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=300169

TBR=tandrii@chromium.org,scottmg@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=603207

Review URL: https://codereview.chromium.org/1922733002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300175 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
scottmg@chromium.org 4d038b4334 Make `git cl description` work for Gerrit
This works in that it actually changes the description, but after
multiple changes, there's multiple footers added. I'm not sure if they
should be stripped in setting the description? Or is the problem in
FetchDescription() where it shouldn't be returning
'commit_with_footers', but rather something else?

Example change at https://chromium-review.googlesource.com/c/340430/.

R=tandrii@chromium.org
BUG=603207

Review URL: https://codereview.chromium.org/1917473002 .

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300169 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 2d3da63e29 Fetch Gerrit cl description from gitiles.
R=andybons@chromium.org,scottmg@chromium.org
BUG=603207,605563

Review URL: https://codereview.chromium.org/1916123002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300161 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org fe30f18fc5 Gerrit git cl upload: add check for missing credentials.
Checks creds before uploading and running presubmit, generalizing
the case of Rietveld. If they are missing, suggests a URL to
generate them.

R=andybons@chromium.org,phajdan.jr@chromium.org
BUG=583153

Review URL: https://codereview.chromium.org/1882583003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299883 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org c7da66a41b Fix gerrit_util to use non None body.
Gerrit requires Content-Length to be set for POST requests.
httplib Python library has a bug which doesn't set Content-Length
if the body is empty.

Python BUGS:
https://bugs.python.org/issue14721 (partial fix)
https://bugs.python.org/issue23539 (full fix)

The full fix only appears in 2.7.11 release changelog
(technically, it's been fixed in 2.7.10 rc1, but 2.7.10 was not
released):
https://hg.python.org/cpython/raw-file/53d30ab403f1/Misc/NEWS

R=andybons@chromium.org,szager@chromium.org
BUG=579160

Review URL: https://codereview.chromium.org/1827653002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299459 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
mmoss@chromium.org c349971db4 Fix some path processing to work better on Windows.
R=hinoka@chromium.org
BUG=555036

Review URL: https://codereview.chromium.org/1471973004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297698 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
phajdan.jr@chromium.org ff7840a87c depot_tools: add .gitcookies support to gerrit_util
BUG=551403

Review URL: https://codereview.chromium.org/1419173011

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297450 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
dnj@chromium.org a5a2c8a680 gerrit_util: Add GCE metadata server auth.
BUG=chromium:532318
TEST=None

Review URL: https://codereview.chromium.org/1350673004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@296930 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
szager@chromium.org f202a250d6 Provide diagnostic messages about netrc failures.
BUG=376546
R=mmoss@chromium.org,agable@chromium.org

Review URL: https://codereview.chromium.org/293113005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@273002 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
nodir@chromium.org 5259508913 Changed error message on no auth in .netrc
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@272343 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
nodir@chromium.org ce32b6e3d0 gerrit_util is aware of auth errors
gerrit_util raises GerritAuthenticationError with a nice message
suggesting to check the .netrc file.

R=szager@chromium.org, vadimsh@chromium.org
BUG=369512

Review URL: https://codereview.chromium.org/278203002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@269865 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
nodir@chromium.org a779803c2b trychange.py: Gerrit protocol
This change implements Gerrit protocol for posting try jobs. The
"protocol" is described here:
https://code.google.com/p/chromium/issues/detail?id=366099#c10

CLs for Buildbot:
https://codereview.chromium.org/250983003/
https://codereview.chromium.org/259323003/

R=vadimsh@chromium.org, maruel@chromium.org, kmg@chromium.org
BUG=366099, 364639, 364631

Review URL: https://codereview.chromium.org/254133007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@267379 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
deymo@chromium.org f8be27699b my_activity: Port gerrit to the new gerrit_util API.
This patch adds a new function QueryAllChanges to gerrit_util.py
allowing the caller to iterate the list of changes regardless the
maximum limit of changes per request that the server supports (by
default 500 according to gerrit's documentation).

my_activity.py is ported to use this function instead of urllib2 to
manually make the request. This also adds support for authentication
since gerrit_util.py already supports it, and the internal gerrit
instance is now re-enabled.

Finally, two minor bugs are fixed on the hanlding of returned
results: The DETAILED_ACCOUNTS option is passed to gerrit to request
the email addresses of the referenced users and users without an
email address, such as the "Gerrit Code Review" user on the internal
gerrit, are now supported.

BUG=chromium:311649,chromium:281695
TEST=Manual run "my_activity.py -u USER" for some users.

Review URL: https://codereview.chromium.org/50283002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@233166 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org b469623afd Add git/gerrit-on-borg utilities.
gob_util.py is a general-purpose library for communicating with the
gerrit-on-borg service.

testing_support/gerrit_test_case.py is a unittest framework for
testing code that interacts with gerrit.

R=vadimsh@chromium.org, cmp@chromium.org
BUG=

Review URL: https://codereview.chromium.org/26399002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@228965 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago