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

Add internal_names rule which flags usage of internal names in collections that must not be used #2572

Closed
wants to merge 15 commits into from

Conversation

felixfontein
Copy link
Contributor

For example, the FQCNs community.general.system.sudoers and community.network.network.edgeos.edgeos_facts should never be used for actions, since they are internal to the collection and can even change in bugfix releases.

@felixfontein
Copy link
Contributor Author

The cisco.nxos eco failures are unrelated, they have been failing for a couple of days now (at least since 6.8.0 has been released).

@ssbarnea
Copy link
Member

ssbarnea commented Oct 9, 2022

That is really interesting because we had a chat last week with others related the same question: which form should be considered the normalized one. In our context it was more about which auto-complete value should be advertised by our language server, as we clearly wanted to avoid showing duplicates.

  1. value exposed by collection metadata
  2. location on disk (can be a symlink)
  3. resolved/effective location from disk (not a disk location), which is the deeper.
  4. targeted location from ansible internal redirects

My impression was that "3" was the winning option and that is exactly the opposite of this rule.

I need to ping @bcoca @sivel @cidrblock @ganeshrn for input on this as we want to be sure we give only one recommendation everywhere, at least one recommendation for specific environment obviously, as collection version and ansible own version might impact that.

@ssbarnea ssbarnea added the feedback-needed Divergent oppinions, additional feedback is desired in order to unblock it. label Oct 9, 2022
@sivel
Copy link
Member

sivel commented Oct 10, 2022

The fact that a few collections have decided that their use of subdirectories is not a feature, and are not subject to backwards compat sounds like the exception to the rule, and not a general recommendation. I'd actually state that the decision by these collections to not consider the real FQCN a feature, and not subject to backwards compat is the real bug here. If a collection were to move a plugin from a subdir, it should be adding redirections with deprecations.

There are use cases where this could be preferred even, and seeing as though this is an actual feature of ansible-core, we should not discourage its use.

@bcoca
Copy link
Member

bcoca commented Oct 10, 2022

To clarify 'internal names' is not a feature in ansible-core, we allow 'aliases', for many reasons (rename/moves, deprecation, etc) and this is a generic feature for all collections. The 'canonical' name for a plugin should be the name that it resolves to when loading, while the rest of names are either intermediate or parallel loading paths.

ssbarnea added a commit to ssbarnea/ansible-lint that referenced this pull request Oct 15, 2022
ssbarnea added a commit to ssbarnea/ansible-lint that referenced this pull request Oct 25, 2022
ssbarnea added a commit to ssbarnea/ansible-lint that referenced this pull request Oct 25, 2022
ssbarnea added a commit that referenced this pull request Oct 25, 2022
ssbarnea added a commit to ssbarnea/ansible-lint that referenced this pull request Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback-needed Divergent oppinions, additional feedback is desired in order to unblock it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants