New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 807029 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocked on:
issue 817546

Blocking:
issue 800562



Sign in to add a comment

[toolchain-utils] buildbot_utils.py needs to be updated to use 'cros buildresult'

Project Member Reported by cmt...@chromium.org, Jan 29 2018

Issue description

Our team script buildbot_utils currently relies on finding & parsing buildbot records and URLs in order to determine the status of our launched buildbot jobs, and to find the name of the artifact that gets uploaded.

Those mechanisms are due to break soon, as the infrastructure on which they rely is deprecated and going away.

A new chromite command, 'cros buildresult' has been created for us to use instead.  We need to update our buildbot_utils.py script to use 'cros buildresult' instead.

An example of using 'cros buildresult' (interactively, chromite directory):
$ cros buildresult --cidb-id 2242489 --report json
{"8956379790999867296": {"status": "pass", "cidb_id": 2242489, "buildbucket_id": "8956379790999867296", "toolchain_url": "2018/01/%(target)s-2018.01.24.235636.tar.xz", "artifacts_url": "gs://chromeos-image-archive/master-paladin/R66-10341.0.0-rc2", "stages": {"AndroidMetadata": "pass", "PublishUprevChanges": "pass", "BinhostTest": "pass", "CommitQueueSync": "skipped", "UprevAndroid": "pass", "InitSDK": "pass", "SlaveFailureSummary": "pass", "BuildReexecutionFinished": "pass", "BuildStart": "skipped", "CleanUp": "skipped", "ScheduleSlaves": "pass", "RegenPortageCache": "pass", "BranchUtilTest": "skipped", "Report": "pass", "CommitQueueHandleChanges": "pass", "Uprev": "pass", "SyncChrome": "skipped", "ConfigDump": "pass", "CommitQueueCompletion": "pass"}}}
$


 

Comment 1 by cmt...@chromium.org, Jan 29 2018

Owner: rahulchaudhry@chromium.org
Components: Tools>ChromeOS-Toolchain
Owner: manojgupta@chromium.org
Passing on to the next sheriff.
Cc: dgarr...@chromium.org
Tried a test job.

$ cros tryjob -g 905329 elm-paladin-tryjob --swarming
Verifying patches...
Submitting tryjob...
Successfully sent PUT request to [buildbucket_bucket:master.chromiumos.tryserver] with [config:elm-paladin-tryjob] [buildbucket_id:8955181088383670688].
Tryjob submitted!
To view your tryjobs, visit:
  http://cros-goldeneye/chromeos/healthmonitoring/buildDetails?buildbucketId=8955181088383670688

Now, started the query after a few minutes but there was no data returned. The query seemed to have hanged.
$ cros buildresult --buildbucket-id 8955181088383670688

After a long time I see these errors:
$ cros buildresult --buildbucket-id 8955181088383670688 

04:23:51: ERROR: cros buildresult failed before completing.
04:23:51: ERROR: (OperationalError) (2003, "Can't connect to MySQL server on '104.197.188.23' (110)") None None

dgarrett@  Any idea what is happening. Am I missing something here?
Cc: xixuan@chromium.org
Owner: xixuan@chromium.org
That tool depends on connectivity to CIDB.

I thought we had added the external IP addresses for your teams workstations to the whitelist, but apparently not.

Passing to our deputy, who knows how to help you resolve this.

PS: After buildbucket adds some new features, I hope to adjust this tool to use it, and so bypass this restriction.

PPS: If changing the output of "cros tryjob" to make it more script parsing friendly for extracting the buildbucket id will help, I'm happy to do that.

Comment 7 by xixuan@chromium.org, Feb 10 2018

What's the IP cidb want to whitelist?

Which database (cidb or debug-cidb or cidb-replica) the tool want to connect?
The tool needs to connect to the "cidb-gen2-replica2".
laszio, can you take it forward from here?
Owner: laszio@chromium.org
There is some urgency, since I need to land CL:917601, which will break the current toolchain team tryjob scripts.

