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

Enhancement: kpm add command displaying optimization #123

Closed
zong-zhe opened this issue Jul 6, 2023 · 1 comment · Fixed by #126, #127, #129, #130 or #131
Closed

Enhancement: kpm add command displaying optimization #123

zong-zhe opened this issue Jul 6, 2023 · 1 comment · Fixed by #126, #127, #129, #130 or #131
Assignees
Labels
enhancement New feature or request

Comments

@zong-zhe
Copy link
Contributor

zong-zhe commented Jul 6, 2023

kpm add displaying optimization

The content of the output information is different in different modes.

<debug_info> represents more detailed output information. For more information, see #124.

1. Download successfully

$ kpm add k8s
kpm: adding dependency k8s
kpm: the latest version 1.27.2 will be pulled from 'oci://ghcr.io/xx/k8s'.
kpm: add dependency successfully.
$ kpm add k8s:1.27.2
kpm: adding dependency k8s with version 1.27.2.
kpm: the 'k8s' will be pulled from 'oci://ghcr.io/xx/k8s'.
kpm: add dependency successfully.

2. Current directory is not a kcl package.

$ kpm add k8s
kpm: could not find `kcl.mod` in '/xxx/xxx'. <debug_info>

3. kcl.mod parsing error

$ kpm add k8s
kpm: failed to load the 'xxx/xxx/kcl.mod'. <debug_info>

4. kcl.mod.lock parsing error

This file should be generated automatically, if parsing error occurs, delete and regenerate it.

5. Failed to load global configuration

The kpm add needs to download, so it needs to load the global configuration for kpm.

Failed to load user login information configuration.

$ kpm add k8s
kpm: failed to load credentials file '/xx/xx/config.json', <debug_info>

Failed to load registry information.

$ kpm add k8s
kpm: failed to load '/xxx/xxx/xxx/config.json', <debug_info>

6. failed to download

$ kpm add k8s
kpm: adding dependency k8s with version 1.27.2.
kpm: the 'k8s' will be pulled from 'oci://ghcr.io/xx/k8s'.
kpm: failed to add dependency, cannot download 'k8s:1.27.2' from 'oci://ghcr.io/xx/k8s'. <debug_info>

7. After downloading, checksum check error.

$ kpm add k8s
kpm: adding dependency k8s with version 1.27.2.
kpm: the 'k8s' will be pulled from 'oci://ghcr.io/xx/k8s'.
kpm: failed to add dependency, checksum for `k8s` changed in lock file. <debug_info>

8. After downloading, failed to update kcl.mod

$ kpm add k8s
kpm: adding dependency k8s with version 1.27.2.
kpm: the 'k8s' will be pulled from 'oci://ghcr.io/xx/k8s'.
kpm: failed to update the package info into 'xxx/xxx/xxx/kcl.mod'. <debug_info>

9. After downloading, failed to update kcl.mod.lock

$ kpm add k8s
kpm: adding dependency k8s with version 1.27.2.
kpm: the 'k8s' will be pulled from 'oci://ghcr.io/xx/k8s'.
kpm: failed to update the package info into 'xxx/xxx/xxx/kcl.mod.lock'." <debug_info>
@zong-zhe zong-zhe added the enhancement New feature or request label Jul 6, 2023
@zong-zhe zong-zhe added this to the v0.2.5 Release milestone Jul 6, 2023
@zong-zhe zong-zhe self-assigned this Jul 6, 2023
@zong-zhe zong-zhe changed the title Enhancement: kpm add command displaying optimization [WIP]Enhancement: kpm add command displaying optimization Jul 6, 2023
@zong-zhe zong-zhe changed the title [WIP]Enhancement: kpm add command displaying optimization Enhancement: kpm add command displaying optimization Jul 6, 2023
@amyXia1994
Copy link

Provide more perspective message, For example:

  • kpm: failed to load credentials file '/xx/xx/config.json: -> Incomplete user login configuration. failed to load credentials file '/xx/xx/config.json

When an error occurred, it's better to provide more information about how to fix it. For example:

  • kpm: could not find kcl.mod in '/xxx/xxx'. <debug_info>: + run kpm init to generate a kcl.mod file
  • kpm: failed to load credentials file '/xx/xx/config.json: -> failed to load credentials file '/xx/xx/config.json. Please

@zong-zhe zong-zhe reopened this Jul 17, 2023
@zong-zhe zong-zhe reopened this Jul 18, 2023
@zong-zhe zong-zhe reopened this Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment