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

Issue 2792333003: Assert validity of stream parameters. (Closed)

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

Description

Assert validity of stream parameters. Assert that stream parameters are valid. A lot of these validity checks are related to limitations in annotations (e.g., no newlines), but others are actually content errors. This adds assertions that: 1) No annotation parameter may include a newline in it. This is disallowed because the annotation parser cannot handle multi-line single annotations. 2) Build properties must be valid JSON. This is a requirement imposed by the annotation parser (chromium_step.py), and will lead to total waterfall breakages if invalid JSON is exported. This also adds unit tests to check that these assertions work. BUG=None TEST=unit Review-Url: https://codereview.chromium.org/2792333003 Committed: https://github.com/luci/recipes-py/commit/ddfc94f01e4e1d3c7bf7dedfd58e6813bc5160df

Patch Set 1 #

Total comments: 4

Patch Set 2 : comments and fixes #

Patch Set 3 : remove unnecessary import #

Patch Set 4 : fix spelling #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -9 lines) Patch
M recipe_engine/stream.py View 1 2 3 6 chunks +34 lines, -9 lines 0 comments Download
M recipe_engine/unittests/stream_test.py View 1 1 chunk +43 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (10 generated)
dnj
PTAL
3 years, 8 months ago (2017-04-04 18:14:15 UTC) #2
iannucci
lgtm, thanks for doing this! https://codereview.chromium.org/2792333003/diff/1/recipe_engine/stream.py File recipe_engine/stream.py (right): https://codereview.chromium.org/2792333003/diff/1/recipe_engine/stream.py#newcode347 recipe_engine/stream.py:347: assert '\n' not in ...
3 years, 8 months ago (2017-04-05 02:40:24 UTC) #7
tandrii(chromium)
general question: won't this break some badly written recipes that currently work, be it not ...
3 years, 8 months ago (2017-04-05 12:23:53 UTC) #9
dnj
On 2017/04/05 12:23:53, tandrii(chromium) wrote: > general question: won't this break some badly written recipes ...
3 years, 8 months ago (2017-04-05 15:07:36 UTC) #10
dnj
https://codereview.chromium.org/2792333003/diff/1/recipe_engine/stream.py File recipe_engine/stream.py (right): https://codereview.chromium.org/2792333003/diff/1/recipe_engine/stream.py#newcode347 recipe_engine/stream.py:347: assert '\n' not in url, 'Link URL must not ...
3 years, 8 months ago (2017-04-05 15:08:07 UTC) #11
tandrii(chromium)
On 2017/04/05 15:07:36, dnj wrote: > On 2017/04/05 12:23:53, tandrii(chromium) wrote: > > general question: ...
3 years, 8 months ago (2017-04-05 15:13:33 UTC) #12
dnj
On 2017/04/05 15:13:33, tandrii(chromium) wrote: > On 2017/04/05 15:07:36, dnj wrote: > > On 2017/04/05 ...
3 years, 8 months ago (2017-04-05 15:14:15 UTC) #13
iannucci
lgtm
3 years, 8 months ago (2017-04-06 22:07:03 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/2792333003/60001
3 years, 8 months ago (2017-04-06 22:11:06 UTC) #17
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://github.com/luci/recipes-py/commit/ddfc94f01e4e1d3c7bf7dedfd58e6813bc5160df
3 years, 8 months ago (2017-04-06 22:14:25 UTC) #20
Paweł Hajdan Jr.
3 years, 8 months ago (2017-04-07 09:03:54 UTC) #21
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:60001) has been created in
https://codereview.chromium.org/2798223005/ by phajdan.jr@chromium.org.

The reason for reverting is: Breaks downstream testing in tools/build repo.

Both simulation_test and test hang, and throw exceptions, e.g.:

ValueError: Failed assertion: Step text must not contain a newline. {'text':
'<br/>\n===== PERF TRY JOB RESULTS =====\n\nTest Command:
src/tools/perf/run_benchmark -v --browser=android-chrome
--output-format=chartjson sunspider --upload-bucket=public\nTest Metric:
dummy/dummy\nRelative Change: 88.88889%\nStandard Error: +- 0.00000
delta\n\nRevision    Mean        Std.Error\nPatch       1.0         0.0\nNo
Patch    9.0         0.0\n<br/>'}.

Powered by Google App Engine
This is Rietveld 408576698