From f78c1e28131e093a31a76cd72ab381f3821bf19d Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 18 Sep 2022 16:33:10 +0200 Subject: [PATCH 1/4] with query results --- cmd/kraken/commands/process.go | 28 ++++++++++++++++++++++++---- scripts/run_client.sh | 5 ++++- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/cmd/kraken/commands/process.go b/cmd/kraken/commands/process.go index 91bd822..89434a9 100644 --- a/cmd/kraken/commands/process.go +++ b/cmd/kraken/commands/process.go @@ -9,9 +9,19 @@ import ( ) func CreateKrakenProcessCmd() *cobra.Command { + + var ( + actionsRepo string + branch string + path string + ) cmd := &cobra.Command{ Use: "process", - Run: func(cmd *cobra.Command, _ []string) { + RunE: func(cmd *cobra.Command, args []string) error { + if err := cmd.ParseFlags(args); err != nil { + return err + } + client := http.Client{} var buf bytes.Buffer @@ -21,9 +31,9 @@ func CreateKrakenProcessCmd() *cobra.Command { Branch string `json:"branch"` Path string `json:"path"` }{ - Repository: "git@git.front.kjuulh.io:kjuulh/kraken.git", - Branch: "feature/query-results", - Path: "_examples/queries/scrape_readme/", + Repository: actionsRepo, + Branch: branch, + Path: path, }) if err != nil { panic(err) @@ -46,8 +56,18 @@ func CreateKrakenProcessCmd() *cobra.Command { if resp.StatusCode >= 300 { panic(resp.Status) } + + return nil }, } + pf := cmd.PersistentFlags() + + pf.StringVar(&actionsRepo, "actions-repo", "", "actions repo is the location of your actions, not where to apply the actions themselves, that should be self contained") + cmd.MarkPersistentFlagRequired("actions-repo") + pf.StringVar(&branch, "branch", "main", "which branch to look for actions in, will default to main") + pf.StringVar(&path, "path", "", "the location of the path inside the repository") + cmd.MarkPersistentFlagRequired("path") + return cmd } diff --git a/scripts/run_client.sh b/scripts/run_client.sh index cfe216e..237c23d 100755 --- a/scripts/run_client.sh +++ b/scripts/run_client.sh @@ -2,4 +2,7 @@ set -e -go run cmd/kraken/kraken.go process +current_branch=$(git branch --show-current) + +go run cmd/kraken/kraken.go process --actions-repo "git@git.front.kjuulh.io:kjuulh/kraken.git" --branch "$current_branch" --path "_examples/actions/write_a_readme" +go run cmd/kraken/kraken.go process --actions-repo "git@git.front.kjuulh.io:kjuulh/kraken.git" --branch "$current_branch" --path "_examples/queries/scrape_readme" -- 2.45.2 From f65fa909b0abd82411974233bd2ef0ed78c73be5 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 18 Sep 2022 16:34:05 +0200 Subject: [PATCH 2/4] with more roadmap items --- roadmap.md | 1 + 1 file changed, 1 insertion(+) diff --git a/roadmap.md b/roadmap.md index cff2a5c..6762f82 100644 --- a/roadmap.md +++ b/roadmap.md @@ -35,6 +35,7 @@ - [ ] Make configurable git provider - [ ] Create templating function - [ ] Add way to see progress of runners +- [ ] Implement global .kraken store for easy access ## Version 1.x -- 2.45.2 From 2b7156106fbd5dbb6adc39a8d65bfcde3c2176c6 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 18 Sep 2022 16:34:28 +0200 Subject: [PATCH 3/4] and more --- roadmap.md | 1 + 1 file changed, 1 insertion(+) diff --git a/roadmap.md b/roadmap.md index 6762f82..34cf540 100644 --- a/roadmap.md +++ b/roadmap.md @@ -36,6 +36,7 @@ - [ ] Create templating function - [ ] Add way to see progress of runners - [ ] Implement global .kraken store for easy access +- [ ] Move builders to start instead of every time ## Version 1.x -- 2.45.2 From 51b79dc51a150177a744f203ddd5f36835aad4a0 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 18 Sep 2022 16:48:30 +0200 Subject: [PATCH 4/4] fixed pull again, hopefully --- internal/services/providers/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/providers/git.go b/internal/services/providers/git.go index 45ed04e..32cc1a7 100644 --- a/internal/services/providers/git.go +++ b/internal/services/providers/git.go @@ -242,7 +242,7 @@ func (g *Git) CreateBranch(ctx context.Context, gitRepo *GitRepo) error { err = worktree.PullContext(ctx, &git.PullOptions{ RemoteName: "origin", ReferenceName: "refs/heads/main", - SingleBranch: true, + SingleBranch: false, Depth: 1, Auth: auth, RecurseSubmodules: 1, -- 2.45.2