-
Notifications
You must be signed in to change notification settings - Fork 104
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-1557) Detect Control Repositories #826
(PDK-1557) Detect Control Repositories #826
Conversation
lib/pdk/control_repo.rb
Outdated
elsif in_control_repo_root?(Dir.pwd) | ||
Dir.pwd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are requiring an environment.conf
to be present to consider something a control-repo, what additional benefit does this branch get us versus the find_upwards
search? (find_upwards
checks in pwd
first before moving up the tree)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in_control_repo_root?
looks for things that like like a control repo (e.g. Puppetfile) whereas this method looks for something explicit. TBH this is mostly a copy-paste from the module detection.
I'm still in two minds about the whole explicit vs fuzzy search. The docs clearly state that "environment.conf" == Control Repo and Puppet itself will error if it's not present. Whereas in module land, Puppet will use a directory without a metadata.json happily, but we prefer a metadata.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rodjek Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a chat with @rodjek. And while non-directory based environment control repos do exist, they are not the preferred way. Also detecting them is problematic as they don't have an easily identifiable thing to search for.
So for this PR find_control_repo_root
will look for environment.conf whereas control_repo_root?
will look for something that could be a control repo. Use cases:
find_control_repo_root
would be used in apdk validate
operationcontrol_repo_root?
would be used in apdk convert
operation
bcf66e0
to
565f88d
Compare
Previously the PDK treats everything as a module. This commit begins the work to add Control Repo support by detecting Control Repositories and Bolt Project directories.
565f88d
to
03adc8f
Compare
@scotje Ready for review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woo, looks good @glennsarti!
Previously the PDK treated everything as a module. This commit begins the work
to add Control Repo support by detecting Control Repositories and Bolt Project
directories.