-
Notifications
You must be signed in to change notification settings - Fork 654
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
role-name: false positives with galaxy roles (106) #1004
Comments
The user name gets added automatically. You don't name your role "me.myrole". You name it "myrole" and when it gets added to Galaxy, then it gets your name prefixed to it. |
True, e.g. https://galaxy.ansible.com/konstruktoid/hardening but then I
and use the role as in https://github.com/konstruktoid/ansible-role-hardening/blob/master/tests/test.yml#L5-L6 |
I'm not seeing what exactly ansible-lint is choking on in your code. Is it choking on the name of the folder it's running in? |
It chokes when running
generated by |
|
With ansible-lint 4.3.0 I get the same error with all of my Ansible Galaxy roles, for example coglinev3.ansible_python
Since I publish my Ansible roles on Ansible Galaxy, I name the Ansible roles locally or for testing with a CI / CD tool, such as Travis-CI, according to the Ansible Galaxy naming scheme |
same here |
The real issue here is that you are linting code from outside current repository. You should add |
I'm sorry @ssbarnea, but where does it nag about untracked Ansible code? |
Look at Anything starting with |
Updated to ansible-lint-4.3.4.dev8+g0d4142c.
|
I believe there is some misunderstanding of this issue, a legit one, I think. The updated molecule version throws an error when run in the role's parent directory and that directory is named For me, it broke several role's CI pipelines. The workaround is to add rule 106 to warn or skip list; although, it shouldn't have failed in the first place. |
The release notes for v4.3.5 says this has been fixed by #1044 . I tried the new release today, but the problem persists. (tag: @nre-ableton ) |
Someone needs to create a repository with a minimal reproduction use case for this issue. Without it we no not have a bug. |
4.3.5 is working in my projects, are you sure that you are setting |
Adding https://galaxy.ansible.com/docs/contributing/creating_role.html
Here is a very simple test to confirm the bug persists:
Please note this observation in the Galaxy documentation:
So, if I set the value of Besides, this test was working fine until 4.3.1, then it started failing from 4.3.2 and forward. This is, at least, a regression. |
Well, ansible-lint tests for a number of optional things which one should follow as a best practice. However, Ansible's documentation for role names states:
|
I think we're both getting confused with interpretation of the docs. Here's my understanding: the repo name is allowed to have a dot or a dash, in which case Galaxy will convert the dot (or dash) to underscore during the role import process. I believe that, with that being the case, ansible-lint should do the same. To be more precise, I think ansible-lint should convert the dot to underscore when the This way you will probably unblock a lot of people's CIs, without forcing them to rename their repos. I personally have at least 85 repos with dot in the name that are being affected by this bug. Renaming all these repos will create a terrible cascade effect. |
I'm just a one-time contributor to ansible-lint, so I think that @ssbarnea is in a better place to comment on the behavior. However, I sympathize with you being blocked on updating to 4.3.x on account of this behavior. Is suppressing E106 in a config file not an option for you? |
Please consider the usage of
|
Summary
106 Role name konstruktoid.hardening does not match ``^[a-z][a-z0-9_]+$`` pattern
but https://galaxy.ansible.com/docs/using/installing.html#roles states, and Ansible Galaxy is structured around, the<user>.<role>
naming scheme.Issue Type
Ansible and Ansible Lint details
pip3
, https://github.com/konstruktoid/ansible-role-hardening/blob/master/action-lint/Dockerfile#L16-L17OS / ENVIRONMENT
GitHub Actions, https://github.com/konstruktoid/ansible-role-hardening/actions
STEPS TO REPRODUCE
Run
ansible-lint
with a role name containing a.
.The text was updated successfully, but these errors were encountered: