@@ -13,7 +13,7 @@ import (
1313 "github.com/databrickslabs/sandbox/go-libs/github"
1414)
1515
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 ) {
1717 fs , err := fileset .RecursiveChildren (root )
1818 if err != nil {
1919 return nil , fmt .Errorf ("fileset: %w" , err )
@@ -35,14 +35,14 @@ func New(ctx context.Context, gh *github.GitHubClient, root string) (*Finder, er
3535 if err != nil {
3636 return nil , fmt .Errorf ("git: %w" , err )
3737 }
38- return & Finder {
38+ return & TechnicalDebtFinder {
3939 fs : scope ,
4040 git : checkout ,
4141 gh : gh ,
4242 }, nil
4343}
4444
45- type Finder struct {
45+ type TechnicalDebtFinder struct {
4646 fs fileset.FileSet
4747 git * git.Checkout
4848 gh * github.GitHubClient
@@ -53,7 +53,7 @@ type Todo struct {
5353 link string
5454}
5555
56- func (f * Finder ) Create (ctx context.Context ) error {
56+ func (f * TechnicalDebtFinder ) CreateIssues (ctx context.Context ) error {
5757 todos , err := f .allTodos (ctx )
5858 if err != nil {
5959 return fmt .Errorf ("all todos: %w" , err )
@@ -73,7 +73,7 @@ func (f *Finder) Create(ctx context.Context) error {
7373 return nil
7474}
7575
76- func (f * Finder ) createIssue (ctx context.Context , todo Todo ) error {
76+ func (f * TechnicalDebtFinder ) createIssue (ctx context.Context , todo Todo ) error {
7777 org , repo , ok := f .git .OrgAndRepo ()
7878 if ! ok {
7979 return fmt .Errorf ("git org and repo" )
@@ -89,7 +89,7 @@ func (f *Finder) createIssue(ctx context.Context, todo Todo) error {
8989 return nil
9090}
9191
92- func (f * Finder ) seenIssues (ctx context.Context ) (map [string ]bool , error ) {
92+ func (f * TechnicalDebtFinder ) seenIssues (ctx context.Context ) (map [string ]bool , error ) {
9393 org , repo , ok := f .git .OrgAndRepo ()
9494 if ! ok {
9595 return nil , fmt .Errorf ("git org and repo" )
@@ -113,8 +113,8 @@ func (f *Finder) seenIssues(ctx context.Context) (map[string]bool, error) {
113113 return seen , nil
114114}
115115
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 )
118118 if err != nil {
119119 return nil , fmt .Errorf ("prefix: %w" , err )
120120 }
@@ -139,7 +139,7 @@ func (f *Finder) allTodos(ctx context.Context) ([]Todo, error) {
139139 return todos , nil
140140}
141141
142- func (f * Finder ) prefix (ctx context.Context ) (string , error ) {
142+ func (f * TechnicalDebtFinder ) embedPrefix (ctx context.Context ) (string , error ) {
143143 org , repo , ok := f .git .OrgAndRepo ()
144144 if ! ok {
145145 return "" , fmt .Errorf ("git org and repo" )
@@ -149,6 +149,6 @@ func (f *Finder) prefix(ctx context.Context) (string, error) {
149149 return "" , fmt .Errorf ("git history: %w" , err )
150150 }
151151 // 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 )
153153 return prefix , nil
154154}
0 commit comments