Skip to content
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

feat(generate-registry): enable deep by default #1977

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/cli/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (runner *Runner) setParam(c *cli.Context, commandName string, param *config
param.MaxParallelism = config.GetMaxParallelism(os.Getenv("AQUA_MAX_PARALLELISM"), logE)
param.GlobalConfigFilePaths = finder.ParseGlobalConfigFilePaths(os.Getenv("AQUA_GLOBAL_CONFIG"))
param.Deep = c.Bool("deep")
param.DeepAuto = commandName == "generate-registry" && !c.IsSet("deep")
param.Pin = c.Bool("pin")
wd, err := os.Getwd()
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/config/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ type Param struct {
SelectVersion bool
ProgressBar bool
Deep bool
DeepAuto bool
SkipLink bool
Pin bool
Prune bool
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/generate-registry/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (ctrl *Controller) GenerateRegistry(ctx context.Context, param *config.Para
}

func (ctrl *Controller) genRegistry(ctx context.Context, param *config.Param, logE *logrus.Entry, pkgName string) error {
pkgInfo, versions := ctrl.getPackageInfo(ctx, logE, pkgName, param.Deep)
pkgInfo, versions := ctrl.getPackageInfo(ctx, logE, pkgName, param)
if param.OutTestData != "" {
if err := ctrl.testdataOutputter.Output(&output.Param{
List: listPkgsFromVersions(pkgName, versions),
Expand Down Expand Up @@ -88,7 +88,7 @@ func (ctrl *Controller) getRelease(ctx context.Context, repoOwner, repoName, ver
return release, err //nolint:wrapcheck
}

func (ctrl *Controller) getPackageInfo(ctx context.Context, logE *logrus.Entry, arg string, deep bool) (*registry.PackageInfo, []string) {
func (ctrl *Controller) getPackageInfo(ctx context.Context, logE *logrus.Entry, arg string, param *config.Param) (*registry.PackageInfo, []string) {
pkgName, version, _ := strings.Cut(arg, "@")
splitPkgNames := strings.Split(pkgName, "/")
pkgInfo := &registry.PackageInfo{
Expand All @@ -112,7 +112,7 @@ func (ctrl *Controller) getPackageInfo(ctx context.Context, logE *logrus.Entry,
} else {
pkgInfo.Description = strings.TrimRight(strings.TrimSpace(gomoji.RemoveEmojis(repo.GetDescription())), ".!?")
}
if deep && version == "" {
if param.Deep && version == "" {
return ctrl.getPackageInfoWithVersionOverrides(ctx, logE, pkgName, pkgInfo)
}
release, err := ctrl.getRelease(ctx, pkgInfo.RepoOwner, pkgInfo.RepoName, version)
Expand Down
Loading