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

search manifests outside of manifests directory #104

Closed
Dan33l opened this issue Feb 10, 2019 · 11 comments
Closed

search manifests outside of manifests directory #104

Dan33l opened this issue Feb 10, 2019 · 11 comments
Labels
bug Something isn't working wontfix

Comments

@Dan33l
Copy link
Member

Dan33l commented Feb 10, 2019

The syntax check searches for all .pp files in the modules, which includes
.pp files in the spec tests of the modules like in spec/type_aliases. This can lead to errors like:

bundle exec rake syntax 
---> syntax:manifests
Attempt to redefine entity 'http://puppet.com/2016.1/runtime/type/XXX'. Originally set at file:///builds/XXX/manifests/network.pp?line=24&pos=1.
@Dan33l Dan33l added the bug Something isn't working label Feb 10, 2019
@Dan33l
Copy link
Member Author

Dan33l commented Feb 10, 2019

a bugfix was released #100 but reverted #102

@alexjfisher
Copy link
Member

@baurmatt I reverted the previous fix after I saw it broke your (and probably many others) workflows. Would you be able to help @Dan33l in finding a solution that works for all?

@Dan33l Could you provide as much detail as possible? Example repo(s) etc so that everybody can reproduce your error?

@baurmatt
Copy link
Contributor

Sure! :) @Dan33l If you can provide examples, I'm happy to take a look!

@Dan33l
Copy link
Member Author

Dan33l commented Feb 11, 2019

I will provides details as soon as possible.

@rjw1
Copy link
Member

rjw1 commented Feb 11, 2019

I might be missing something but could you not set an exclude path in the config.
PuppetSyntax.exclude_paths = ["vendor/**/*"]

@Dan33l
Copy link
Member Author

Dan33l commented Feb 11, 2019

I used pdk to build details and reproduce here: https://gitlab.adullact.net/fcombernous/dummy

The pipeline output https://gitlab.adullact.net/fcombernous/dummy/-/jobs/9675
bundle exec rake syntax is enough to fail.

edit : now it works .. but i don't know why. let me search.

edit2 : ah now it fails. since i added a defined type. So perhaps my usage is wrong.

@Dan33l
Copy link
Member Author

Dan33l commented Feb 11, 2019

well, it looks that the defined type dummy::network and the custom data type Dummy::Network can overlap.

@baurmatt
Copy link
Contributor

Hmm is having a define type and a data type with the same name valid?

@Dan33l
Copy link
Member Author

Dan33l commented Feb 11, 2019

I used the #office-hours to ask about this. I got the following answer :

I would advise against it. I’m not sure it would cause any errors directly, but it’s best to avoid confusion if possible

@hlindberg
Copy link

@baurmatt It is illegal to have a data type with the same name as a resource type (user defined or in ruby) - this because every resource type is also a data type alias.
At runtime, the language handles this by the rule "any referenced non existing data type is a reference to a resource type" and that depends on the order of evaluation.

@Dan33l
Copy link
Member Author

Dan33l commented Feb 11, 2019

@hlindberg thank you for the answer.

I suppose we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix
Projects
None yet
Development

No branches or pull requests

5 participants