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

Issue 2933473002: [context] Split "env" values and prefixes. (Closed)

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

Description

[context] Split "env" values and prefixes. Currently, "context.env" coalesces the string and prefix values for an enviornment. This results in the environment flattening prefixes, and recipes that pull the environment and tweak it having lots of duplicate prefix values. Now, we split the "env" property into two properties, "env", which returns just the environment strings map, and "env_prefixes", which returns prefix tuples. "env_prefixes" will only be applied when a setep renders the enviornment to a string, meaning that prefixes will not accumulate during flattening. Along these lines, remove improper context handling from "python" module. BUG=None TEST=expectations R=iannucci@chromium.org Review-Url: https://codereview.chromium.org/2933473002 Committed: https://github.com/luci/recipes-py/commit/d732be8c982f015796f0e620b7b46cff161b137f

Patch Set 1 #

Total comments: 2

Patch Set 2 : comments, tests, better definition #

Total comments: 1

Patch Set 3 : plumb pathsep through so we don't assume OS #

Total comments: 16

Patch Set 4 : rebase #

Patch Set 5 : comments #

Total comments: 14

Patch Set 6 : comments #

Patch Set 7 : fix typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+448 lines, -157 lines) Patch
M bootstrap/bootstrap_vpython.py View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M recipe_engine/recipe_api.py View 1 2 3 4 5 6 6 chunks +36 lines, -3 lines 0 comments Download
M recipe_engine/step_runner.py View 1 2 3 4 5 5 chunks +45 lines, -8 lines 0 comments Download
M recipe_engine/unittests/run_test.py View 1 2 3 4 5 6 2 chunks +13 lines, -3 lines 0 comments Download
M recipe_engine/unittests/step_runner_test.py View 1 2 2 chunks +73 lines, -0 lines 0 comments Download
M recipe_engine/unittests/test_env.py View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M recipe_modules/context/api.py View 1 2 3 4 5 6 chunks +65 lines, -83 lines 0 comments Download
M recipe_modules/context/examples/full.py View 1 2 3 4 5 2 chunks +13 lines, -5 lines 0 comments Download
M recipe_modules/context/examples/full.expected/basic.json View 1 2 3 4 5 1 chunk +24 lines, -1 line 0 comments Download
M recipe_modules/context/tests/env.py View 1 2 3 4 1 chunk +59 lines, -20 lines 0 comments Download
M recipe_modules/context/tests/env.expected/basic.json View 1 1 chunk +88 lines, -15 lines 0 comments Download
M recipe_modules/python/api.py View 2 chunks +2 lines, -6 lines 0 comments Download
M recipe_modules/step/api.py View 1 2 3 4 5 2 chunks +7 lines, -7 lines 0 comments Download
M recipe_modules/step/tests/inject_paths.expected/with_value.json View 1 3 chunks +21 lines, -4 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 24 (12 generated)
dnj
3 years, 6 months ago (2017-06-09 02:52:22 UTC) #1
iannucci
https://codereview.chromium.org/2933473002/diff/1/recipe_modules/context/api.py File recipe_modules/context/api.py (right): https://codereview.chromium.org/2933473002/diff/1/recipe_modules/context/api.py#newcode218 recipe_modules/context/api.py:218: def env_prefixes(self): I was actually thinking of storing these ...
3 years, 6 months ago (2017-06-09 04:47:45 UTC) #6
dnj
https://codereview.chromium.org/2933473002/diff/1/recipe_modules/context/api.py File recipe_modules/context/api.py (right): https://codereview.chromium.org/2933473002/diff/1/recipe_modules/context/api.py#newcode218 recipe_modules/context/api.py:218: def env_prefixes(self): On 2017/06/09 04:47:45, iannucci wrote: > I ...
3 years, 6 months ago (2017-06-09 04:50:33 UTC) #7
dnj
PTAL, updated w/ comments. "env_prefixes" is now separate, list of Path/str. It is output as ...
3 years, 6 months ago (2017-06-10 16:37:33 UTC) #8
iannucci
lgtm but needs some rebarsing https://codereview.chromium.org/2933473002/diff/40001/recipe_engine/recipe_api.py File recipe_engine/recipe_api.py (right): https://codereview.chromium.org/2933473002/diff/40001/recipe_engine/recipe_api.py#newcode261 recipe_engine/recipe_api.py:261: ('name', 'base_name', 'cmd', 'cwd', ...
3 years, 6 months ago (2017-06-12 19:58:40 UTC) #9
dnj
Updated, PTAL https://codereview.chromium.org/2933473002/diff/40001/recipe_engine/recipe_api.py File recipe_engine/recipe_api.py (right): https://codereview.chromium.org/2933473002/diff/40001/recipe_engine/recipe_api.py#newcode261 recipe_engine/recipe_api.py:261: ('name', 'base_name', 'cmd', 'cwd', 'env_prefixes', 'env', 'pathsep', ...
3 years, 6 months ago (2017-06-13 19:31:21 UTC) #10
iannucci
lgtm https://codereview.chromium.org/2933473002/diff/80001/recipe_engine/step_runner.py File recipe_engine/step_runner.py (right): https://codereview.chromium.org/2933473002/diff/80001/recipe_engine/step_runner.py#newcode724 recipe_engine/step_runner.py:724: if not path_tuple: s/path_tuple/paths https://codereview.chromium.org/2933473002/diff/80001/recipe_engine/step_runner.py#newcode728 recipe_engine/step_runner.py:728: # If ...
3 years, 6 months ago (2017-06-13 20:28:12 UTC) #11
dnj
https://codereview.chromium.org/2933473002/diff/80001/recipe_engine/step_runner.py File recipe_engine/step_runner.py (right): https://codereview.chromium.org/2933473002/diff/80001/recipe_engine/step_runner.py#newcode724 recipe_engine/step_runner.py:724: if not path_tuple: On 2017/06/13 20:28:11, iannucci wrote: > ...
3 years, 6 months ago (2017-06-13 21:46:27 UTC) #12
dnj
fix typo
3 years, 6 months ago (2017-06-13 21:48:51 UTC) #13
dnj
3 years, 6 months ago (2017-06-13 21:49:00 UTC) #14
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/2933473002/120001
3 years, 6 months ago (2017-06-13 21:52:52 UTC) #21
commit-bot: I haz the power
3 years, 6 months ago (2017-06-13 21:57:38 UTC) #24
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://github.com/luci/recipes-py/commit/d732be8c982f015796f0e620b7b46cff161...

Powered by Google App Engine
This is Rietveld 408576698