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

Issue 1846713002: Improve the error message in BuildTime.InThePast to help figure out the problem. (Closed)

Created:
4 years, 8 months ago by M-A Ruel
Modified:
4 years, 6 months ago
Reviewers:
lgarron, Nico, felt, mithro
CC:
chromium-reviews, Wez
Base URL:
https://chromium.googlesource.com/a/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix latent bug in GetBuildTime(). - Change the generated_build_date.h to contain the full timestamp, it makes the code less brittle. - For official builds before 5:00am, it would generate a build time in the future. Fix this. - Improve the error message in BuildTime.InThePast. - Add test case to ensure the build is not more than 45 days old. - Remove dummy test. - Improve comments in base/BUILD.gn and base/base.gyp. - Add functional write_build_date_header.py --help. This change builds upon work in https://codereview.chromium.org/1641413002. R=thakis@chromium.org,felt@chromium.org,lgarron@chromium.org BUG=587694 Committed: https://crrev.com/1c9b02233631b0ba9b096d79bf5b8d71a370dbb0 Cr-Commit-Position: refs/heads/master@{#384991}

Patch Set 1 #

Patch Set 2 : With fix #

Total comments: 3

Patch Set 3 : Rewrite #

Total comments: 5

Patch Set 4 : Improved comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -43 lines) Patch
M base/BUILD.gn View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M base/build_time.cc View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M base/build_time_unittest.cc View 1 2 1 chunk +17 lines, -10 lines 0 comments Download
M build/write_build_date_header.py View 1 2 3 2 chunks +50 lines, -29 lines 0 comments Download

Messages

Total messages: 31 (11 generated)
M-A Ruel
4 years, 8 months ago (2016-03-30 20:22:18 UTC) #1
M-A Ruel
Ah, the error is silly, let me fix it while at it.
4 years, 8 months ago (2016-03-30 20:24:40 UTC) #2
Nico
Thanks! https://codereview.chromium.org/1846713002/diff/20001/base/build_time_unittest.cc File base/build_time_unittest.cc (left): https://codereview.chromium.org/1846713002/diff/20001/base/build_time_unittest.cc#oldcode19 base/build_time_unittest.cc:19: TEST(BuildTime, TimeLooksValid) { what's wrong with this test? ...
4 years, 8 months ago (2016-03-30 20:34:00 UTC) #3
M-A Ruel
https://codereview.chromium.org/1846713002/diff/20001/build/write_build_date_header.py File build/write_build_date_header.py (right): https://codereview.chromium.org/1846713002/diff/20001/build/write_build_date_header.py#newcode82 build/write_build_date_header.py:82: # See //base/build_time.cc. On 2016/03/30 20:34:00, Nico wrote: > ...
4 years, 8 months ago (2016-03-30 20:38:09 UTC) #4
M-A Ruel
Please review.
4 years, 8 months ago (2016-03-30 21:19:47 UTC) #9
M-A Ruel
On 2016/03/30 21:19:47, M-A Ruel wrote: > Please review. Oops, I had meant to include ...
4 years, 8 months ago (2016-03-30 21:20:27 UTC) #12
Nico
lgtm!
4 years, 8 months ago (2016-03-30 21:30:04 UTC) #14
felt
lgarron, can you review first? then i'll take a look.
4 years, 8 months ago (2016-03-30 21:39:35 UTC) #15
M-A Ruel
On 2016/03/30 21:39:35, felt wrote: > lgarron, can you review first? then i'll take a ...
4 years, 8 months ago (2016-03-31 22:01:24 UTC) #16
lgarron
On 2016/03/31 at 22:01:24, maruel wrote: > On 2016/03/30 21:39:35, felt wrote: > > lgarron, ...
4 years, 8 months ago (2016-04-01 03:20:32 UTC) #17
M-A Ruel
On 2016/04/01 03:20:32, lgarron wrote: > On 2016/03/31 at 22:01:24, maruel wrote: > > On ...
4 years, 8 months ago (2016-04-01 14:54:47 UTC) #18
mithro
Generally LGTM. Not sure why you are using the weird char array and comparing character ...
4 years, 8 months ago (2016-04-04 04:29:26 UTC) #19
Nico
https://codereview.chromium.org/1846713002/diff/40001/build/write_build_date_header.py File build/write_build_date_header.py (right): https://codereview.chromium.org/1846713002/diff/40001/build/write_build_date_header.py#newcode73 build/write_build_date_header.py:73: if doctest.testmod()[0]: ^ mithro: see here for the doctest ...
4 years, 8 months ago (2016-04-04 15:31:44 UTC) #20
lgarron
maruel@: It seems I didn't add/persist the proper calendar OOO. :-( Thanks for pointing out ...
4 years, 8 months ago (2016-04-04 17:43:24 UTC) #22
M-A Ruel
https://codereview.chromium.org/1846713002/diff/40001/build/write_build_date_header.py File build/write_build_date_header.py (right): https://codereview.chromium.org/1846713002/diff/40001/build/write_build_date_header.py#newcode29 build/write_build_date_header.py:29: >>> GetFirstSundayOfMonth(2016, 2) On 2016/04/04 17:43:24, lgarron wrote: > ...
4 years, 8 months ago (2016-04-04 18:05:01 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1846713002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1846713002/60001
4 years, 8 months ago (2016-04-04 19:08:38 UTC) #26
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 8 months ago (2016-04-04 20:21:49 UTC) #27
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/1c9b02233631b0ba9b096d79bf5b8d71a370dbb0 Cr-Commit-Position: refs/heads/master@{#384991}
4 years, 8 months ago (2016-04-04 20:23:13 UTC) #29
vmpstr
On 2016/04/04 20:23:13, commit-bot: I haz the power wrote: > Patchset 4 (id:??) landed as ...
4 years, 8 months ago (2016-04-05 00:08:28 UTC) #30
M-A Ruel
4 years, 8 months ago (2016-04-05 00:21:30 UTC) #31
Message was sent while issue was closed.
On 2016/04/05 00:08:28, vmpstr wrote:
> On 2016/04/04 20:23:13, commit-bot: I haz the power wrote:
> > Patchset 4 (id:??) landed as
> > https://crrev.com/1c9b02233631b0ba9b096d79bf5b8d71a370dbb0
> > Cr-Commit-Position: refs/heads/master@{#384991}
> 
> I get a 
> 
> FAILED: python ../../build/write_build_date_header.py
> clang_x64/gen/base/generated_build_date.h default
> Traceback (most recent call last):
>   File "../../build/write_build_date_header.py", line 118, in <module>
>     sys.exit(main())
>   File "../../build/write_build_date_header.py", line 97, in main
>     now = now - datetime.timedelta(day=1)
> TypeError: 'day' is an invalid keyword argument for this function
> 
> 
> Is there anything special I need to do to resolve this?

https://chromium.googlesource.com/chromium/src/+/031aebddd2c595f9bcbf9c11457b...
https://codereview.chromium.org/1862503002

Powered by Google App Engine
This is Rietveld 408576698