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

(GH-874) Use PDK Context root for PDK Convert and Update #877

Merged
merged 1 commit into from
Apr 1, 2020

Conversation

glennsarti
Copy link
Contributor

@glennsarti glennsarti commented Mar 27, 2020

Fixes #874

Blocking until #872 is merged due to possible merge conflicts

Previously the pdk update and convert CLI commands had a strange failure mode
where if a "module" was nested inside another "module" but only the parent had
a metadata.json. When a user tried to update or convert the child module, the
files would be put in the parent. This was due to the CLI using the lax
detection (in_module_root?) method to "find" the module, but use the strict
detection method (module_root) during the actual conversion.

This commit updates these CLI logic to use the new PDK.context object which
is far more consistent. This commit also adds a test for these scenarios in
PDK update and convert.

@glennsarti glennsarti requested a review from a team as a code owner March 27, 2020 07:12
@glennsarti glennsarti added this to the April 2020 milestone Mar 27, 2020
@coveralls
Copy link

coveralls commented Mar 27, 2020

Coverage Status

Coverage remained the same at 91.204% when pulling 351b3af on glennsarti:gh874-moduleroot into 9fd0f37 on puppetlabs:master.

lib/pdk/cli/convert.rb Outdated Show resolved Hide resolved
lib/pdk/cli/update.rb Outdated Show resolved Hide resolved
Previously the pdk update and convert CLI commands had a strange failure mode
where if a "module" was nested inside another "module" but only the parent had
a metadata.json. When a user tried to update or convert the child module, the
files would be put in the parent.  This was due to the CLI using the lax
detection (in_module_root?) method to "find" the module, but use the strict
detection method (module_root) during the actual conversion.

This commit updates these CLI logic to use the new PDK.context object which
is far more consistent.  This commit also adds a test for these scenarios in
PDK update and convert.
@glennsarti glennsarti merged commit 32acf24 into puppetlabs:master Apr 1, 2020
@scotje scotje added bug and removed blocked labels May 12, 2020
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.

'pdk convert' of a module that's inside a control repo adds boilerplate to the control repo
4 participants