Skip to content

oras discover should show a placeholder of artifactType if it's not presented in an index referrer #1108

Closed

Description

@qweeah

What is the version of your ORAS CLI

1.1.0

What would you like to be added?

Currently oras discover shows an empty node when artifactType if it's not presented in an index referrer, like

✗ oras discover -o tree localhost:5000/test:multi
localhost:7000/command/artifacts@sha256:e2bfc9cc6a84ec2d7365b5a28c6bc5806b7fa581c9ad7883be955a64e3cc034f
├── referrer/index
│   └── sha256:d37baf66300b9006b0f4c7102075d56b970fbf910be5c6bca07fdbb000dfa383
└── 
    └── sha256:7679bc22c33b87aa345c6950a993db98a6df7a6cc77a35c388908a3

Should use a placeholder for the empty artifactType, like <nil> since fmt.Println(nil) prints <nil>

✗ oras discover -o tree localhost:5000/test:multi
localhost:7000/command/artifacts@sha256:e2bfc9cc6a84ec2d7365b5a28c6bc5806b7fa581c9ad7883be955a64e3cc034f
├── referrer/index
│   └── sha256:d37baf66300b9006b0f4c7102075d56b970fbf910be5c6bca07fdbb000dfa383
└── <nil>
    └── sha256:7679bc22c33b87aa345c6950a993db98a6df7a6cc77a35c388908a3

Why is this needed for ORAS?

Showing an empty node makes no sense and will confuse our user.

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.

Activity

  1. added
    enhancement
    on Sep 7, 2023
  2. added this to the v1.2.0 milestone on Sep 7, 2023
  3. Wwwsylvia commented on Sep 7, 2023

    @Wwwsylvia
    Member

    <nil> makes me feel like the node is nil, but not artifactType is nil.
    How about something like <unknown> or <unknown artifact>?

    $ oras discover -o tree localhost:5000/test:multi
    localhost:7000/command/artifacts@sha256:e2bfc9cc6a84ec2d7365b5a28c6bc5806b7fa581c9ad7883be955a64e3cc034f
    ├── referrer/index
    │   └── sha256:d37baf66300b9006b0f4c7102075d56b970fbf910be5c6bca07fdbb000dfa383
    └── <unknown>
        └── sha256:7679bc22c33b87aa345c6950a993db98a6df7a6cc77a35c388908a3
  4. added
    ux
    on Sep 12, 2023
  5. modified the milestones: v1.2.0, v1.3.0 on Jan 23, 2024
  6. wangxiaoxuan273 commented on Apr 8, 2024

    @wangxiaoxuan273
    Contributor

    I'd like to work on this item

  7. modified the milestones: v1.3.0, v1.2.0 on Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementux

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions