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

Add `hab pkg list` command #5790

Merged
merged 4 commits into from Nov 2, 2018

Conversation

Projects
None yet
4 participants
@jamesc
Contributor

jamesc commented Oct 29, 2018

Added a simple package listing command. You can list:

  • all packages
  • an origin
  • a specific package identifier. If this has no release (or version)
    it will list all packages which match

Signed-off-by: James Casey james@chef.io

Examples:

  • List all packages
azure-habitat-example/mysql/5.7.17/20180705230519
azure-habitat-example/osba-mysql-proxy/0.1.0/20180706000536
azure-habitat-example/osba-mysql-proxy/0.1.1/20180709202012
azure-habitat-example/wordpress/4.9.5/20180705230516
azure-habitat-example/wordpress/4.9.5/20180807195958
core/acl/2.2.52/20180608091922
core/attr/2.4.47/20161208223238
core/attr/2.4.47/20170513213059
core/attr/2.4.47/20180608091914
core/busybox-static/1.28.1/20180608102729
core/bzip2/1.0.6/20180608091727
core/cacerts/2018.03.07/20180608102212
core/coreutils/8.29/20180608092141
core/curl/7.54.1/20180608142121
core/db/5.3.28/20180608094030
core/docker/18.03.0/20180608150948
core/gawk/4.2.0/20180608093856
core/gcc-libs/5.2.0/20161208223920
core/gcc-libs/5.2.0/20170513212920
core/gcc-libs/7.3.0/20180608091701
core/gdbm/1.14.1/20180608094002
core/glibc/2.22/20160612063629
core/glibc/2.22/20170513201042
core/glibc/2.27/20180608041157
core/gmp/6.1.2/20180608051426
core/grep/3.1/20180608092809
core/hab/0.65.0/20181004215832
core/hab-pkg-export-docker/0.65.0/20181004222735
core/hab-studio/0.65.0/20181004221345
core/inetutils/1.9.4/20180608094116
core/jq-static/1.10/20160909011845
core/kubectl/1.9.6/20180609041406
core/less/530/20180608094202
core/libcap/2.25/20180608091936
core/libedit/3.1.20150325/20180608184640
core/libjpeg-turbo/1.5.0/20180608183037
core/libpng/1.6.21/20180608142039
core/libpng/1.6.35/20180717232103
core/libxml2/2.9.6/20180608141053
core/linux-headers/4.15.9/20180608041107
core/linux-headers/4.3/20160612063537
core/linux-headers/4.3/20170513200956
core/mpfr/4.0.1/20180608051629
core/mysql-client/5.7.21/20180608165812
core/ncurses/6.0/20161213233720
core/ncurses/6.0/20170513213009
core/ncurses/6.1/20180608091810
core/nghttp2/1.31.0/20180608142107
core/nginx/1.13.10/20180609041552
core/nginx/1.15.2/20180731172406
core/openssl/1.0.2n/20180608102213
core/pcre/8.41/20180608092740
core/perl/5.26.1/20180608094208
core/php/7.1.4/20180627180032
core/php/7.1.4/20180717232729
core/procps-ng/3.3.12/20180608092056
core/readline/6.3.8/20161213234107
core/readline/6.3.8/20170513213506
core/readline/7.0.3/20180608092900
core/sed/4.4/20180608091938
core/zlib/1.2.11/20180608050617
core/zlib/1.2.8/20161118033245
core/zlib/1.2.8/20170513201911
  • List an origin
hab pkg list -o azure-habitat-example
azure-habitat-example/mysql/5.7.17/20180705230519
azure-habitat-example/osba-mysql-proxy/0.1.0/20180706000536
azure-habitat-example/osba-mysql-proxy/0.1.1/20180709202012
azure-habitat-example/wordpress/4.9.5/20180705230516
azure-habitat-example/wordpress/4.9.5/20180807195958
  • list a particular Package Identifier
hab pkg list core/zlib
core/zlib/1.2.11/20180608050617
core/zlib/1.2.8/20161118033245
core/zlib/1.2.8/20170513201911
  • Error case
hab pkg list core/zlib/1.2.8/fdd/dd
error: Invalid value for '<PKG_IDENT>': 'core/zlib/1.2.8/fdd/dd' is not valid. Package identifiers have the form origin/name[/version[/release]]
@thesentinels

This comment has been minimized.

Contributor

thesentinels commented Oct 29, 2018

Thanks for the pull request! Here is what will happen next:

  1. Your PR will be reviewed by the maintainers
  2. If everything looks good, one of them will approve it, and your PR will be merged.

Thank you for contributing!

@baumanj

Some small issues, mostly UX-related. I'd be interested in @mpeck's input as far as UX consistency goes.

Show resolved Hide resolved components/hab/src/cli.rs Outdated
Show resolved Hide resolved components/hab/src/cli.rs Outdated
Show resolved Hide resolved components/hab/src/command/pkg/list.rs Outdated
Show resolved Hide resolved components/hab/src/main.rs Outdated

@jamesc jamesc force-pushed the jamesc:jc/pkg-list branch 2 times, most recently from a43b851 to ed72dab Nov 1, 2018

Show resolved Hide resolved Cargo.toml Outdated
Show resolved Hide resolved components/hab/src/command/pkg/list.rs
Show resolved Hide resolved components/hab/src/main.rs Outdated
Show resolved Hide resolved components/hab/src/main.rs Outdated
Show resolved Hide resolved components/hab/src/cli.rs

@jamesc jamesc force-pushed the jamesc:jc/pkg-list branch from ed72dab to 819f741 Nov 2, 2018

jamesc added some commits Oct 19, 2018

Add `hab pkg list` command
Added a simple package listing command.  You can list:

* all packages
* an origin
* a specific package identifier.  If this has no release (or version)
   it will list all packages which match

Signed-off-by: James Casey <james@chef.io>
Pull in new version of core repo
Signed-off-by: James Casey <james@chef.io>
More review comments: valid_origin and ListingType::from
* Added a From trait for ListingType to convert from ArgMatches.
* Caught a missing error case where I wasn't handling bad origin names

Signed-off-by: James Casey <james@chef.io>
Add {valid_origin} to all commands taking origins
Signed-off-by: James Casey <james@chef.io>

@jamesc jamesc force-pushed the jamesc:jc/pkg-list branch from 819f741 to 5f6bc49 Nov 2, 2018

@baumanj

baumanj approved these changes Nov 2, 2018

@jamesc jamesc merged commit a8815f9 into habitat-sh:master Nov 2, 2018

4 checks passed

DCO This commit has a DCO Signed-off-by line
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
expeditor/config-validation Validated your Expeditor config file
Details

@jamesc jamesc deleted the jamesc:jc/pkg-list branch Nov 2, 2018

chef-ci added a commit that referenced this pull request Nov 2, 2018

Update CHANGELOG.md with details from pull request #5790
Obvious fix; these changes are the result of automation not creative thinking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment