diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index f19777c7d3..8cb4773e05 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -412,7 +412,7 @@ Returns: Return a git command step. -— **def [bundle\_create](/recipes/recipe_modules/git/api.py#382)(self, bundle_path, rev_list_args=None, \*\*kwargs):** +— **def [bundle\_create](/recipes/recipe_modules/git/api.py#374)(self, bundle_path, rev_list_args=None, \*\*kwargs):** Run 'git bundle create' on a Git repository. @@ -422,11 +422,11 @@ Args: refs in the Git checkout will be bundled. kwargs: Forwarded to '__call__'. -— **def [cat\_file\_at\_commit](/recipes/recipe_modules/git/api.py#45)(self, file_path, commit_hash, remote_name=None, \*\*kwargs):** +— **def [cat\_file\_at\_commit](/recipes/recipe_modules/git/api.py#40)(self, file_path, commit_hash, remote_name=None, \*\*kwargs):** Outputs the contents of a file at a given revision. -— **def [checkout](/recipes/recipe_modules/git/api.py#117)(self, url, ref=None, dir_path=None, recursive=False, submodules=True, submodule_update_force=False, keep_paths=None, step_suffix=None, curl_trace_file=None, can_fail_build=True, set_got_revision=False, remote_name=None, display_fetch_size=None, file_name=None, submodule_update_recursive=True, use_git_cache=False, progress=True, tags=False):** +— **def [checkout](/recipes/recipe_modules/git/api.py#112)(self, url, ref=None, dir_path=None, recursive=False, submodules=True, submodule_update_force=False, keep_paths=None, step_suffix=None, curl_trace_file=None, can_fail_build=True, set_got_revision=False, remote_name=None, display_fetch_size=None, file_name=None, submodule_update_recursive=True, use_git_cache=False, progress=True, tags=False):** Performs a full git checkout and returns sha1 of checked out revision. @@ -465,7 +465,7 @@ Args: Returns: If the checkout was successful, this returns the commit hash of the checked-out-repo. Otherwise this returns None. -— **def [config\_get](/recipes/recipe_modules/git/api.py#355)(self, prop_name, \*\*kwargs):** +— **def [config\_get](/recipes/recipe_modules/git/api.py#347)(self, prop_name, \*\*kwargs):** Returns: (str) The Git config output, or None if no output was generated. @@ -473,7 +473,7 @@ Args: prop_name: (str) The name of the config property to query. kwargs: Forwarded to '__call__'. -— **def [count\_objects](/recipes/recipe_modules/git/api.py#53)(self, previous_result=None, can_fail_build=False, \*\*kwargs):** +— **def [count\_objects](/recipes/recipe_modules/git/api.py#48)(self, previous_result=None, can_fail_build=False, \*\*kwargs):** Returns `git count-objects` result as a dict. @@ -486,11 +486,11 @@ Args: Returns: A dict of count-object values, or None if count-object run failed. -— **def [fetch\_tags](/recipes/recipe_modules/git/api.py#39)(self, remote_name=None, \*\*kwargs):** +— **def [fetch\_tags](/recipes/recipe_modules/git/api.py#34)(self, remote_name=None, \*\*kwargs):** Fetches all tags from the remote. -— **def [get\_remote\_url](/recipes/recipe_modules/git/api.py#372)(self, remote_name=None, \*\*kwargs):** +— **def [get\_remote\_url](/recipes/recipe_modules/git/api.py#364)(self, remote_name=None, \*\*kwargs):** Returns: (str) The URL of the remote Git repository, or None. @@ -498,11 +498,11 @@ Args: remote_name: (str) The name of the remote to query, defaults to 'origin'. kwargs: Forwarded to '__call__'. -— **def [get\_timestamp](/recipes/recipe_modules/git/api.py#327)(self, commit='HEAD', test_data=None, \*\*kwargs):** +— **def [get\_timestamp](/recipes/recipe_modules/git/api.py#319)(self, commit='HEAD', test_data=None, \*\*kwargs):** Find and return the timestamp of the given commit. -— **def [new\_branch](/recipes/recipe_modules/git/api.py#395)(self, branch, name=None, upstream=None, \*\*kwargs):** +— **def [new\_branch](/recipes/recipe_modules/git/api.py#387)(self, branch, name=None, upstream=None, \*\*kwargs):** Runs git new-branch on a Git repository, to be used before git cl upload. @@ -512,7 +512,7 @@ Args: upstream (str): to origin/master. kwargs: Forwarded to '__call__'. -— **def [rebase](/recipes/recipe_modules/git/api.py#336)(self, name_prefix, branch, dir_path, remote_name=None, \*\*kwargs):** +— **def [rebase](/recipes/recipe_modules/git/api.py#328)(self, name_prefix, branch, dir_path, remote_name=None, \*\*kwargs):** Run rebase HEAD onto branch Args: @@ -994,9 +994,9 @@ Raises: — **def [RunSteps](/recipes/recipe_modules/gerrit/examples/full.py#11)(api):** ### *recipes* / [git:examples/full](/recipes/recipe_modules/git/examples/full.py) -[DEPS](/recipes/recipe_modules/git/examples/full.py#5): [git](#recipe_modules-git), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/runtime][recipe_engine/recipe_modules/runtime], [recipe\_engine/step][recipe_engine/recipe_modules/step] +[DEPS](/recipes/recipe_modules/git/examples/full.py#5): [git](#recipe_modules-git), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/step][recipe_engine/recipe_modules/step] -— **def [RunSteps](/recipes/recipe_modules/git/examples/full.py#19)(api):** +— **def [RunSteps](/recipes/recipe_modules/git/examples/full.py#18)(api):** ### *recipes* / [git\_cl:examples/full](/recipes/recipe_modules/git_cl/examples/full.py) [DEPS](/recipes/recipe_modules/git_cl/examples/full.py#9): [git\_cl](#recipe_modules-git_cl), [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/step][recipe_engine/recipe_modules/step] diff --git a/recipes/recipe_modules/git/api.py b/recipes/recipe_modules/git/api.py index fbd4c3869a..0be93f775e 100644 --- a/recipes/recipe_modules/git/api.py +++ b/recipes/recipe_modules/git/api.py @@ -17,11 +17,6 @@ class GitApi(recipe_api.RecipeApi): infra_step = kwargs.pop('infra_step', True) git_cmd = ['git'] - if kwargs.pop('add_retry', False) and not self.m.runtime.is_luci: - # On LUCI, the `git` binary is a go wrapper which already implements all - # the git-retry logic. - git_cmd += ['retry'] - options = kwargs.pop('git_config_options', {}) for k, v in sorted(options.iteritems()): git_cmd.extend(['-c', '%s=%s' % (k, v)]) @@ -201,10 +196,8 @@ class GitApi(recipe_api.RecipeApi): with self.m.context(env={'PATH': path}): self('cache', 'populate', '-c', self.m.infra_paths.default_git_cache_dir, url, - name='populate cache', - can_fail_build=can_fail_build, - add_retry=True) + can_fail_build=can_fail_build) dir_cmd = self( 'cache', 'exists', '--quiet', '--cache-dir', self.m.infra_paths.default_git_cache_dir, url, @@ -269,8 +262,7 @@ class GitApi(recipe_api.RecipeApi): self('fetch', *fetch_args, name=fetch_step_name, stderr=fetch_stderr, - can_fail_build=can_fail_build, - add_retry=True) + can_fail_build=can_fail_build) if display_fetch_size: self.count_objects( name='count-objects after %s' % fetch_step_name, diff --git a/recipes/recipe_modules/git/examples/full.expected/basic.json b/recipes/recipe_modules/git/examples/full.expected/basic.json index 0cf22f239c..176c6af755 100644 --- a/recipes/recipe_modules/git/examples/full.expected/basic.json +++ b/recipes/recipe_modules/git/examples/full.expected/basic.json @@ -14,7 +14,6 @@ { "cmd": [ "git", - "retry", "fetch", "origin", "master", diff --git a/recipes/recipe_modules/git/examples/full.expected/basic_luci.json b/recipes/recipe_modules/git/examples/full.expected/basic_luci.json deleted file mode 100644 index 176c6af755..0000000000 --- a/recipes/recipe_modules/git/examples/full.expected/basic_luci.json +++ /dev/null @@ -1,217 +0,0 @@ -[ - { - "cmd": [ - "python", - "-u", - "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", - "--path", - "[START_DIR]/src", - "--url", - "https://chromium.googlesource.com/chromium/src.git" - ], - "name": "git setup" - }, - { - "cmd": [ - "git", - "fetch", - "origin", - "master", - "--recurse-submodules", - "--progress" - ], - "cwd": "[START_DIR]/src", - "env": { - "PATH": "RECIPE_REPO[depot_tools]:" - }, - "infra_step": true, - "name": "git fetch" - }, - { - "cmd": [ - "git", - "checkout", - "-f", - "FETCH_HEAD" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "git checkout" - }, - { - "cmd": [ - "git", - "rev-parse", - "HEAD" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "read revision", - "~followup_annotations": [ - "@@@STEP_TEXT@
checked out 'deadbeef'
@@@" - ] - }, - { - "cmd": [ - "git", - "clean", - "-f", - "-d", - "-x" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "git clean" - }, - { - "cmd": [ - "git", - "submodule", - "sync" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "submodule sync" - }, - { - "cmd": [ - "git", - "submodule", - "update", - "--init", - "--recursive" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "submodule update" - }, - { - "cmd": [ - "git", - "-c", - "foo=bar", - "count-objects", - "-v" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "count-objects" - }, - { - "cmd": [ - "git", - "config", - "--get", - "remote.origin.url" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "git config remote.origin.url", - "~followup_annotations": [ - "@@@STEP_TEXT@foo@@@" - ] - }, - { - "cmd": [ - "git", - "show", - "HEAD", - "--format=%at", - "-s" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "git show" - }, - { - "cmd": [ - "git", - "fetch", - "origin", - "--tags" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "git fetch tags" - }, - { - "cmd": [ - "git", - "status" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "git status" - }, - { - "cmd": [ - "git", - "status" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "git status can_fail_build" - }, - { - "cmd": [ - "git", - "status" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "git status cannot_fail_build" - }, - { - "cmd": [ - "git", - "new-branch", - "refactor" - ], - "cwd": "[START_DIR]/src", - "env": { - "PATH": "RECIPE_REPO[depot_tools]:" - }, - "infra_step": true, - "name": "git new-branch refactor" - }, - { - "cmd": [ - "git", - "new-branch", - "feature", - "--upstream", - "refactor" - ], - "cwd": "[START_DIR]/src", - "env": { - "PATH": "RECIPE_REPO[depot_tools]:" - }, - "infra_step": true, - "name": "git new-branch feature" - }, - { - "cmd": [ - "git", - "rebase", - "origin/master" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "my repo rebase" - }, - { - "cmd": [ - "git", - "bundle", - "create", - "[START_DIR]/all.bundle", - "--all" - ], - "cwd": "[START_DIR]/src", - "infra_step": true, - "name": "git bundle" - }, - { - "name": "$result" - } -] \ No newline at end of file diff --git a/recipes/recipe_modules/git/examples/full.py b/recipes/recipe_modules/git/examples/full.py index 28b8e780b4..fde0d52831 100644 --- a/recipes/recipe_modules/git/examples/full.py +++ b/recipes/recipe_modules/git/examples/full.py @@ -9,7 +9,6 @@ DEPS = [ 'recipe_engine/platform', 'recipe_engine/properties', 'recipe_engine/raw_io', - 'recipe_engine/runtime', 'recipe_engine/step', 'git', @@ -98,14 +97,7 @@ def RunSteps(api): def GenTests(api): - yield ( - api.test('basic') + - api.runtime(is_luci=False, is_experimental=False) - ) - yield ( - api.test('basic_luci') + - api.runtime(is_luci=True, is_experimental=False) - ) + yield api.test('basic') yield api.test('basic_tags') + api.properties(tags=True) yield api.test('basic_ref') + api.buildbucket.ci_build(git_ref='refs/foo/bar') yield api.test('basic_branch') + api.buildbucket.ci_build(