summaryrefslogtreecommitdiffstatshomepage
path: root/entities/bug
diff options
context:
space:
mode:
Diffstat (limited to 'entities/bug')
-rw-r--r--entities/bug/bug_actions.go5
-rw-r--r--entities/bug/comment.go3
-rw-r--r--entities/bug/op_add_comment.go5
-rw-r--r--entities/bug/op_add_comment_test.go5
-rw-r--r--entities/bug/op_create.go5
-rw-r--r--entities/bug/op_create_test.go4
-rw-r--r--entities/bug/op_edit_comment.go7
-rw-r--r--entities/bug/op_edit_comment_test.go4
-rw-r--r--entities/bug/op_label_change.go9
-rw-r--r--entities/bug/op_label_change_test.go7
-rw-r--r--entities/bug/op_set_metadata.go5
-rw-r--r--entities/bug/op_set_status.go9
-rw-r--r--entities/bug/op_set_status_test.go3
-rw-r--r--entities/bug/op_set_title.go7
-rw-r--r--entities/bug/op_set_title_test.go3
-rw-r--r--entities/bug/snapshot.go11
-rw-r--r--entities/bug/timeline.go5
17 files changed, 41 insertions, 56 deletions
diff --git a/entities/bug/bug_actions.go b/entities/bug/bug_actions.go
index 651d24dc0..1d1bda78f 100644
--- a/entities/bug/bug_actions.go
+++ b/entities/bug/bug_actions.go
@@ -1,7 +1,6 @@
package bug
import (
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
"github.com/MichaelMure/git-bug/repository"
@@ -22,14 +21,14 @@ func Push(repo repository.Repo, remote string) (string, error) {
// This function will return an error if a merge fail
// Note: an author is necessary for the case where a merge commit is created, as this commit will
// have an author and may be signed if a signing key is available.
-func Pull(repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, mergeAuthor identity.Interface) error {
+func Pull(repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, mergeAuthor entity.Identity) error {
return dag.Pull(def, wrapper, repo, resolvers, remote, mergeAuthor)
}
// MergeAll will merge all the available remote bug
// Note: an author is necessary for the case where a merge commit is created, as this commit will
// have an author and may be signed if a signing key is available.
-func MergeAll(repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, mergeAuthor identity.Interface) <-chan entity.MergeResult {
+func MergeAll(repo repository.ClockedRepo, resolvers entity.Resolvers, remote string, mergeAuthor entity.Identity) <-chan entity.MergeResult {
return dag.MergeAll(def, wrapper, repo, resolvers, remote, mergeAuthor)
}
diff --git a/entities/bug/comment.go b/entities/bug/comment.go
index 7835c5a8a..15fb6a5d0 100644
--- a/entities/bug/comment.go
+++ b/entities/bug/comment.go
@@ -3,7 +3,6 @@ package bug
import (
"github.com/dustin/go-humanize"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/repository"
"github.com/MichaelMure/git-bug/util/timestamp"
@@ -18,7 +17,7 @@ type Comment struct {
// targetId is the Id of the Operation that originally created that Comment
targetId entity.Id
- Author identity.Interface
+ Author entity.Identity
Message string
Files []repository.Hash
diff --git a/entities/bug/op_add_comment.go b/entities/bug/op_add_comment.go
index 17cc5dd05..833aa894e 100644
--- a/entities/bug/op_add_comment.go
+++ b/entities/bug/op_add_comment.go
@@ -3,7 +3,6 @@ package bug
import (
"fmt"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
"github.com/MichaelMure/git-bug/repository"
@@ -72,7 +71,7 @@ func (op *AddCommentOperation) Validate() error {
return nil
}
-func NewAddCommentOp(author identity.Interface, unixTime int64, message string, files []repository.Hash) *AddCommentOperation {
+func NewAddCommentOp(author entity.Identity, unixTime int64, message string, files []repository.Hash) *AddCommentOperation {
return &AddCommentOperation{
OpBase: dag.NewOpBase(AddCommentOp, author, unixTime),
Message: message,
@@ -89,7 +88,7 @@ type AddCommentTimelineItem struct {
func (a *AddCommentTimelineItem) IsAuthored() {}
// AddComment is a convenience function to add a comment to a bug
-func AddComment(b Interface, author identity.Interface, unixTime int64, message string, files []repository.Hash, metadata map[string]string) (entity.CombinedId, *AddCommentOperation, error) {
+func AddComment(b Interface, author entity.Identity, unixTime int64, message string, files []repository.Hash, metadata map[string]string) (entity.CombinedId, *AddCommentOperation, error) {
op := NewAddCommentOp(author, unixTime, message, files)
for key, val := range metadata {
op.SetMetadata(key, val)
diff --git a/entities/bug/op_add_comment_test.go b/entities/bug/op_add_comment_test.go
index fee9e785c..7727c45b9 100644
--- a/entities/bug/op_add_comment_test.go
+++ b/entities/bug/op_add_comment_test.go
@@ -3,17 +3,16 @@ package bug
import (
"testing"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
"github.com/MichaelMure/git-bug/repository"
)
func TestAddCommentSerialize(t *testing.T) {
- dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*AddCommentOperation, entity.Resolvers) {
+ dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*AddCommentOperation, entity.Resolvers) {
return NewAddCommentOp(author, unixTime, "message", nil), nil
})
- dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*AddCommentOperation, entity.Resolvers) {
+ dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*AddCommentOperation, entity.Resolvers) {
return NewAddCommentOp(author, unixTime, "message", []repository.Hash{"hash1", "hash2"}), nil
})
}
diff --git a/entities/bug/op_create.go b/entities/bug/op_create.go
index 63eb438d0..33504e3d0 100644
--- a/entities/bug/op_create.go
+++ b/entities/bug/op_create.go
@@ -3,7 +3,6 @@ package bug
import (
"fmt"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
"github.com/MichaelMure/git-bug/repository"
@@ -89,7 +88,7 @@ func (op *CreateOperation) Validate() error {
return nil
}
-func NewCreateOp(author identity.Interface, unixTime int64, title, message string, files []repository.Hash) *CreateOperation {
+func NewCreateOp(author entity.Identity, unixTime int64, title, message string, files []repository.Hash) *CreateOperation {
return &CreateOperation{
OpBase: dag.NewOpBase(CreateOp, author, unixTime),
Title: title,
@@ -107,7 +106,7 @@ type CreateTimelineItem struct {
func (c *CreateTimelineItem) IsAuthored() {}
// Create is a convenience function to create a bug
-func Create(author identity.Interface, unixTime int64, title, message string, files []repository.Hash, metadata map[string]string) (*Bug, *CreateOperation, error) {
+func Create(author entity.Identity, unixTime int64, title, message string, files []repository.Hash, metadata map[string]string) (*Bug, *CreateOperation, error) {
b := NewBug()
op := NewCreateOp(author, unixTime, title, message, files)
for key, val := range metadata {
diff --git a/entities/bug/op_create_test.go b/entities/bug/op_create_test.go
index d8bde46f1..f340876fa 100644
--- a/entities/bug/op_create_test.go
+++ b/entities/bug/op_create_test.go
@@ -40,10 +40,10 @@ func TestCreate(t *testing.T) {
}
func TestCreateSerialize(t *testing.T) {
- dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*CreateOperation, entity.Resolvers) {
+ dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*CreateOperation, entity.Resolvers) {
return NewCreateOp(author, unixTime, "title", "message", nil), nil
})
- dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*CreateOperation, entity.Resolvers) {
+ dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*CreateOperation, entity.Resolvers) {
return NewCreateOp(author, unixTime, "title", "message", []repository.Hash{"hash1", "hash2"}), nil
})
}
diff --git a/entities/bug/op_edit_comment.go b/entities/bug/op_edit_comment.go
index 788d16d92..d2f47db94 100644
--- a/entities/bug/op_edit_comment.go
+++ b/entities/bug/op_edit_comment.go
@@ -5,7 +5,6 @@ import (
"github.com/pkg/errors"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
"github.com/MichaelMure/git-bug/repository"
@@ -107,7 +106,7 @@ func (op *EditCommentOperation) Validate() error {
return nil
}
-func NewEditCommentOp(author identity.Interface, unixTime int64, target entity.Id, message string, files []repository.Hash) *EditCommentOperation {
+func NewEditCommentOp(author entity.Identity, unixTime int64, target entity.Id, message string, files []repository.Hash) *EditCommentOperation {
return &EditCommentOperation{
OpBase: dag.NewOpBase(EditCommentOp, author, unixTime),
Target: target,
@@ -117,7 +116,7 @@ func NewEditCommentOp(author identity.Interface, unixTime int64, target entity.I
}
// EditComment is a convenience function to apply the operation
-func EditComment(b Interface, author identity.Interface, unixTime int64, target entity.Id, message string, files []repository.Hash, metadata map[string]string) (entity.CombinedId, *EditCommentOperation, error) {
+func EditComment(b Interface, author entity.Identity, unixTime int64, target entity.Id, message string, files []repository.Hash, metadata map[string]string) (entity.CombinedId, *EditCommentOperation, error) {
op := NewEditCommentOp(author, unixTime, target, message, files)
for key, val := range metadata {
op.SetMetadata(key, val)
@@ -130,7 +129,7 @@ func EditComment(b Interface, author identity.Interface, unixTime int64, target
}
// EditCreateComment is a convenience function to edit the body of a bug (the first comment)
-func EditCreateComment(b Interface, author identity.Interface, unixTime int64, message string, files []repository.Hash, metadata map[string]string) (entity.CombinedId, *EditCommentOperation, error) {
+func EditCreateComment(b Interface, author entity.Identity, unixTime int64, message string, files []repository.Hash, metadata map[string]string) (entity.CombinedId, *EditCommentOperation, error) {
createOp := b.FirstOp().(*CreateOperation)
return EditComment(b, author, unixTime, createOp.Id(), message, files, metadata)
}
diff --git a/entities/bug/op_edit_comment_test.go b/entities/bug/op_edit_comment_test.go
index 2ca1345e2..76a68f305 100644
--- a/entities/bug/op_edit_comment_test.go
+++ b/entities/bug/op_edit_comment_test.go
@@ -76,10 +76,10 @@ func TestEdit(t *testing.T) {
}
func TestEditCommentSerialize(t *testing.T) {
- dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*EditCommentOperation, entity.Resolvers) {
+ dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*EditCommentOperation, entity.Resolvers) {
return NewEditCommentOp(author, unixTime, "target", "message", nil), nil
})
- dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*EditCommentOperation, entity.Resolvers) {
+ dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*EditCommentOperation, entity.Resolvers) {
return NewEditCommentOp(author, unixTime, "target", "message", []repository.Hash{"hash1", "hash2"}), nil
})
}
diff --git a/entities/bug/op_label_change.go b/entities/bug/op_label_change.go
index 0d13fe9e0..816effc84 100644
--- a/entities/bug/op_label_change.go
+++ b/entities/bug/op_label_change.go
@@ -8,7 +8,6 @@ import (
"github.com/pkg/errors"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
"github.com/MichaelMure/git-bug/util/timestamp"
@@ -96,7 +95,7 @@ func (op *LabelChangeOperation) Validate() error {
return nil
}
-func NewLabelChangeOperation(author identity.Interface, unixTime int64, added, removed []Label) *LabelChangeOperation {
+func NewLabelChangeOperation(author entity.Identity, unixTime int64, added, removed []Label) *LabelChangeOperation {
return &LabelChangeOperation{
OpBase: dag.NewOpBase(LabelChangeOp, author, unixTime),
Added: added,
@@ -106,7 +105,7 @@ func NewLabelChangeOperation(author identity.Interface, unixTime int64, added, r
type LabelChangeTimelineItem struct {
combinedId entity.CombinedId
- Author identity.Interface
+ Author entity.Identity
UnixTime timestamp.Timestamp
Added []Label
Removed []Label
@@ -120,7 +119,7 @@ func (l LabelChangeTimelineItem) CombinedId() entity.CombinedId {
func (l *LabelChangeTimelineItem) IsAuthored() {}
// ChangeLabels is a convenience function to change labels on a bug
-func ChangeLabels(b Interface, author identity.Interface, unixTime int64, add, remove []string, metadata map[string]string) ([]LabelChangeResult, *LabelChangeOperation, error) {
+func ChangeLabels(b Interface, author entity.Identity, unixTime int64, add, remove []string, metadata map[string]string) ([]LabelChangeResult, *LabelChangeOperation, error) {
var added, removed []Label
var results []LabelChangeResult
@@ -186,7 +185,7 @@ func ChangeLabels(b Interface, author identity.Interface, unixTime int64, add, r
// responsible for what you are doing. In the general case, you want to use ChangeLabels instead.
// The intended use of this function is to allow importers to create legal but unexpected label changes,
// like removing a label with no information of when it was added before.
-func ForceChangeLabels(b Interface, author identity.Interface, unixTime int64, add, remove []string, metadata map[string]string) (*LabelChangeOperation, error) {
+func ForceChangeLabels(b Interface, author entity.Identity, unixTime int64, add, remove []string, metadata map[string]string) (*LabelChangeOperation, error) {
added := make([]Label, len(add))
for i, str := range add {
added[i] = Label(str)
diff --git a/entities/bug/op_label_change_test.go b/entities/bug/op_label_change_test.go
index e6dc88035..c27e906d6 100644
--- a/entities/bug/op_label_change_test.go
+++ b/entities/bug/op_label_change_test.go
@@ -3,19 +3,18 @@ package bug
import (
"testing"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
)
func TestLabelChangeSerialize(t *testing.T) {
- dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*LabelChangeOperation, entity.Resolvers) {
+ dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*LabelChangeOperation, entity.Resolvers) {
return NewLabelChangeOperation(author, unixTime, []Label{"added"}, []Label{"removed"}), nil
})
- dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*LabelChangeOperation, entity.Resolvers) {
+ dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*LabelChangeOperation, entity.Resolvers) {
return NewLabelChangeOperation(author, unixTime, []Label{"added"}, nil), nil
})
- dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*LabelChangeOperation, entity.Resolvers) {
+ dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*LabelChangeOperation, entity.Resolvers) {
return NewLabelChangeOperation(author, unixTime, nil, []Label{"removed"}), nil
})
}
diff --git a/entities/bug/op_set_metadata.go b/entities/bug/op_set_metadata.go
index b4aab78c7..9d4f01f6d 100644
--- a/entities/bug/op_set_metadata.go
+++ b/entities/bug/op_set_metadata.go
@@ -1,17 +1,16 @@
package bug
import (
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
)
-func NewSetMetadataOp(author identity.Interface, unixTime int64, target entity.Id, newMetadata map[string]string) *dag.SetMetadataOperation[*Snapshot] {
+func NewSetMetadataOp(author entity.Identity, unixTime int64, target entity.Id, newMetadata map[string]string) *dag.SetMetadataOperation[*Snapshot] {
return dag.NewSetMetadataOp[*Snapshot](SetMetadataOp, author, unixTime, target, newMetadata)
}
// SetMetadata is a convenience function to add metadata on another operation
-func SetMetadata(b Interface, author identity.Interface, unixTime int64, target entity.Id, newMetadata map[string]string) (*dag.SetMetadataOperation[*Snapshot], error) {
+func SetMetadata(b Interface, author entity.Identity, unixTime int64, target entity.Id, newMetadata map[string]string) (*dag.SetMetadataOperation[*Snapshot], error) {
op := NewSetMetadataOp(author, unixTime, target, newMetadata)
if err := op.Validate(); err != nil {
return nil, err
diff --git a/entities/bug/op_set_status.go b/entities/bug/op_set_status.go
index 68199129d..0fdce8a6f 100644
--- a/entities/bug/op_set_status.go
+++ b/entities/bug/op_set_status.go
@@ -4,7 +4,6 @@ import (
"github.com/pkg/errors"
"github.com/MichaelMure/git-bug/entities/common"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
"github.com/MichaelMure/git-bug/util/timestamp"
@@ -50,7 +49,7 @@ func (op *SetStatusOperation) Validate() error {
return nil
}
-func NewSetStatusOp(author identity.Interface, unixTime int64, status common.Status) *SetStatusOperation {
+func NewSetStatusOp(author entity.Identity, unixTime int64, status common.Status) *SetStatusOperation {
return &SetStatusOperation{
OpBase: dag.NewOpBase(SetStatusOp, author, unixTime),
Status: status,
@@ -59,7 +58,7 @@ func NewSetStatusOp(author identity.Interface, unixTime int64, status common.Sta
type SetStatusTimelineItem struct {
combinedId entity.CombinedId
- Author identity.Interface
+ Author entity.Identity
UnixTime timestamp.Timestamp
Status common.Status
}
@@ -72,7 +71,7 @@ func (s SetStatusTimelineItem) CombinedId() entity.CombinedId {
func (s *SetStatusTimelineItem) IsAuthored() {}
// Open is a convenience function to change a bugs state to Open
-func Open(b Interface, author identity.Interface, unixTime int64, metadata map[string]string) (*SetStatusOperation, error) {
+func Open(b Interface, author entity.Identity, unixTime int64, metadata map[string]string) (*SetStatusOperation, error) {
op := NewSetStatusOp(author, unixTime, common.OpenStatus)
for key, value := range metadata {
op.SetMetadata(key, value)
@@ -85,7 +84,7 @@ func Open(b Interface, author identity.Interface, unixTime int64, metadata map[s
}
// Close is a convenience function to change a bugs state to Close
-func Close(b Interface, author identity.Interface, unixTime int64, metadata map[string]string) (*SetStatusOperation, error) {
+func Close(b Interface, author entity.Identity, unixTime int64, metadata map[string]string) (*SetStatusOperation, error) {
op := NewSetStatusOp(author, unixTime, common.ClosedStatus)
for key, value := range metadata {
op.SetMetadata(key, value)
diff --git a/entities/bug/op_set_status_test.go b/entities/bug/op_set_status_test.go
index 0f6d358a1..0670c7ceb 100644
--- a/entities/bug/op_set_status_test.go
+++ b/entities/bug/op_set_status_test.go
@@ -4,13 +4,12 @@ import (
"testing"
"github.com/MichaelMure/git-bug/entities/common"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
)
func TestSetStatusSerialize(t *testing.T) {
- dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*SetStatusOperation, entity.Resolvers) {
+ dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*SetStatusOperation, entity.Resolvers) {
return NewSetStatusOp(author, unixTime, common.ClosedStatus), nil
})
}
diff --git a/entities/bug/op_set_title.go b/entities/bug/op_set_title.go
index 6e445aa64..60da2eaec 100644
--- a/entities/bug/op_set_title.go
+++ b/entities/bug/op_set_title.go
@@ -3,7 +3,6 @@ package bug
import (
"fmt"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
"github.com/MichaelMure/git-bug/util/timestamp"
@@ -60,7 +59,7 @@ func (op *SetTitleOperation) Validate() error {
return nil
}
-func NewSetTitleOp(author identity.Interface, unixTime int64, title string, was string) *SetTitleOperation {
+func NewSetTitleOp(author entity.Identity, unixTime int64, title string, was string) *SetTitleOperation {
return &SetTitleOperation{
OpBase: dag.NewOpBase(SetTitleOp, author, unixTime),
Title: title,
@@ -70,7 +69,7 @@ func NewSetTitleOp(author identity.Interface, unixTime int64, title string, was
type SetTitleTimelineItem struct {
combinedId entity.CombinedId
- Author identity.Interface
+ Author entity.Identity
UnixTime timestamp.Timestamp
Title string
Was string
@@ -84,7 +83,7 @@ func (s SetTitleTimelineItem) CombinedId() entity.CombinedId {
func (s *SetTitleTimelineItem) IsAuthored() {}
// SetTitle is a convenience function to change a bugs title
-func SetTitle(b Interface, author identity.Interface, unixTime int64, title string, metadata map[string]string) (*SetTitleOperation, error) {
+func SetTitle(b Interface, author entity.Identity, unixTime int64, title string, metadata map[string]string) (*SetTitleOperation, error) {
var lastTitleOp *SetTitleOperation
for _, op := range b.Operations() {
switch op := op.(type) {
diff --git a/entities/bug/op_set_title_test.go b/entities/bug/op_set_title_test.go
index 82425ab49..4d59f4fbd 100644
--- a/entities/bug/op_set_title_test.go
+++ b/entities/bug/op_set_title_test.go
@@ -3,13 +3,12 @@ package bug
import (
"testing"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
)
func TestSetTitleSerialize(t *testing.T) {
- dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author identity.Interface, unixTime int64) (*SetTitleOperation, entity.Resolvers) {
+ dag.SerializeRoundTripTest(t, operationUnmarshaler, func(author entity.Identity, unixTime int64) (*SetTitleOperation, entity.Resolvers) {
return NewSetTitleOp(author, unixTime, "title", "was"), nil
})
}
diff --git a/entities/bug/snapshot.go b/entities/bug/snapshot.go
index 9dbc78625..b458771bc 100644
--- a/entities/bug/snapshot.go
+++ b/entities/bug/snapshot.go
@@ -5,7 +5,6 @@ import (
"time"
"github.com/MichaelMure/git-bug/entities/common"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
)
@@ -19,9 +18,9 @@ type Snapshot struct {
Title string
Comments []Comment
Labels []Label
- Author identity.Interface
- Actors []identity.Interface
- Participants []identity.Interface
+ Author entity.Identity
+ Actors []entity.Identity
+ Participants []entity.Identity
CreateTime time.Time
Timeline []TimelineItem
@@ -94,7 +93,7 @@ func (snap *Snapshot) SearchCommentByOpId(id entity.Id) (*Comment, error) {
}
// append the operation author to the actors list
-func (snap *Snapshot) addActor(actor identity.Interface) {
+func (snap *Snapshot) addActor(actor entity.Identity) {
for _, a := range snap.Actors {
if actor.Id() == a.Id() {
return
@@ -105,7 +104,7 @@ func (snap *Snapshot) addActor(actor identity.Interface) {
}
// append the operation author to the participants list
-func (snap *Snapshot) addParticipant(participant identity.Interface) {
+func (snap *Snapshot) addParticipant(participant entity.Identity) {
for _, p := range snap.Participants {
if participant.Id() == p.Id() {
return
diff --git a/entities/bug/timeline.go b/entities/bug/timeline.go
index 84ece2621..3c425777a 100644
--- a/entities/bug/timeline.go
+++ b/entities/bug/timeline.go
@@ -3,7 +3,6 @@ package bug
import (
"strings"
- "github.com/MichaelMure/git-bug/entities/identity"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/repository"
"github.com/MichaelMure/git-bug/util/timestamp"
@@ -18,7 +17,7 @@ type TimelineItem interface {
type CommentHistoryStep struct {
// The author of the edition, not necessarily the same as the author of the
// original comment
- Author identity.Interface
+ Author entity.Identity
// The new message
Message string
UnixTime timestamp.Timestamp
@@ -27,7 +26,7 @@ type CommentHistoryStep struct {
// CommentTimelineItem is a TimelineItem that holds a Comment and its edition history
type CommentTimelineItem struct {
combinedId entity.CombinedId
- Author identity.Interface
+ Author entity.Identity
Message string
Files []repository.Hash
CreatedAt timestamp.Timestamp