Trying. Will update asap.
Owner: dgarr...@chromium.org
I submitted a tryjob and made sure it is already running:

https://cros-goldeneye.corp.google.com/chromeos/healthmonitoring/buildDetails?buildbucketId=8954590621964795328

and tried the following on our workstation. The problem saw in #4 #5 is solved. However, this time it complained "No build found". I also tried a buildbucket id that is from a few days ago and get the same error.


mobiletc-prebuild@chrotomation2:~/crostc/chromeos/$ cros buildresult --log-level debug --buildbucket-id 8954590621964795328

10:54:49: DEBUG: Cache dir lookup.
10:54:49: DEBUG: Configured cache_dir to '/usr/local/google2/crostc/chromeos/.cache'
10:54:49: INFO: RunCommand: /usr/local/google2/crostc/chromeos/chromite/bin/cros_sdk --log-level debug -- /mnt/host/source/chromite/bin/cros buildresult --log-level debug --buildbucket-id 8954871423185321296 in /usr/local/google2/crostc/chromeos
10:54:50: DEBUG: Configured cache_dir to '/usr/local/google2/crostc/chromeos/.cache'
10:54:52: DEBUG: Configured cache_dir to '/usr/local/google2/crostc/chromeos/.cache'
10:54:54: DEBUG: Cache dir lookup.
10:54:54: DEBUG: Configured cache_dir to '/mnt/host/source/.cache'
10:54:54: DEBUG: RunCommand: /mnt/host/source/.cache/common/gsutil_4.27.tar.gz/gsutil/gsutil -o 'Boto:num_retries=10' ls gs://chromeos-authentication-bucket/
gs://chromeos-authentication-bucket/README.txt
10:54:56: INFO: RunCommand: /mnt/host/source/.cache/common/gsutil_4.27.tar.gz/gsutil/gsutil -o 'Boto:num_retries=10' cp -v -- 'gs://chromeos-cidb-creds/prod_replica_cidb_gen2_readonly/*' /mnt/host/source/.cache/cidb_creds
10:55:00: INFO: Running cidb query on pid 9, repr(query) starts with 'SHOW DATABASES'
10:55:00: WARNING: /mnt/host/source/chromite/lib/cidb.py:235: Warning: 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
  cur.execute("SET SESSION sql_mode='STRICT_ALL_TABLES'")

10:55:00: WARNING: /mnt/host/source/chromite/lib/cidb.py:235: Warning: Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
  cur.execute("SET SESSION sql_mode='STRICT_ALL_TABLES'")

10:55:01: INFO: Created cidb engine readonly@104.197.188.23 for pid 9
10:55:01: INFO: Running cidb query on pid 9, repr(query) starts with 'SHOW TABLES'
10:55:01: INFO: Running cidb query on pid 9, repr(query) starts with 'SELECT MAX(schemaVersion) from schemaVersionTable'
10:55:01: INFO: Created a SchemaVersionedMySQLConnection, sqlalchemy version 0.9.2
10:55:02: INFO: Running cidb query on pid 9, repr(query) starts with <sqlalchemy.sql.selectable.Select at 0x7fa824451fd0; Select object>
10:55:02: ERROR: No build found. Perhaps not started?
mobiletc-prebuild@chrotomation2:~/crostc/chromeos/$ cros buildresult --log-level debug --buildbucket-id 8954590621964795328
10:55:26: DEBUG: Cache dir lookup.
10:55:26: DEBUG: Configured cache_dir to '/usr/local/google2/crostc/chromeos/.cache'
10:55:26: INFO: RunCommand: /usr/local/google2/crostc/chromeos/chromite/bin/cros_sdk --log-level debug -- /mnt/host/source/chromite/bin/cros buildresult --log-level debug --buildbucket-id 8954590621964795328 in /usr/local/google2/crostc/chromeos
10:55:27: DEBUG: Configured cache_dir to '/usr/local/google2/crostc/chromeos/.cache'
10:55:28: DEBUG: Configured cache_dir to '/usr/local/google2/crostc/chromeos/.cache'
10:55:31: DEBUG: Cache dir lookup.
10:55:31: DEBUG: Configured cache_dir to '/mnt/host/source/.cache'
10:55:31: DEBUG: Using cached credentials /mnt/host/source/.cache/cidb_creds
10:55:31: INFO: Running cidb query on pid 9, repr(query) starts with 'SHOW DATABASES'
10:55:32: WARNING: /mnt/host/source/chromite/lib/cidb.py:235: Warning: 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
  cur.execute("SET SESSION sql_mode='STRICT_ALL_TABLES'")

