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

(PDK-1556) Use the module root when generating objects #824

Merged
merged 2 commits into from
Jan 13, 2020

Conversation

glennsarti
Copy link
Contributor

Previously the pdk new command used the current directory as the module root
which caused errors when users executed pdk new when deep inside a module.
This commit changes the CLI to use the actual module root when creating the
generators, and updates the tests for this scenario.

@glennsarti glennsarti requested a review from a team as a code owner January 8, 2020 02:08
@coveralls
Copy link

coveralls commented Jan 8, 2020

Coverage Status

Coverage increased (+0.04%) to 91.457% when pulling 3c1f970 on glennsarti:pdk-1556-pdk-new-root into 0f10a13 on puppetlabs:master.

Previously the `pdk new` command used the current directory as the module root
which caused errors when users executed `pdk new` when deep inside a module.
This commit changes the CLI to use the actual module root when creating the
generators, and updates the tests for this scenario.
Previously the module convert and update operations always assumed the user was
in the module root.  This caused many files to be erronously added to modules if
the operation was started deep within the module.

This commit changes the update and convert classes to accept a module_dir
parameter which explicitly tells the converter/updater where the module root is
so that it can make better decisions on module information (e.g. metadata or
spec files)

This commit also updates the tests for the new required parameter.
@glennsarti
Copy link
Contributor Author

This PR does change the output of pdk convert and pdk update to now display the full path to the user, instead of just the relative path to current directory.

@glennsarti glennsarti merged commit 89917ad into puppetlabs:master Jan 13, 2020
@rodjek rodjek added this to the 1.16.0 milestone Feb 3, 2020
@rodjek rodjek added bug feature and removed bug labels Feb 5, 2020
@glennsarti glennsarti deleted the pdk-1556-pdk-new-root branch March 5, 2020 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants