Commit Graph

212 Commits (f3a20aed8256b4d1983886e1ec4b543f684a9b1e)

Author SHA1 Message Date
Andrii Shyshkalov f3a20aed82 git cl: remove code related to pending refs and gnumbd.
Refactor _GitNumbererState to two functions and remove no longer
useful tests.

BUG=644915
R=agable@chromium.org

Change-Id: If5e3e3b141aee192211f6af130b01f20f9afdbfe
Reviewed-on: https://chromium-review.googlesource.com/431976
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Christopher Lam f732cd5c70 Add cl description backup to gerrit upload.
BUG=684261

Change-Id: I2716864526fcedf44e561be8512843e12810e3a9
Reviewed-on: https://chromium-review.googlesource.com/431459
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov 258e0a653c Gerrit git cl: cache change detail to save on RPC calls.
R=sergiyb@chromium.org
BUG=681704

Change-Id: I5c320f7e6442a92ae0574e2ca6481a082e82568a
Reviewed-on: https://chromium-review.googlesource.com/430795
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
8 years ago
Andrii Shyshkalov 351c61da20 Fix git cl on windows for git-numberer repos.
Git cl decides if git-numberer is enabled on a repository by writing
Gerrit's project.config from refs/meta/config into a tempfile, which is
then queried using `git config -f tempfile --get ...`.  The file itself
is only flushed, but not closed after writing because Python's
tempfile.NamedTemporaryFile is deleted on closing. This worked fine on
Linix/Mac, but not on Windows, where `git config` apparently doesn't see
file or its contents.

This CL rewrites the above using yet another contexmanager temp
directory into which a file is written and closed before git config is
ran.

R=machenbach@chromium.org,grt@chromium.org
BUG=683202

Change-Id: I7974d66b1b2b0478ab4b6f7ac04e547a4981c46c
Reviewed-on: https://chromium-review.googlesource.com/430719
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
8 years ago
Aaron Gable e447411c4e Remove unused FORCE_HTTPS_COMMIT_URL parameter from git-cl
BUG=

Change-Id: Ib8953a7fea4e3cd1c17ea277b5310a31821bfbe8
Reviewed-on: https://chromium-review.googlesource.com/431050
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@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 b56ad33d00 Respect -t/--title in initial cl uploads to Gerrit
BUG=674254

Change-Id: Icdc572648dfffeca7e28f327e085f64985221ce9
Reviewed-on: https://chromium-review.googlesource.com/425823
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Aaron Gable 1bc7bfe5d9 Remove SVN (and dcommit) support from git-cl
BUG=638750

Change-Id: I9ebe4ff861a37433209b66f4050370b49f17cdc7
Reviewed-on: https://chromium-review.googlesource.com/419661
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Quinten Yearsley b2cc4a94da depot_tools: Replace pylint error numbers with symbolic names.
This affects a bunch of files, but only changes comments,
and shouldn't make any difference to behavior.

The purpose is to slightly improve readability of pylint
disable comments.

Change-Id: Ic6cd0f8de792b31d91c6125f6da2616450b30f11
Reviewed-on: https://chromium-review.googlesource.com/420412
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
8 years ago
Aaron Gable 9b713dd18b Generate patchset name from commit subject
This is a reland of 947f2ee808,
which was reverted in a5a1eea537

BUG=672332

Change-Id: If33c54e500fbeac11f60d81a19549880506c63d8
Reviewed-on: https://chromium-review.googlesource.com/419737
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable 02cdbb45a7 Fix gerrit/gitiles typo in git_cl
This is a fix to 32978d969c,
which introduced a "Landed as <gerrit link>" feature to git-cl, but
which at the last minute introduced a typo causing the whole feature
to not actually work.

BUG=661187

Change-Id: Ifef3379a51f035973bc5f3842862528f90bfdf84
Reviewed-on: https://chromium-review.googlesource.com/419782
Reviewed-by: Stephen Martinis <martiniss@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Andrii Shyshkalov b5effa1f24 git cl + git numberer: fix 3+ lineage ordering.
In other words, end 2 end test was a really awesome idea.