10:55:32: WARNING: /mnt/host/source/chromite/lib/cidb.py:235: Warning: Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
  cur.execute("SET SESSION sql_mode='STRICT_ALL_TABLES'")

10:55:32: INFO: Created cidb engine readonly@104.197.188.23 for pid 9
10:55:32: INFO: Running cidb query on pid 9, repr(query) starts with 'SHOW TABLES'
10:55:32: INFO: Running cidb query on pid 9, repr(query) starts with 'SELECT MAX(schemaVersion) from schemaVersionTable'
10:55:33: INFO: Created a SchemaVersionedMySQLConnection, sqlalchemy version 0.9.2
10:55:33: INFO: Running cidb query on pid 9, repr(query) starts with <sqlalchemy.sql.selectable.Select at 0x7f19381ccf10; Select object>
10:55:33: ERROR: No build found. Perhaps not started?

Cc: nxia@chromium.org
Oh.....

Some tryjobs aren't in CIDB. I had intended to put them all in, but held off because it would break certain kinds of testing we were doing.

I should have realized this was a problem. I'll have to fix the tool before you can move forward.

It DOES work for pre-cq builds, which is what I happened to use while testing.
Project Member

Comment 15 by bugdroid1@chromium.org, Feb 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/ab252592101b21ba15a2372f0998ed56fb1f047c

commit ab252592101b21ba15a2372f0998ed56fb1f047c
Author: Don Garrett <dgarrett@chromium.org>
Date: Thu Feb 15 18:27:22 2018

Revert "cbuildbot_run: Adjust GetVersion to use CIDB Id."

This reverts commit 68134125081027f1ae98be03a8e5b882ac24a39a.

Reason for revert: This CL works, but breaks toolchain team scripts.

A new tool "cros buildresult" was built to let the toolchain scripts be less dependent on how we run builds, but has a significant bug which prevents them from using it yet.

Reverting until the new tool works for them.

BUG= chromium:807029 

Original change's description:
> cbuildbot_run: Adjust GetVersion to use CIDB Id.
> 
> build_number is a buildbot concept which doesn't exist for swarming
> builds (and defaults to 0 there). Switch to CIDB ids for the same
> purpose.
> 
> Builder version strings for assorted unofficial builders (including
> tryjobs) will change formats from:
> 
>   chell-incremental/R66-10401.0.0-b4390
> ->
>   chell-incremental/R66-10401.0.0-c123456
> 
> Hopefully, there won't be anyone left trying to explicitly parse those
> strings.
> 
> This was previously landed as CL:869450, and reverted as CL:876243.
> 
> Relanding, now that the lab has been adjusted to accept the new build
> version string format, and "cros buildresult" is available for the
> toolchain team.
> 
> BUG= chromium:800562 
> TEST=run_tests
> 
> Change-Id: I7e007f1c660c22efce704233792c9716aca6c3f5
> Reviewed-on: https://chromium-review.googlesource.com/917601
> Commit-Ready: Don Garrett <dgarrett@chromium.org>
> Tested-by: Don Garrett <dgarrett@chromium.org>
> Reviewed-by: Ningning Xia <nxia@chromium.org>

Bug:  chromium:800562 
Change-Id: I833e2324439c6eaf750f47005130f02470336d4d
Reviewed-on: https://chromium-review.googlesource.com/922521
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>

