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

Fully qualified package names download irrespective of channel #7108

Merged
merged 1 commit into from Oct 25, 2019

Conversation

@markan
Copy link
Contributor

markan commented Oct 24, 2019

Fix for hab 7039

When hab pkg download is provided a fully-qualified identifier, it
will fail if that package isn't in the stable channel. In other words
we would need to provide a channel that contains the package on the
command line. That's a departure from other CLI commands since a
fully-qualified identifier is enough to find a package regardless of
what channel it might be in.

This adds a function show_package_metadata_for_fully_qualified_ident
to the builder-api-client. In the download command implementation test
for a fully qualified ident and use the appropriate call.

An alternative implementation would be to modify the
show_package_metadata function to ignore the channel and use a
different rest endpoint if the package was fully qualified, but that
might create opaque errors and regressions.

Signed-off-by: Mark Anderson mark@chef.io

@chefsalim

This comment has been minimized.

Copy link
Member

chefsalim commented Oct 24, 2019

@markan I think this may be overkill. We should just be able to check for a fully qualified ident in determine_latest_from_ident and use the unstable channel when calling fetch_latest_package_in_channel_for. That should be only a few lines of change to handle this case.

@markan

This comment has been minimized.

Copy link
Contributor Author

markan commented Oct 24, 2019

We should just be able to check for a fully qualified ident in determine_latest_from_ident and use the unstable channel when calling fetch_latest_package_in_channel_for.
I wasn't sure if that was a guaranteed property or not; I take it every package is in unstable?

@chefsalim

This comment has been minimized.

Copy link
Member

chefsalim commented Oct 25, 2019

Yep, every package is guaranteed to be in unstable

@chefsalim

This comment has been minimized.

Copy link
Member

chefsalim commented Oct 25, 2019

Here's a sample snippet of how we're using that pattern to grab info on a fully qualified ident - https://github.com/habitat-sh/habitat/blob/master/components/builder-api-client/src/builder.rs#L734

Copy link
Member

chefsalim left a comment

Fix for hab 7039

When hab pkg download is provided a fully-qualified identifier, it
will fail if that package isn't in the stable channel. In other words
we would need to provide a channel that contains the package on the
command line.  That's a departure from other CLI commands since a
fully-qualified identifier is enough to find a package regardless of
what channel it might be in.

Signed-off-by: Mark Anderson <mark@chef.io>
@markan markan force-pushed the ma/hab_7039/respect_fully_qualified_ident branch from 0786448 to c45b3fe Oct 25, 2019
@markan markan merged commit 8ce9028 into master Oct 25, 2019
5 checks passed
5 checks passed
DCO This commit has a DCO Signed-off-by
Details
buildkite/habitat-sh-habitat-master-verify Build #3941 passed (33 minutes, 2 seconds)
Details
buildkite/habitat-sh-habitat-master-website Build #1021 passed (39 seconds)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
expeditor/config-validation Validated your Expeditor config file
Details
@chef-expeditor chef-expeditor bot deleted the ma/hab_7039/respect_fully_qualified_ident branch Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.