R=machenbach@chromium.org,sergiyb@chromium.org
BUG=642493
TEST=git cl land of https://codereview.chromium.org/2575043003 succeeded

Change-Id: I568ce79baf109b2aa556e4343527b63f39c10d00
Reviewed-on: https://chromium-review.googlesource.com/419478
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
8 years ago
Andrii Shyshkalov 8f15f3ec1d git cl refactor: s/should_git_number/should_add_git_number
R=sergiyb@google.com
BUG=chromium:642493

Change-Id: Id7b732d82c25ce88a3295ff54c79cf2a66e0d5b9
Reviewed-on: https://chromium-review.googlesource.com/419437
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov a5a1eea537 Revert "Generate patchset name from commit subject"
This reverts commit 947f2ee808.

Reason for revert: unnecessarily sets the title for the first upload,
which isn't done for Rietveld.

Original change's description:
> Generate patchset name from commit subject
> 
> BUG=672332
> 
> Change-Id: If9c662f11b217a52cac7c9c47ad9f3d978148c2e
> Reviewed-on: https://chromium-review.googlesource.com/419330
> 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
BUG=672332
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I9dcec1b02c8f16ceca8338acef4a1fc174aef35c
Reviewed-on: https://chromium-review.googlesource.com/419517
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Aaron Gable 947f2ee808 Generate patchset name from commit subject
BUG=672332

Change-Id: If9c662f11b217a52cac7c9c47ad9f3d978148c2e
Reviewed-on: https://chromium-review.googlesource.com/419330
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov cbec8efcee git cl + git-numberer: add extra regression test case.
R=machenbach@chromium.org
BUG=chromium:642493,672043

Change-Id: Ie50637d6e01e40ddd15dcdfc1430c9554fa82976
Reviewed-on: https://chromium-review.googlesource.com/418715
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov 828701bdf3 Gerrit: git cl set-commit -d: don't spam reviwers/owner.
R=sergiyb@chromium.org,machenbach@chromium.org
BUG=

Change-Id: Ia89e91479c22adeebc85a4432cd9f7b8d95a8fde
Reviewed-on: https://chromium-review.googlesource.com/418655
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov f01be229a7 git cl: insert "Review-Url" instead "Review URL" footer like CQ.
R=sergiyb@chromium.org

Change-Id: I2df867e381ceb1035add84563d3b444b0ee0ea94
Reviewed-on: https://chromium-review.googlesource.com/417267
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov 768f1d88a0 git cl: use gnumbd config instead of PENDING_REF_PREFIX of codereview.settings.
BUG=chromium:642493,672043
R=machenbach@chromium.org,iannucci@chromium.org

Change-Id: I0abc31b95b1766fd5fd24c1379b538d0c5291011
Reviewed-on: https://chromium-review.googlesource.com/417259
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
8 years ago
Andrii Shyshkalov cd6a9363ef git_cl: add GitNumbererState in preparation to stop gnumbd service.
The new class is unused and doesn't change any existing functionality.

BUG=chromium:642493
R=machenbach@chromium.org,iannucci@chromium.org

Change-Id: Id3fe71b07b694339f0a620b427816e52560069d8
Reviewed-on: https://chromium-review.googlesource.com/416430
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Andrii Shyshkalov a6695810bb git cl replacing gnumbd: set correct committer timestamp.
BUG=642493
R=sergiyb@chromium.org

Change-Id: I5d8588f2b6f30368188aecab2d2c462a11aa6883
Reviewed-on: https://chromium-review.googlesource.com/414369
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
8 years ago
Andrii Shyshkalov 15e50cc5c4 git cl: implement git number footer generation.
BUG=642493

Change-Id: Ic8eb121b0ad7adcc7a3f3f1967ef2261f415e731
Reviewed-on: https://chromium-review.googlesource.com/414466
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
9 years ago
Aaron Gable a45ee11d6e Use 'change' instead of 'issue' when talking about Gerrit CLs
Change-Id: I17884d9ef7efdaf75ed575e66aca1034db0672b5
Reviewed-on: https://chromium-review.googlesource.com/413289
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
9 years ago
Andrii Shyshkalov b8c535f696 Use codereview.settings style for GENERATE_GIT_NUMBER_FOOTERS.
R=sergiyb@chromium.org
BUG=642493