[modify] https://crrev.com/ab252592101b21ba15a2372f0998ed56fb1f047c/cbuildbot/cbuildbot_run.py
[modify] https://crrev.com/ab252592101b21ba15a2372f0998ed56fb1f047c/cbuildbot/cbuildbot_run_unittest.py

Blockedon: 817546
Blocking: 800562
"cros buildresult" should now work for you.

I'm sorry about the awkwardness.

One glitch with the new tool is that the error message it shows when a build is in progress suggests that the build hasn't started yet, when all it really knows is that the build hasn't finished yet.

Also, if you want me to reformat the output of "cros tryjob" to make it easier to extract the buildbucket id, that isn't hard to do.
Owner: laszio@chromium.org
Owner: cmt...@chromium.org
Owner: laszio@chromium.org
Hi Don, we need an invariant to parse the the result.

The other option is to specify the result format. Does it make sense to add an option to `cros tryjob` so that it only prints the buildbucket id? for example, --show-only-buildbucket-id.
I can add more parser friendly output of some kind, but it will take a day or two to make it available.

Currently there are no strong invariants, but this log line is reasonable.

Successfully sent PUT request to [buildbucket_bucket:master.chromiumos.tryserver] with [config:samus-paladin-tryjob] [buildbucket_id:8952755416203041184].

Hi Don, I applied the following patch but it is still the same; No build found.

https://chromium-review.googlesource.com/c/chromiumos/chromite/+/951915

$ cros tryjob --swarming master-chromium-pfq-tryjob

No patches were provided; are you sure you want to just run a build of master? (yes/No)? yes
Verifying patches...
Submitting tryjob...
Successfully sent PUT request to [buildbucket_bucket:master.chromiumos.tryserver] with [config:master-chromium-pfq-tryjob] [buildbucket_id:8952752441753929904].
Tryjob submitted!
To view your tryjobs, visit:
  http://cros-goldeneye/chromeos/healthmonitoring/buildDetails?buildbucketId=8952752441753929904


$ cros buildresult --log-level debug --buildbucket-id  8952752441753929904
17:43:25: DEBUG: Cache dir lookup.
17:43:25: DEBUG: Configured cache_dir to '/usr/local/google/crostc/chromeos/.cache'
17:43:25: INFO: RunCommand: /usr/local/google/crostc/chromeos/chromite/bin/cros_sdk --log-level debug -- /mnt/host/source/chromite/bin/cros buildresult --log-level debug --buildbucket-id 8952752441753929904 in /usr/local/google/crostc/chromeos
17:43:26: DEBUG: Configured cache_dir to '/usr/local/google/crostc/chromeos/.cache'
17:43:27: DEBUG: Configured cache_dir to '/usr/local/google/crostc/chromeos/.cache'
17:43:30: DEBUG: Cache dir lookup.
17:43:30: DEBUG: Configured cache_dir to '/mnt/host/source/.cache'
17:43:30: DEBUG: Using cached credentials /mnt/host/source/.cache/cidb_creds
17:43:30: INFO: Running cidb query on pid 8, repr(query) starts with 'SHOW DATABASES'
17:43:30: WARNING: /mnt/host/source/chromite/lib/cidb.py:235: Warning: 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
  cur.execute("SET SESSION sql_mode='STRICT_ALL_TABLES'")

17:43:30: WARNING: /mnt/host/source/chromite/lib/cidb.py:235: Warning: Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
  cur.execute("SET SESSION sql_mode='STRICT_ALL_TABLES'")

17:43:30: INFO: Created cidb engine readonly@104.197.188.23 for pid 8
17:43:30: INFO: Running cidb query on pid 8, repr(query) starts with 'SHOW TABLES'
17:43:31: INFO: Running cidb query on pid 8, repr(query) starts with 'SELECT MAX(schemaVersion) from schemaVersionTable'
17:43:31: INFO: Created a SchemaVersionedMySQLConnection, sqlalchemy version 0.9.2
17:43:32: INFO: Running cidb query on pid 8, repr(query) starts with <sqlalchemy.sql.selectable.Select at 0x7ff1773d6e50; Select object>
17:43:32: ERROR: No build found. Perhaps not started?

