-
Notifications
You must be signed in to change notification settings - Fork 110
feat(cli): make quickstart catalog repository configurable via --catalog-repo flag #6364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sachin9058
wants to merge
15
commits into
mindersec:main
Choose a base branch
from
sachin9058:feat/quickstart-configurable-repo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ddf58be
feat(cli): make quickstart catalog repository configurable via --cata…
sachin9058 9971fda
lint-fixed
sachin9058 726c1ef
refactor(cli): move catalog clone logic to internal/cli and decouple …
sachin9058 b1766e1
feat(cli): implement filesystem-driven catalog loading and validation…
sachin9058 05441ff
Merge upstream/main into feat/quickstart-configurable-repo
sachin9058 e9718ac
refactor(cli): align quickstart catalog loading with review feedback
sachin9058 0891c99
refactor(cli): reuse fileconvert resources loader and align catalog l…
sachin9058 ece5e51
chore(cli): fix lint issues and polish catalog loading implementation
sachin9058 55781c9
Merge branch 'main' into feat/quickstart-configurable-repo
sachin9058 a061c15
test(cli): add coverage for catalog validation edge cases
sachin9058 e726e90
Add SPDX header to catalog tests
sachin9058 98da8a5
fix(fileconvert): preserve path resolution behavior for OS-backed dec…
sachin9058 30279ec
Merge branch 'test/catalog-loading-v2' into feat/quickstart-configura…
sachin9058 2c0dc21
test(cli): add table-driven tests for catalog validation and integrat…
sachin9058 3e604df
Merge branch 'main' into feat/quickstart-configurable-repo
sachin9058 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // SPDX-FileCopyrightText: Copyright 2023 The Minder Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| // Package cli contains reusable CLI helper logic for catalog operations | ||
| package cli | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "github.com/go-git/go-billy/v5" | ||
| git "github.com/go-git/go-git/v5" | ||
| "github.com/go-git/go-git/v5/storage/memory" | ||
| ) | ||
|
|
||
| // CloneRepoFilesystem clones the given Git repository URL into an in-memory | ||
| // storage and returns its filesystem. Callers can use the returned | ||
| // filesystem to open files and traverse directories without touching disk. | ||
| func CloneRepoFilesystem(repoURL string) (billy.Filesystem, error) { | ||
| repo, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{ | ||
| URL: repoURL, | ||
| Depth: 1, | ||
| }) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to clone repository %s: %w", repoURL, err) | ||
| } | ||
|
|
||
| worktree, err := repo.Worktree() | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to get worktree for %s: %w", repoURL, err) | ||
| } | ||
|
|
||
| return worktree.Filesystem, nil | ||
| } | ||
|
sachin9058 marked this conversation as resolved.
Outdated
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.