aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-03-24 15:09:42 +0100
committerAleksandr Nogikh <wp32pw@gmail.com>2023-03-24 15:37:43 +0100
commitfdb8436feabf92bd16e27ea13ac4da5e9fc87195 (patch)
tree2219a80020bf011eabc7239b7e7ad2a0fb2dc6fe
parentd6deada33c0017e3ba64d25b231b131bbe23131d (diff)
dashboard: use more compact keys for SubsystemReport
Serialization of CreatedTime doesn't really work. Datastore seems to cut the precision, so we're unable to fully reconstruct the key. Convert the time to UTC before constructing the key. Improve error logging.
-rw-r--r--dashboard/app/reporting_lists.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/dashboard/app/reporting_lists.go b/dashboard/app/reporting_lists.go
index 574336af5..102401b2b 100644
--- a/dashboard/app/reporting_lists.go
+++ b/dashboard/app/reporting_lists.go
@@ -129,7 +129,7 @@ func reportingBugListCommand(c context.Context, cmd *dashapi.BugListUpdate) (str
reportKey := subsystemReportKey(c, subsystemKey(c, subsystem), rawReport)
report := new(SubsystemReport)
if err := db.Get(c, reportKey, report); err != nil {
- return err
+ return fmt.Errorf("failed to query SubsystemReport (%v): %w", reportKey, err)
}
stage := report.findStage(cmd.ID)
if stage.ExtID == "" {
@@ -443,7 +443,7 @@ func subsystemKey(c context.Context, s *Subsystem) *db.Key {
}
func subsystemReportKey(c context.Context, subsystemKey *db.Key, r *SubsystemReport) *db.Key {
- return db.NewKey(c, "SubsystemReport", fmt.Sprintf("%v", r.Created), 0, subsystemKey)
+ return db.NewKey(c, "SubsystemReport", r.Created.UTC().Format(time.RFC822), 0, subsystemKey)
}
type subsystemsRegistry struct {