I'm updating the help messages to explain this with:

Note:
  This tool does NOT work for master-*-tryjob, precq-launcher-try, or
  builds on branches older than CL:942097.
I've filed the following two bugs for "cros buildresult" improvements.

https://crbug.com/820236 cros buildresult should include UI URL.
https://crbug.com/820251 cros buildresult should have options to wait for tryjob completion.
Project Member

Comment 27 by bugdroid1@chromium.org, Mar 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/671059f67cbcdc96356950df3ac636038a0ef7c2

commit 671059f67cbcdc96356950df3ac636038a0ef7c2
Author: Don Garrett <dgarrett@google.com>
Date: Fri Mar 09 05:59:55 2018

cros tryjob: Add --json option.

Add a new option "--json" to output information about scheduled jobs
in json format. This is intended to make it easier for scripts that
invoke tryjobs to parse the results.

If "cros tryjob" fails for any reason, the output will NOT be json.

Sample json:

cros tryjob --yes --swarming success-build fail-build

[
  {
    "build_config": "success-build",
    "buildbucket_id": "8952660457862247296",
    "url": "<long_url_shortened>"
  },
  {
    "build_config": "fail-build",
    "buildbucket_id": "8952660457215487216",
    "url": "<long_url_shortened>"
  }
]

BUG= chromium:807029 
TEST=Manual tryjobs + run_tests

Change-Id: I7f5dec13b7ee36240a822ee52d430a7e27d8ca31
Reviewed-on: https://chromium-review.googlesource.com/954050
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Jacob Kopczynski <jkop@chromium.org>

[modify] https://crrev.com/671059f67cbcdc96356950df3ac636038a0ef7c2/lib/remote_try.py
[modify] https://crrev.com/671059f67cbcdc96356950df3ac636038a0ef7c2/lib/remote_try_unittest.py
[modify] https://crrev.com/671059f67cbcdc96356950df3ac636038a0ef7c2/cli/cros/cros_tryjob.py

Project Member

Comment 28 by bugdroid1@chromium.org, Mar 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/e28b21886db78623cddea99f2d589dcf0a163fb0

commit e28b21886db78623cddea99f2d589dcf0a163fb0
Author: Prathmesh Prabhu <pprabhu@chromium.org>
Date: Fri Mar 09 23:04:36 2018

Revert "cros tryjob: Add --json option."

This reverts commit 671059f67cbcdc96356950df3ac636038a0ef7c2.

Reason for revert: pre-cq-launcher parses the output of 'cros tryjob' which is now different.

Original change's description:
> cros tryjob: Add --json option.
> 
> Add a new option "--json" to output information about scheduled jobs
> in json format. This is intended to make it easier for scripts that
> invoke tryjobs to parse the results.
> 
> If "cros tryjob" fails for any reason, the output will NOT be json.
> 
> Sample json:
> 
> cros tryjob --yes --swarming success-build fail-build
> 
> [
>   {
>     "build_config": "success-build",
>     "buildbucket_id": "8952660457862247296",
>     "url": "<long_url_shortened>"
>   },
>   {
>     "build_config": "fail-build",
>     "buildbucket_id": "8952660457215487216",
>     "url": "<long_url_shortened>"
>   }
> ]
> 
> BUG= chromium:807029 
> TEST=Manual tryjobs + run_tests
> 
> Change-Id: I7f5dec13b7ee36240a822ee52d430a7e27d8ca31
> Reviewed-on: https://chromium-review.googlesource.com/954050
> Commit-Ready: Don Garrett <dgarrett@chromium.org>
> Tested-by: Don Garrett <dgarrett@chromium.org>
> Reviewed-by: Jacob Kopczynski <jkop@chromium.org>

BUG= chromium:807029 
BUG=chromium:820615