Change-Id: Ic4acf4076fdf27c1ed5e75f0ed1dda4b16d675fc
Reviewed-on: https://chromium-review.googlesource.com/414469
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
9 years ago
Andrii Shyshkalov 5fb4774810 git cl: rework setting to auto-generate git number footers.
BUG=642493

Change-Id: I1c83c54f7ad938cf4abeadb42f8d9414521d6dc5
Reviewed-on: https://chromium-review.googlesource.com/414465
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
9 years ago
Andrii Shyshkalov 06a2502fc9 git cl land: add test expectations for Rietveld.
This is preperatory work for Cr- footers generation in git cl instead
of gnumbd.

BUG=642493

Change-Id: I4cfdd882fe6caa7972e51ffa81d335104ddb56dd
Reviewed-on: https://chromium-review.googlesource.com/414464
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
9 years ago
Ravi Mistry fda50ca02d Skip checking local vs remote patchset for Gerrit
BUG=chromium:664520

Change-Id: Idd5855e14f6237577b351ff51582335996522417
Reviewed-on: https://chromium-review.googlesource.com/399118
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
9 years ago
scottmg b84b5e3a13 Don't --find-copies-harder when printing informational diff, either
We're doing the diff twice afaict, once to print stats to the user, and
once to actually do the upload. Definitely no need to
--find-copies-harder in the print.

Previously: https://codereview.chromium.org/2488823002.

R=dpranke@chromium.org
BUG=544889

Review-Url: https://codereview.chromium.org/2489963003
9 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>
9 years ago
tandrii 8c5a353e63 Implement and test git cl try for Gerrit.
R=borenet@chromium.org,qyearsley@chromium.org
BUG=599931

Review-Url: https://codereview.chromium.org/2468263005
9 years ago
agable 32978d969c git-cl-land: print url of final commit location
BUG=661187

Review-Url: https://codereview.chromium.org/2466953003
9 years ago
qyearsley 136b49ff7e depot_tools: Remove DoGetTrySlaves, GetTrySlavesExecuter, GetPreferredTrySlaves
Note: This CL originally just removed a deprecated use of Remove use of DoGetTrySlaves, suggested in http://crrev.com/2442153002, then was expanded to remove DoGetTrySlaves, GetPreferredTrySlaves and GetTrySlavesExecuter since these are all deprecated and unused.

BUG=660453

Review-Url: https://codereview.chromium.org/2453823002
9 years ago
qyearsley 123a468d14 git cl try: support multiple bots from different masters without specifying master.
It might be good to make this change after the refactoring CL http://crrev.com/2442153002.

BUG=640740

Review-Url: https://codereview.chromium.org/2439293002
9 years ago
qyearsley 5eb0519b4c git cl try: Remove --name option, stop sending "reason" property.
When triggering the build, there's a field called "reason",
which is currently populated by default with the user's
branch name.

I have a feeling that this is optional and could be completely
omitted.

Andrii notes that if users want to send a "reason" string,
they could send invoke git cl try with the argument -p reason="<reason>".

PSA on infra-dev:
https://groups.google.com/a/chromium.org/d/msg/infra-announce/PXkM1WinTYY/w2IvN5B4AwAJ

BUG=659552

Review-Url: https://codereview.chromium.org/2428383010
9 years ago
skobes 6468b9068b Make git cl patch work with binary files.
BUG=557512

Review-Url: https://codereview.chromium.org/2445543002
9 years ago
bradnelson d975b30c20 Automatically CC folks listed in CC= lines.
Detect CC=<users> lines the way we detect R= and TBR=.
Add these as CC'ed users for rietveld and gerrit.

R=iannucci@chromium.org,hinoka@chromium.org,dnj@chromium.org

Review-Url: https://codereview.chromium.org/2433323004
9 years ago
borenet 6c0efe6050 Add -B/--bucket flag to git-cl try
BUG=

