|
|
Created:
6 years, 5 months ago by cmp Modified:
6 years, 5 months ago CC:
chromium-reviews, Dirk Pranke, cmp-cc_chromium.org, iannucci+depot_tools_chromium.org, ilevy-cc_chromium.org, luqui Base URL:
https://chromium.googlesource.com/chromium/tools/depot_tools.git@master Project:
tools Visibility:
Public. |
DescriptionAdd fallback to DEPS from a missing deps file.
It's possible to tell gclient to use a different
"deps" file from the default DEPS through the "deps_file"
variable in the .gclient file.
If this file is missing, fallback to DEPS (the
default).
BUG=390700
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=280921
Patch Set 1 #
Total comments: 6
Patch Set 2 : fix comment #Patch Set 3 : avoid testing for file existence twice when deps_file is already DEPS #
Total comments: 1
Patch Set 4 : let logging interpolate #
Total comments: 3
Patch Set 5 : update #Patch Set 6 : fix indent #Patch Set 7 : update test #
Messages
Total messages: 33 (0 generated)
LGTM, sorry for duplicating effort. https://codereview.chromium.org/368713002/diff/1/gclient.py File gclient.py (right): https://codereview.chromium.org/368713002/diff/1/gclient.py#newcode546 gclient.py:546: 'ParseDepsFile(%s): %s file found at %s' % ( While you're here, would be good to update this to logging.info('string %s here', foo) rather than directly formatting the string.
https://codereview.chromium.org/368713002/diff/1/gclient.py File gclient.py (right): https://codereview.chromium.org/368713002/diff/1/gclient.py#newcode541 gclient.py:541: deps_files = [self.deps_file, 'DEPS'] hm... would be best to uniq-ify this list. Otherwise you'll have it try to read DEPS twice https://codereview.chromium.org/368713002/diff/1/tests/gclient_test.py File tests/gclient_test.py (right): https://codereview.chromium.org/368713002/diff/1/tests/gclient_test.py#newcod... tests/gclient_test.py:813: """Verifies gclient respects fallback to DEPS.""" docstring is off.
https://codereview.chromium.org/368713002/diff/1/gclient.py File gclient.py (right): https://codereview.chromium.org/368713002/diff/1/gclient.py#newcode541 gclient.py:541: deps_files = [self.deps_file, 'DEPS'] On 2014/07/01 22:04:08, iannucci wrote: > hm... would be best to uniq-ify this list. Otherwise you'll have it try to read > DEPS twice Fixed. You'll get set()s one way or another. :) https://codereview.chromium.org/368713002/diff/1/tests/gclient_test.py File tests/gclient_test.py (right): https://codereview.chromium.org/368713002/diff/1/tests/gclient_test.py#newcod... tests/gclient_test.py:813: """Verifies gclient respects fallback to DEPS.""" On 2014/07/01 22:04:08, iannucci wrote: > docstring is off. Fixed in a version I uploaded earlier.
https://codereview.chromium.org/368713002/diff/40001/gclient.py File gclient.py (right): https://codereview.chromium.org/368713002/diff/40001/gclient.py#newcode541 gclient.py:541: deps_files = set([self.deps_file, 'DEPS']) yeah but order is still important and set() ordering is the same as dict ordering (read: not defined).
https://codereview.chromium.org/368713002/diff/1/gclient.py File gclient.py (right): https://codereview.chromium.org/368713002/diff/1/gclient.py#newcode546 gclient.py:546: 'ParseDepsFile(%s): %s file found at %s' % ( On 2014/07/01 22:03:50, agable wrote: > While you're here, would be good to update this to > logging.info('string %s here', foo) rather than directly formatting the string. Done.
re-lgtm % two more nits. https://codereview.chromium.org/368713002/diff/60001/gclient.py File gclient.py (right): https://codereview.chromium.org/368713002/diff/60001/gclient.py#newcode541 gclient.py:541: deps_files = set([self.deps_file, 'DEPS']) could just be deps_file = {self.deps_file, 'DEPS'} https://codereview.chromium.org/368713002/diff/60001/gclient.py#newcode551 gclient.py:551: self.name, deps_file, filepath) nit: outdent 2.
https://chromiumcodereview.appspot.com/368713002/diff/60001/gclient.py File gclient.py (right): https://chromiumcodereview.appspot.com/368713002/diff/60001/gclient.py#newcod... gclient.py:541: deps_files = set([self.deps_file, 'DEPS']) On 2014/07/01 22:17:46, agable wrote: > could just be deps_file = {self.deps_file, 'DEPS'} Nooooo!!! sets are not ordered! deps_files = [self.deps_file] if 'DEPS' not in deps_files: deps_files.append('DEPS') or you can use an ordereddict
PTAL, keep the standards high.
lgtm :)
+luqui fyi
The CQ bit was checked by cmp@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmp@chromium.org/368713002/90003
The CQ bit was unchecked by commit-bot@chromium.org
Presubmit check for 368713002-90003 failed and returned exit status 1. Running presubmit commit checks ... Checking out rietveld... Running save-description-on-failure.sh Running push-basic.sh Running upstream.sh Running submit-from-new-dir.sh Running abandon.sh Running submodule-merge-test.sh Running upload-local-tracking-branch.sh Running hooks.sh Running post-dcommit-hook-test.sh Running upload-stale.sh Running patch.sh Running basic.sh ** Presubmit ERRORS ** tests/gclient_smoketest.py (61.68s) failed .............................F............... ====================================================================== FAIL: testRevInfoAltDeps (__main__.GClientSmokeSVN) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/gclient_smoketest.py", line 714, in testRevInfoAltDeps self.check((out, '', 0), results) File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 872, in check self.checkString(expected[0], results[0]) File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 868, in checkString self.assertEquals(expected, result, msg) AssertionError: 'src/other2": \'svn://127.0.0.1:10002/svn/trunk/other@2\',\n },\n "safesync_url": "",\n },\n]\n\n' != 'foo/bar": None,\n "invalid": None,\n "src/other2": \'svn://127.0.0.1:10002/svn/trunk/other@2\',\n },\n "safesync_url": "",\n },\n]\n\n' ---------------------------------------------------------------------- Ran 45 tests in 61.385s FAILED (failures=1) foo/bar": None, "invalid": None, "src/other2": 'svn://127.0.0.1:10002/svn/trunk/other@2', }, "safesync_url": "", }, ] Presubmit checks took 109.4s to calculate.
The CQ bit was checked by cmp@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmp@chromium.org/368713002/90003
The CQ bit was unchecked by commit-bot@chromium.org
Presubmit check for 368713002-90003 failed and returned exit status 1. Running presubmit commit checks ... Checking out rietveld... Running save-description-on-failure.sh Running push-basic.sh Running upstream.sh Running submit-from-new-dir.sh Running abandon.sh Running submodule-merge-test.sh Running upload-local-tracking-branch.sh Running hooks.sh Running post-dcommit-hook-test.sh Running upload-stale.sh Running patch.sh Running basic.sh ** Presubmit ERRORS ** tests/gclient_smoketest.py (55.67s) failed .............................F............... ====================================================================== FAIL: testRevInfoAltDeps (__main__.GClientSmokeSVN) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/gclient_smoketest.py", line 714, in testRevInfoAltDeps self.check((out, '', 0), results) File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 872, in check self.checkString(expected[0], results[0]) File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 868, in checkString self.assertEquals(expected, result, msg) AssertionError: 'src/other2": \'svn://127.0.0.1:10002/svn/trunk/other@2\',\n },\n "safesync_url": "",\n },\n]\n\n' != 'foo/bar": None,\n "invalid": None,\n "src/other2": \'svn://127.0.0.1:10002/svn/trunk/other@2\',\n },\n "safesync_url": "",\n },\n]\n\n' ---------------------------------------------------------------------- Ran 45 tests in 55.453s FAILED (failures=1) foo/bar": None, "invalid": None, "src/other2": 'svn://127.0.0.1:10002/svn/trunk/other@2', }, "safesync_url": "", }, ] Presubmit checks took 104.1s to calculate.
The CQ bit was checked by cmp@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmp@chromium.org/368713002/90003
The CQ bit was unchecked by commit-bot@chromium.org
Presubmit check for 368713002-90003 failed and returned exit status 1. Running presubmit commit checks ... Checking out rietveld... Running save-description-on-failure.sh Running push-basic.sh Running upstream.sh Running submit-from-new-dir.sh Running abandon.sh Running submodule-merge-test.sh Running upload-local-tracking-branch.sh Running hooks.sh Running post-dcommit-hook-test.sh Running upload-stale.sh Running patch.sh Running basic.sh ** Presubmit ERRORS ** tests/gclient_smoketest.py (72.23s) failed .............................F............... ====================================================================== FAIL: testRevInfoAltDeps (__main__.GClientSmokeSVN) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/gclient_smoketest.py", line 714, in testRevInfoAltDeps self.check((out, '', 0), results) File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 872, in check self.checkString(expected[0], results[0]) File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 868, in checkString self.assertEquals(expected, result, msg) AssertionError: 'src/other2": \'svn://127.0.0.1:10002/svn/trunk/other@2\',\n },\n "safesync_url": "",\n },\n]\n\n' != 'foo/bar": None,\n "invalid": None,\n "src/other2": \'svn://127.0.0.1:10002/svn/trunk/other@2\',\n },\n "safesync_url": "",\n },\n]\n\n' ---------------------------------------------------------------------- Ran 45 tests in 71.973s FAILED (failures=1) foo/bar": None, "invalid": None, "src/other2": 'svn://127.0.0.1:10002/svn/trunk/other@2', }, "safesync_url": "", }, ] Presubmit checks took 120.2s to calculate.
The CQ bit was checked by cmp@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmp@chromium.org/368713002/90003
The CQ bit was unchecked by commit-bot@chromium.org
Presubmit check for 368713002-90003 failed and returned exit status 1. Running presubmit commit checks ... Checking out rietveld... Running save-description-on-failure.sh Running push-basic.sh Running upstream.sh Running submit-from-new-dir.sh Running abandon.sh Running submodule-merge-test.sh Running upload-local-tracking-branch.sh Running hooks.sh Running post-dcommit-hook-test.sh Running upload-stale.sh Running patch.sh Running basic.sh ** Presubmit ERRORS ** tests/gclient_smoketest.py (52.63s) failed .............................F............... ====================================================================== FAIL: testRevInfoAltDeps (__main__.GClientSmokeSVN) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/gclient_smoketest.py", line 714, in testRevInfoAltDeps self.check((out, '', 0), results) File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 872, in check self.checkString(expected[0], results[0]) File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 868, in checkString self.assertEquals(expected, result, msg) AssertionError: 'src/other2": \'svn://127.0.0.1:10002/svn/trunk/other@2\',\n },\n "safesync_url": "",\n },\n]\n\n' != 'foo/bar": None,\n "invalid": None,\n "src/other2": \'svn://127.0.0.1:10002/svn/trunk/other@2\',\n },\n "safesync_url": "",\n },\n]\n\n' ---------------------------------------------------------------------- Ran 45 tests in 52.397s FAILED (failures=1) foo/bar": None, "invalid": None, "src/other2": 'svn://127.0.0.1:10002/svn/trunk/other@2', }, "safesync_url": "", }, ] Presubmit checks took 99.8s to calculate.
On 2014/07/01 22:54:06, I haz the power (commit-bot) wrote: > Presubmit check for 368713002-90003 failed and returned exit status 1. > > Running presubmit commit checks ... > Checking out rietveld... > Running save-description-on-failure.sh > Running push-basic.sh > Running upstream.sh > Running submit-from-new-dir.sh > Running abandon.sh > Running submodule-merge-test.sh > Running upload-local-tracking-branch.sh > Running hooks.sh > Running post-dcommit-hook-test.sh > Running upload-stale.sh > Running patch.sh > Running basic.sh > > ** Presubmit ERRORS ** > tests/gclient_smoketest.py (52.63s) failed > .............................F............... > ====================================================================== > FAIL: testRevInfoAltDeps (__main__.GClientSmokeSVN) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "tests/gclient_smoketest.py", line 714, in testRevInfoAltDeps > self.check((out, '', 0), results) > File > "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", > line 872, in check > self.checkString(expected[0], results[0]) > File > "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", > line 868, in checkString > self.assertEquals(expected, result, msg) > AssertionError: 'src/other2": \'svn://127.0.0.1:10002/svn/trunk/other@2\',\n > },\n "safesync_url": "",\n },\n]\n\n' != 'foo/bar": None,\n "invalid": > None,\n "src/other2": \'svn://127.0.0.1:10002/svn/trunk/other@2\',\n > },\n "safesync_url": "",\n },\n]\n\n' > > ---------------------------------------------------------------------- > Ran 45 tests in 52.397s > > FAILED (failures=1) > foo/bar": None, > "invalid": None, > "src/other2": 'svn://127.0.0.1:10002/svn/trunk/other@2', > }, > "safesync_url": "", > }, > ] > > > > > Presubmit checks took 99.8s to calculate. What happened here?
On 2014/07/01 23:13:14, iannucci wrote: > What happened here? I assumed this was flake, so retried a couple more times. After the 3rd failure, I looked more closely locally and found my checkout can reproduce this issue. I'm investigating.
Updated test so it passes now.
The CQ bit was checked by cmp@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmp@chromium.org/368713002/110001
Message was sent while issue was closed.
Change committed as 280921 |