Change-Id: Ib6f2e9e84faba41ec1e8469704afef187fcb0d9f
Reviewed-on: https://chromium-review.googlesource.com/957105
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Jacob Kopczynski <jkop@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>

[modify] https://crrev.com/e28b21886db78623cddea99f2d589dcf0a163fb0/lib/remote_try.py
[modify] https://crrev.com/e28b21886db78623cddea99f2d589dcf0a163fb0/lib/remote_try_unittest.py
[modify] https://crrev.com/e28b21886db78623cddea99f2d589dcf0a163fb0/cli/cros/cros_tryjob.py

Project Member

Comment 29 by bugdroid1@chromium.org, Mar 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/toolchain-utils/+/6a9a98a22ff6e21fb005570f3fc8812fe7010610

commit 6a9a98a22ff6e21fb005570f3fc8812fe7010610
Author: Ting-Yuan Huang <laszio@chromium.org>
Date: Sat Mar 10 02:59:57 2018

cros_utils/buildbot_utils: leverage `cros buildresult`

Originally it sends a http request to some magic URL and parse the
contents. Now there is a `cros buildresult` available for use.

BUG= chromium:807029 
TEST=cros_utils/buildbot_utils_unittest.py
     buildbot_test_toolchains.py

Change-Id: I33441859afd675c1a6b70d3d1f4e2348d54cbd77
Reviewed-on: https://chromium-review.googlesource.com/954052
Commit-Ready: Ting-Yuan Huang <laszio@chromium.org>
Tested-by: Ting-Yuan Huang <laszio@chromium.org>
Reviewed-by: Caroline Tice <cmtice@chromium.org>

[modify] https://crrev.com/6a9a98a22ff6e21fb005570f3fc8812fe7010610/cros_utils/buildbot_utils.py
[modify] https://crrev.com/6a9a98a22ff6e21fb005570f3fc8812fe7010610/buildbot_test_toolchains.py
[modify] https://crrev.com/6a9a98a22ff6e21fb005570f3fc8812fe7010610/buildbot_test_llvm.py
[add] https://crrev.com/6a9a98a22ff6e21fb005570f3fc8812fe7010610/cros_utils/buildbot_utils_unittest.py

Thank you!
Project Member

Comment 31 by bugdroid1@chromium.org, Mar 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/toolchain-utils/+/4c65a3d0f1bb487c94d3e14858505dcf03e5dbf3

commit 4c65a3d0f1bb487c94d3e14858505dcf03e5dbf3
Author: Ting-Yuan Huang <laszio@chromium.org>
Date: Tue Mar 13 07:57:32 2018

cros_utils/buildbot_utils: GetTrybotImage should return a partial URL

It should return a partial URL which is appended to xbuddy://remote/ in
crosperf's exp file.

BUG= chromium:807029 
TEST=cros_utils/buildbot_utils_unittest.py
     buildbot_test_toolchains.py

Change-Id: I1297b4ce586173d8ad97f6c30f989f826050e72b
Reviewed-on: https://chromium-review.googlesource.com/959361
Commit-Ready: Ting-Yuan Huang <laszio@chromium.org>
Tested-by: Ting-Yuan Huang <laszio@chromium.org>
Reviewed-by: Caroline Tice <cmtice@chromium.org>

[modify] https://crrev.com/4c65a3d0f1bb487c94d3e14858505dcf03e5dbf3/cros_utils/buildbot_utils.py
[modify] https://crrev.com/4c65a3d0f1bb487c94d3e14858505dcf03e5dbf3/cros_utils/buildbot_utils_unittest.py

Status: Verified (was: Untriaged)
Project Member

Comment 33 by bugdroid1@chromium.org, Mar 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/999ad27163b4e5f560ad3e3ad30a1351f51ebb50

commit 999ad27163b4e5f560ad3e3ad30a1351f51ebb50
Author: Don Garrett <dgarrett@google.com>
Date: Wed Mar 28 01:01:36 2018

cros tryjob: Add --json option.

Add a new option "--json" to output information about scheduled jobs
in json format. This is intended to make it easier for scripts that
invoke tryjobs to parse the results.

