roll_commenter: Use formatted date
Change-Id: I2953c000ab899fefd83b838cdcd76566ab236299
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/278672
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Erik Gilling <konkers@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
diff --git a/recipes/roll_commenter.expected/no_forward_progress.json b/recipes/roll_commenter.expected/no_forward_progress.json
index 7a99bae..b36b995 100644
--- a/recipes/roll_commenter.expected/no_forward_progress.json
+++ b/recipes/roll_commenter.expected/no_forward_progress.json
@@ -3683,21 +3683,21 @@
"cmd": [],
"name": "current time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 14, 12, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-14 12:53:27.500000@@@"
]
},
{
"cmd": [],
"name": "warning time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 13, 21, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-13 21:53:27.500000@@@"
]
},
{
"cmd": [],
"name": "ignore time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 6, 21, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-06 21:53:27.500000@@@"
]
},
{
diff --git a/recipes/roll_commenter.expected/no_forward_progress_but_passing_suppress.json b/recipes/roll_commenter.expected/no_forward_progress_but_passing_suppress.json
index b017bd2..fd44bfe 100644
--- a/recipes/roll_commenter.expected/no_forward_progress_but_passing_suppress.json
+++ b/recipes/roll_commenter.expected/no_forward_progress_but_passing_suppress.json
@@ -3670,21 +3670,21 @@
"cmd": [],
"name": "current time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 14, 12, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-14 12:53:27.500000@@@"
]
},
{
"cmd": [],
"name": "warning time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 13, 21, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-13 21:53:27.500000@@@"
]
},
{
"cmd": [],
"name": "ignore time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 6, 21, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-06 21:53:27.500000@@@"
]
},
{
diff --git a/recipes/roll_commenter.expected/no_forward_progress_dry_run_already_warned_suppress.json b/recipes/roll_commenter.expected/no_forward_progress_dry_run_already_warned_suppress.json
index 3f0dff5..faebf41 100644
--- a/recipes/roll_commenter.expected/no_forward_progress_dry_run_already_warned_suppress.json
+++ b/recipes/roll_commenter.expected/no_forward_progress_dry_run_already_warned_suppress.json
@@ -3683,21 +3683,21 @@
"cmd": [],
"name": "current time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 14, 12, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-14 12:53:27.500000@@@"
]
},
{
"cmd": [],
"name": "warning time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 13, 21, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-13 21:53:27.500000@@@"
]
},
{
"cmd": [],
"name": "ignore time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 6, 21, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-06 21:53:27.500000@@@"
]
},
{
diff --git a/recipes/roll_commenter.expected/nothing_to_roll.json b/recipes/roll_commenter.expected/nothing_to_roll.json
index 3af9d5b..ffcf50c 100644
--- a/recipes/roll_commenter.expected/nothing_to_roll.json
+++ b/recipes/roll_commenter.expected/nothing_to_roll.json
@@ -3644,21 +3644,21 @@
"cmd": [],
"name": "current time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 14, 12, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-14 12:53:27.500000@@@"
]
},
{
"cmd": [],
"name": "warning time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 13, 21, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-13 21:53:27.500000@@@"
]
},
{
"cmd": [],
"name": "ignore time",
"~followup_annotations": [
- "@@@STEP_SUMMARY_TEXT@datetime.datetime(2012, 5, 6, 21, 53, 27, 500000)@@@"
+ "@@@STEP_SUMMARY_TEXT@2012-05-06 21:53:27.500000@@@"
]
},
{
diff --git a/recipes/roll_commenter.py b/recipes/roll_commenter.py
index bf57c59..ebfd03e 100644
--- a/recipes/roll_commenter.py
+++ b/recipes/roll_commenter.py
@@ -385,14 +385,16 @@
warning_time = current_time - delta
ignore_time = warning_time - datetime.timedelta(days=7)
+ date_format = '%Y-%m-%d %H:%M:%S.%f'
+
pres = api.step.empty('current time').presentation
- pres.step_summary_text = repr(current_time)
+ pres.step_summary_text = current_time.strftime(date_format)
pres = api.step.empty('warning time').presentation
- pres.step_summary_text = repr(warning_time)
+ pres.step_summary_text = warning_time.strftime(date_format)
pres = api.step.empty('ignore time').presentation
- pres.step_summary_text = repr(ignore_time)
+ pres.step_summary_text = ignore_time.strftime(date_format)
# Make the first two commits this checks in testing be beyond the threshold
# but all remaining commits are within the threshold. (See also where