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

Minor changes to the download cmd in handling the context path and bug fixes #128

Merged
merged 4 commits into from
Jul 21, 2022

Conversation

michael-valdron
Copy link
Member

@michael-valdron michael-valdron commented Jul 14, 2022

Signed-off-by: Michael Valdron mvaldron@redhat.com

Please specify the area for this PR
registry library

What does does this PR do / why we need it:

Recently added in PR #126, the registry download command downloads and extracts a starter project to a given context path (default .). At this time, it will create a sub-directory under the context path to extract the starter project contents to, however, it would be more useful and consistent with registry pull to extract the contents directly into the context path itself which is what this PR intents to provide.

After this change, one can still create a sub-directory by specifying --context=./<subdirectory_name>.

Other Changes:

  • Bug fix to DownloadStarterProjectAsDir extract ZipSlip check, if the entire resultant file path is the just the file name (no directory prefix) do not perform check.
    • Without this fix the function will error in all cases of using the relative path to the present working directory ..
  • Bug fix to DownloadStarterProjectAsBytes not downloading correctly if base registry url ends with /

Which issue(s) this PR fixes:

Fixes #?

fixes devfile/api#892
fixes devfile/api#895

PR acceptance criteria:

  • Test (WIP)

Documentation (WIP)

How to test changes / Special notes to the reviewer:

…self instead of a subdirectory.

Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
@michael-valdron michael-valdron changed the title Minor change to the download cmd in handling the context path Minor changes to the download cmd in handling the context path and bug fixes Jul 19, 2022
Copy link
Member

@johnmcollier johnmcollier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good. Do we need to add test cases for the bugfixes, or are the updates sufficient?

@michael-valdron
Copy link
Member Author

Generally looks good. Do we need to add test cases for the bugfixes, or are the updates sufficient?

@johnmcollier Oh you mean test cases which say for example test that https://registry.devfile.io and https://registry.devfile.io/ work the same or context = . does not error?

Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2022
@openshift-ci
Copy link

openshift-ci bot commented Jul 21, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnmcollier, michael-valdron

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 21, 2022
@michael-valdron michael-valdron merged commit f017dd1 into devfile:main Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
2 participants