Review-Url: https://chromiumcodereview.appspot.com/2419113002
9 years ago
tandrii 48df58136d Gerrit git cl: make it work with minimal file.
BUG=656555
R=emso@chromium.org,andybons@chromium.org

Review-Url: https://codereview.chromium.org/2421253002
9 years ago
tandrii de281aee41 git cl try: make code less Rietveld-specific.
This also adds first test to cover case of custom properties.

R=machenbach@chromium.org,sergiyb@chromium.org
BUG=599931

Review-Url: https://codereview.chromium.org/2409223002
9 years ago
tandrii 45b2a5891a git cl try-results regression tests for Gerrit.
The flow looks like this:

  $ git cl status
  Branches associated with reviews:
    gerrit-4483 : https://chromium-review.googlesource.com/381231 (waiting)

  $ git cl try-results
  Warning: Codereview server has newer patchsets (2) than most recent
  upload from local checkout (None). Did a previous upload fail?
  By default, git cl try uses latest patchset from codereview,
  continuing using such patchset 2.

  Warning: Some results might be missing because You are not logged in.
  Please login first by running:
    depot-tools-auth login chromium-review.googlesource.com
  Started:
    Infra Linux Precise 32 Tester https://luci-milo.appspot.com/swarming/...
    Infra Linux Trusty 64 Tester  https://luci-milo.appspot.com/swarming/...
  Total: 2 try jobs

  $ depot-tools-auth login chromium-review.googlesource.com
   <<<auth in my browser>>>

  Logged in to chromium-review.googlesource.com as <some@email.com>

	To login with a different email run:
		depot-tools-auth login chromium-review.googlesource.com
	To logout and purge the authentication token run:
		depot-tools-auth logout chromium-review.googlesource.com

  $ git config branch.gerrit-4483.gerritpatchset 2
  $ git cl try-results
  Started:
    Infra Linux Precise 32 Tester https://luci-milo.appspot.com/swarming/...
    Infra Linux Trusty 64 Tester  https://luci-milo.appspot.com/swarming/...
    Infra Mac Tester              https://luci-milo.appspot.com/swarming/...
  Total: 3 try jobs

R=sergiyb@chromium.org,emso@chromium.org
BUG=599931
TEST=new unittests + end-to-end local.

Review-Url: https://codereview.chromium.org/2392463009
9 years ago
tandrii c2405f5545 git cl patch: handle missing/wrong Gerrit issue better.
No stacktrace is printed, instead just a user-friendly string is shown.
Add test + some tests refactoring.

This CL also improve missing Gerrit issue exception elsewhere by raising
user-friendly exception.

BUG=654360
R=sergiyb@chromium.org
TEST=manual

Review-Url: https://codereview.chromium.org/2403793002
9 years ago
tandrii 221ab25f46 git cl try-results: refactor Rietveld + add tests.
R=emso@chromium.org,phajdan.jr@chromium.org
BUG=599931
TEST=new teste + local end-to-end

Review-Url: https://codereview.chromium.org/2395113002
9 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
tandrii 8da412cf5a Remove redundant output in git_cl.py tests.
R=agable@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2319903002
9 years ago
qyearsley 53f48a1c52 Add a --json option to git cl try-results.
For use in scripts that check try job results, this is
currently practically the same as making requests to
https://codereview.chromium.org/api/<cl-number>/<patchset-number>.

However, I think that this might be more future-proof, since
it fetches try job information from Buildbucket, and I expect
to still work after migration from Rietveld to Gerrit.

BUG=640354

Review-Url: https://codereview.chromium.org/2274743003
9 years ago
tandrii c4344b5958 Fix Gerrit git cl land and add test.
R=andybons@chromium.org
BUG=641127

Review-Url: https://codereview.chromium.org/2280563003
9 years ago
kmarshall 9249e01b70 git cl archive: Add "--dry-run" and "--notags" flags.
This CL adds a couple flags to "git cl archive".
dry-run: Lists the cleanup tasks, but exits before any changes are
made to Git.
notags: Deletes branches only; does not create archival tags.

R=tandrii@chromium.org,groby@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2276663002
9 years ago