If "cros tryjob" fails for any reason, the output will NOT be json.

Sample json:

cros tryjob --yes --swarming success-build fail-build

[
  {
    "build_config": "success-build",
    "buildbucket_id": "8952660457862247296",
    "url": "<long_url_shortened>"
  },
  {
    "build_config": "fail-build",
    "buildbucket_id": "8952660457215487216",
    "url": "<long_url_shortened>"
  }
]

This was previously submitted and reverted. The dependency on the
PreCQLauncher change should make this safe.

BUG= chromium:807029 
TEST=Manual tryjobs + run_tests
CQ-DEPEND=CL:965163

Change-Id: I40d0b83d916c5aa6fab7c35d2816a7b70dc755d1
Reviewed-on: https://chromium-review.googlesource.com/965162
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Don Garrett <dgarrett@chromium.org>

[modify] https://crrev.com/999ad27163b4e5f560ad3e3ad30a1351f51ebb50/lib/remote_try.py
[modify] https://crrev.com/999ad27163b4e5f560ad3e3ad30a1351f51ebb50/lib/remote_try_unittest.py
[modify] https://crrev.com/999ad27163b4e5f560ad3e3ad30a1351f51ebb50/cli/cros/cros_tryjob.py

Project Member

Comment 34 by bugdroid1@chromium.org, Mar 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/c145d2120c3467d82cd320c8b83769382a4d19a2

commit c145d2120c3467d82cd320c8b83769382a4d19a2
Author: Don Garrett <dgarrett@google.com>
Date: Wed Mar 28 01:01:37 2018

pre-cq-launcher: Switch to cros tryjob --json.

Since the "cros tryjob" can now produce output that is parser
friendly, use it when parsing the output.

BUG= chromium:807029 
TEST=run_tests
CQ-DEPEND=CL:965162

Change-Id: I4e8c87650aae3d9580cabb473eb5ceed8914e7bc
Reviewed-on: https://chromium-review.googlesource.com/965163
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Paul Hobbs <phobbs@google.com>

[modify] https://crrev.com/c145d2120c3467d82cd320c8b83769382a4d19a2/cbuildbot/stages/sync_stages_unittest.py
[modify] https://crrev.com/c145d2120c3467d82cd320c8b83769382a4d19a2/cbuildbot/stages/sync_stages.py

Project Member

Comment 35 by bugdroid1@chromium.org, Mar 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/123ebb93a717ee648e95ecadc6b41538e6509b6d

commit 123ebb93a717ee648e95ecadc6b41538e6509b6d
Author: chromite-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com <chromite-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Date: Wed Mar 28 03:30:04 2018

Roll src/third_party/chromite/ 44e40f3f3..c145d2120 (2 commits)

https://chromium.googlesource.com/chromiumos/chromite.git/+log/44e40f3f3671..c145d2120c34

$ git log 44e40f3f3..c145d2120 --date=short --no-merges --format='%ad %ae %s'
2018-03-15 dgarrett pre-cq-launcher: Switch to cros tryjob --json.
2018-03-07 dgarrett cros tryjob: Add --json option.

Created with:
  roll-dep src/third_party/chromite
BUG= chromium:807029 , chromium:807029 


The AutoRoll server is located here: https://chromite-chromium-roll.skia.org

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.


TBR=chrome-os-gardeners@chromium.org

Change-Id: Ie82d252b6c2c41050596bb5a82c1d85b788c0e43
Reviewed-on: https://chromium-review.googlesource.com/982933
Reviewed-by: Chromite Chromium Autoroll <chromite-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Commit-Queue: Chromite Chromium Autoroll <chromite-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#546390}
[modify] https://crrev.com/123ebb93a717ee648e95ecadc6b41538e6509b6d/DEPS

laszio@ if you update your script to parse the output of "cros tryjob --json" instead of regex'ing the normal output, you'll be more robust against future changes to to cros tryjob.

Sign in to add a comment