Skip to content

Commit

Permalink
fix(logbook): write timestamps on push & delete operations
Browse files Browse the repository at this point in the history
we were missing these.
  • Loading branch information
b5 committed Jul 16, 2020
1 parent f948cdf commit 079c759
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions logbook/logbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ func (book *Book) WriteRemotePush(ctx context.Context, initID string, revisions
branchLog.Append(oplog.Op{
Type: oplog.OpTypeInit,
Model: PushModel,
Timestamp: NewTimestamp(),
Size: int64(revisions),
Relations: []string{remoteAddr},
})
Expand Down Expand Up @@ -693,6 +694,7 @@ func (book *Book) WriteRemoteDelete(ctx context.Context, initID string, revision
branchLog.Append(oplog.Op{
Type: oplog.OpTypeRemove,
Model: PushModel,
Timestamp: NewTimestamp(),
Size: int64(revisions),
Relations: []string{remoteAddr},
})
Expand Down
8 changes: 4 additions & 4 deletions logbook/logbook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ func TestBookLogEntries(t *testing.T) {
"12:02AM\ttest_author\tinit branch\tmain",
"12:00AM\ttest_author\tsave commit\tinitial commit",
"12:00AM\ttest_author\tsave commit\tadded body data",
"12:00AM\ttest_author\tpublish\t",
"12:00AM\ttest_author\tunpublish\t",
"12:03AM\ttest_author\tpublish\t",
"12:04AM\ttest_author\tunpublish\t",
"12:00AM\ttest_author\tremove commit\t",
"12:00AM\ttest_author\tamend commit\tadded meta info",
}
Expand Down Expand Up @@ -1167,14 +1167,14 @@ func (tr *testRunner) WorldBankPlainLog() logbook.PlainLog {
Relations: []string{
"registry.qri.cloud",
},
Timestamp: mustTime("1969-12-31T19:00:00-05:00"),
Timestamp: mustTime("1999-12-31T19:03:00-05:00"),
Size: 2,
},
{
Type: "remove",
Model: "push",
Relations: []string{"registry.qri.cloud"},
Timestamp: mustTime("1969-12-31T19:00:00-05:00"),
Timestamp: mustTime("1999-12-31T19:04:00-05:00"),
Size: 2,
},
{
Expand Down

0 comments on commit 079c759

Please sign in to comment.