Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Issue 2720853002: Fix GitBackend.checkout (Closed)

Created:
3 years, 9 months ago by nodir
Modified:
3 years, 9 months ago
CC:
chromium-reviews, infra-reviews+recipes-py_chromium.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix GitBackend.checkout GitBackend.checkout is problematic: - if allow_fetch=False and revision is not a commit, e.g. a branch, it checkouts whatever happens to be named locally without fetching, possibly stale. This is inconsistent with GitilesBackend which refuses to work if fetching isn't allowed. RemoteRunFactory worked only because it used a new workdir each time. - it does git-reset, potentionally moving a branch to a non-TOT commit, so next attempt to checkout a branch with allow_fetch=False will checkout that commit, not local TOT. - if a git repository already exists, does not check whether origin.url matches the requested one. This works only if revision is a commit. - does not fail on revision "origin/master", which is an invalid remote revision because origin is a locally configured remote. As a result other parts of the system pass this value already. Fix all those problems. R=iannucci@chromium.org, phajdan.jr@chromium.org BUG=696100

Patch Set 1 #

Patch Set 2 : Fix GitBackend.checkout #

Total comments: 6

Patch Set 3 : refs/heads/master #

Patch Set 4 : bug #

Total comments: 4

Patch Set 5 : bug and assert #

Patch Set 6 : tests #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -122 lines) Patch
M recipe_engine/fetch.py View 1 2 3 4 5 4 chunks +64 lines, -40 lines 2 comments Download
M recipe_engine/package.py View 1 2 3 4 5 2 chunks +2 lines, -2 lines 1 comment Download
M recipe_engine/unittests/fetch_test.py View 1 2 3 4 5 3 chunks +111 lines, -72 lines 0 comments Download
M unittests/autoroll_test.py View 1 2 3 4 5 2 chunks +13 lines, -8 lines 0 comments Download

Messages

Total messages: 26 (9 generated)
nodir
PTAL
3 years, 9 months ago (2017-02-27 19:04:00 UTC) #1
nodir
+dnj
3 years, 9 months ago (2017-02-27 20:14:26 UTC) #4
iannucci
looks better https://codereview.chromium.org/2720853002/diff/20001/recipe_engine/fetch.py File recipe_engine/fetch.py (right): https://codereview.chromium.org/2720853002/diff/20001/recipe_engine/fetch.py#newcode138 recipe_engine/fetch.py:138: # TODO(nodir): raise an exception this is ...
3 years, 9 months ago (2017-02-27 20:23:44 UTC) #5
nodir
https://codereview.chromium.org/2720853002/diff/20001/recipe_engine/fetch.py File recipe_engine/fetch.py (right): https://codereview.chromium.org/2720853002/diff/20001/recipe_engine/fetch.py#newcode138 recipe_engine/fetch.py:138: # TODO(nodir): raise an exception On 2017/02/27 20:23:44, iannucci ...
3 years, 9 months ago (2017-02-27 20:33:38 UTC) #6
iannucci
lgtm, though I would strongly consider just doing the restarts and then making this an ...
3 years, 9 months ago (2017-02-27 20:42:04 UTC) #7
iannucci
talked offline, nodir pinkie-swears[1] that he'll clean up the hack in the next week or ...
3 years, 9 months ago (2017-02-27 21:21:10 UTC) #8
nodir
https://codereview.chromium.org/2720853002/diff/60001/recipe_engine/fetch.py File recipe_engine/fetch.py (right): https://codereview.chromium.org/2720853002/diff/60001/recipe_engine/fetch.py#newcode138 recipe_engine/fetch.py:138: # TODO(nodir): raise an exception http://crbug.com/696704 On 2017/02/27 20:42:03, ...
3 years, 9 months ago (2017-02-27 21:23:31 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2720853002/80001
3 years, 9 months ago (2017-02-27 21:24:22 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: Recipes-py Presubmit on luci.infra.try (JOB_FAILED, https://luci-milo.appspot.com/swarming/task/349a477a0f447e10)
3 years, 9 months ago (2017-02-27 21:34:34 UTC) #14
nodir
PTAL again These changes are scary because this stuff looks fragile.
3 years, 9 months ago (2017-02-27 23:27:26 UTC) #15
iannucci
On 2017/02/27 23:27:26, nodir wrote: > PTAL again > > These changes are scary because ...
3 years, 9 months ago (2017-02-28 00:07:16 UTC) #20
iannucci
On 2017/02/28 00:07:16, iannucci wrote: > On 2017/02/27 23:27:26, nodir wrote: > > PTAL again ...
3 years, 9 months ago (2017-02-28 00:07:26 UTC) #21
Paweł Hajdan Jr.
Thanks for tackling this. Looks like a good robustness improvement. I've noticed your comment about ...
3 years, 9 months ago (2017-02-28 08:44:33 UTC) #22
nodir
On 2017/02/28 08:44:33, Paweł Hajdan Jr. wrote: > Thanks for tackling this. Looks like a ...
3 years, 9 months ago (2017-02-28 15:13:26 UTC) #23
nodir
On 2017/02/28 15:13:26, nodir wrote: > On 2017/02/28 08:44:33, Paweł Hajdan Jr. wrote: > > ...
3 years, 9 months ago (2017-02-28 15:17:47 UTC) #24
iannucci
Wait, I'm not sure why this is being abandoned? You already put work in to ...
3 years, 9 months ago (2017-02-28 18:04:06 UTC) #25
nodir
3 years, 9 months ago (2017-02-28 20:33:50 UTC) #26
Message was sent while issue was closed.
On 2017/02/28 18:04:06, iannucci wrote:
> Wait, I'm not sure why this is being abandoned? You already put work in to
make
> the code work better... is this 
> not landable after fixing the tests?

tests fail because of more assumptions that I've discovered that I don't have
cycles to fix

Powered by Google App Engine
This is Rietveld 408576698