Skip to content

Commit 61aed81

Browse files
committed
..
1 parent cbab0cf commit 61aed81

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

acceptance/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (a *acceptance) syncTodos(ctx context.Context) error {
5959
if err != nil {
6060
return fmt.Errorf("tech debt: %w", err)
6161
}
62-
err = techDebt.Create(ctx)
62+
err = techDebt.CreateIssues(ctx)
6363
if err != nil {
6464
return fmt.Errorf("create: %w", err)
6565
}

acceptance/shim.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const version = 'v0.3.1';
1+
const version = 'v0.4.0';
22
const action = 'acceptance';
33

44
const { createWriteStream, chmodSync } = require('fs');

acceptance/todos/finder.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

acceptance/todos/finder_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ import (
99
)
1010

1111
func TestXXX(t *testing.T) {
12+
t.SkipNow()
1213
ctx := context.Background()
1314

1415
gh := github.NewClient(&github.GitHubConfig{})
1516
f, err := New(ctx, gh, "/Users/serge.smertin/git/labs/remorph")
1617
assert.NoError(t, err)
1718

18-
err = f.Create(ctx)
19+
err = f.CreateIssues(ctx)
1920
assert.NoError(t, err)
2021
}

0 commit comments

Comments
 (0)