@@ -13,7 +13,7 @@ import (
13
13
"github.com/databrickslabs/sandbox/go-libs/github"
14
14
)
15
15
16
- func New (ctx context.Context , gh * github.GitHubClient , root string ) (* Finder , error ) {
16
+ func New (ctx context.Context , gh * github.GitHubClient , root string ) (* TechnicalDebtFinder , error ) {
17
17
fs , err := fileset .RecursiveChildren (root )
18
18
if err != nil {
19
19
return nil , fmt .Errorf ("fileset: %w" , err )
@@ -35,14 +35,14 @@ func New(ctx context.Context, gh *github.GitHubClient, root string) (*Finder, er
35
35
if err != nil {
36
36
return nil , fmt .Errorf ("git: %w" , err )
37
37
}
38
- return & Finder {
38
+ return & TechnicalDebtFinder {
39
39
fs : scope ,
40
40
git : checkout ,
41
41
gh : gh ,
42
42
}, nil
43
43
}
44
44
45
- type Finder struct {
45
+ type TechnicalDebtFinder struct {
46
46
fs fileset.FileSet
47
47
git * git.Checkout
48
48
gh * github.GitHubClient
@@ -53,7 +53,7 @@ type Todo struct {
53
53
link string
54
54
}
55
55
56
- func (f * Finder ) Create (ctx context.Context ) error {
56
+ func (f * TechnicalDebtFinder ) CreateIssues (ctx context.Context ) error {
57
57
todos , err := f .allTodos (ctx )
58
58
if err != nil {
59
59
return fmt .Errorf ("all todos: %w" , err )
@@ -73,7 +73,7 @@ func (f *Finder) Create(ctx context.Context) error {
73
73
return nil
74
74
}
75
75
76
- func (f * Finder ) createIssue (ctx context.Context , todo Todo ) error {
76
+ func (f * TechnicalDebtFinder ) createIssue (ctx context.Context , todo Todo ) error {
77
77
org , repo , ok := f .git .OrgAndRepo ()
78
78
if ! ok {
79
79
return fmt .Errorf ("git org and repo" )
@@ -89,7 +89,7 @@ func (f *Finder) createIssue(ctx context.Context, todo Todo) error {
89
89
return nil
90
90
}
91
91
92
- func (f * Finder ) seenIssues (ctx context.Context ) (map [string ]bool , error ) {
92
+ func (f * TechnicalDebtFinder ) seenIssues (ctx context.Context ) (map [string ]bool , error ) {
93
93
org , repo , ok := f .git .OrgAndRepo ()
94
94
if ! ok {
95
95
return nil , fmt .Errorf ("git org and repo" )
@@ -113,8 +113,8 @@ func (f *Finder) seenIssues(ctx context.Context) (map[string]bool, error) {
113
113
return seen , nil
114
114
}
115
115
116
- func (f * Finder ) allTodos (ctx context.Context ) ([]Todo , error ) {
117
- prefix , err := f .prefix (ctx )
116
+ func (f * TechnicalDebtFinder ) allTodos (ctx context.Context ) ([]Todo , error ) {
117
+ prefix , err := f .embedPrefix (ctx )
118
118
if err != nil {
119
119
return nil , fmt .Errorf ("prefix: %w" , err )
120
120
}
@@ -139,7 +139,7 @@ func (f *Finder) allTodos(ctx context.Context) ([]Todo, error) {
139
139
return todos , nil
140
140
}
141
141
142
- func (f * Finder ) prefix (ctx context.Context ) (string , error ) {
142
+ func (f * TechnicalDebtFinder ) embedPrefix (ctx context.Context ) (string , error ) {
143
143
org , repo , ok := f .git .OrgAndRepo ()
144
144
if ! ok {
145
145
return "" , fmt .Errorf ("git org and repo" )
@@ -149,6 +149,6 @@ func (f *Finder) prefix(ctx context.Context) (string, error) {
149
149
return "" , fmt .Errorf ("git history: %w" , err )
150
150
}
151
151
// example: https://github.com/databrickslabs/ucx/blob/69a0cf8ce3450680dc222150f500d84a1eb523fc/src/databricks/labs/ucx/azure/access.py#L25-L35
152
- prefix := fmt .Sprintf ("https://github.com/%s/%s/blob /%s" , org , repo , commits [0 ].Sha )
152
+ prefix := fmt .Sprintf ("https://github.com/%s/%s/blame /%s" , org , repo , commits [0 ].Sha )
153
153
return prefix , nil
154
154
}
0 commit comments