mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
In order to facilitate removing uses of api.path.checkout_dir from downstream repos, this change adds a custom return type for bot_update.ensure_checkout. Now instead of a standard step result, an object of Result will be returned. Result records the relevant paths (directory where the checkout was performed, the repo that was checked out and the repo that was patched, if any). This provides the caller the ability to work in any of these directories without using api.path.checkout_dir and without requiring boilerplate to construct the paths. It also includes some attributes that provide details from within the json output to abstract that out. Bug: 329113288, 339472834 Change-Id: I2ec6db635c5b799bdb65d4e9364e7d99aae4159e Recipe-Manual-Change: build Recipe-Manual-Change: build_limited Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5523194 Reviewed-by: Yiwei Zhang <yiwzhang@google.com> Commit-Queue: Garrett Beaty <gbeaty@google.com>
36 lines
1.9 KiB
Plaintext
36 lines
1.9 KiB
Plaintext
google_issue_default {
|
|
host: "crbug.com"
|
|
}
|
|
warning {
|
|
name: "BOT_UPDATE_CUSTOM_RESULT_ATTRIBUTES"
|
|
description: "The custom result type returned from"
|
|
description: "`bot_update.ensure_checkout` provides attributes that give easy"
|
|
description: "access to the information that is often accessed via the"
|
|
description: "existing step result's `presentation` or `json.output` values."
|
|
description: "These uses should be updated as follows:"
|
|
description: ""
|
|
description: "1) `result.presentation.properties` should be replaced with"
|
|
description: "`result.properties`."
|
|
description: ""
|
|
description: "2) `result.json.output['properties']`,"
|
|
description: "`result.json.output['manifest']` and"
|
|
description: "`result.json.output['fixed_revisions']` should be replaced"
|
|
description: "with `result.properties`, `result.manifest` and"
|
|
description: "`result.fixed_revisions`, respectively."
|
|
description: ""
|
|
description: "3) Getting the source root and the patch root should no longer"
|
|
description: "be done via `result.json.output['root']` and"
|
|
description: "`result.json.output['patch_root']`. `result.source_root` and"
|
|
description: "`result.patch_root` should be used instead. These objects have"
|
|
description: "`path` and `name` attributes. The `path` attribute gives a"
|
|
description: "`Path` for the location of the repo. The `name` attribute is"
|
|
description: "the gclient \"name\" of the repo, i.e. the path relative to the"
|
|
description: "directory where the checkout was performed. This removes the"
|
|
description: "need to do path manipulation in the common cases. If no patch"
|
|
description: "was applied, `result.patch_root` will be `None`."
|
|
description: ""
|
|
description: "4) `result.json.output['did_run']` does not need to be"
|
|
description: "accessed, it is always guaranteed to be True if a result was"
|
|
description: "returned."
|
|
google_issue { id: 339472834 }
|
|
} |