question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extension suggests replacements of modules with internal implentation names

See original GitHub issue

Sanity check

  • I certify that the redhat.ansible extension is in use and the language of the document in this bug report shows up as Ansible

Summary

Here’s my main.yaml

- name: Clone/Update Guard git repo
  ansible.builtin.git:
    repo: 'https://github.com/thedevs-network/the-guard-bot.git'
    dest: /opt/the-guard-bot
    update: true

- name: Install npm
  community.general.pacman:
    name: npm
    state: present

- name: Install packages based on package.json.
  community.general.npm:
    path: /opt/the-guard-bot

running ansible-lint against it I get the following

% ansible-lint main.yaml                                                         
WARNING  Listing 1 violation(s) that are fatal
git-latest: Git checkouts must contain explicit version.
main.yaml:8 Task/Handler: Clone/Update Guard git repo

You can skip specific rules or tags by adding them to your configuration file:
# .config/ansible-lint.yml
warn_list:  # or 'skip_list' to silence them completely
  - git-latest  # Git checkouts must contain explicit version.

Finished with 1 failure(s), 0 warning(s) on 1 files.

That is fine.

However, in VSC, if I hover over community.general.pacman or community.general.npm, I get suggestions to replace them.

Use community.general.packaging.os.pacman instead.
Use community.general.packaging.language.npm instead.

The only place where I can find these mentioned is https://github.com/ansible-collections/community.general/blob/main/meta/runtime.yml#L1102

After talking with one of the community.general contributors on Matrix, it seems like it shouldn’t be a thing and is a bug

felixfontein:
  actually doing that replacement would be a REALLY BAD idea.
  community.general.packaging.os.pacman is an implementation detail that can change even in a bugfix release and leave you with something that isn't working
  you should definitely file a bug report for the plugin

Extension version

0.11.10

VS Code version

1.69.2

Ansible Version

ansible [core 2.13.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/c0rn3j/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /home/c0rn3j/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0]
  jinja version = 3.1.2
  libyaml = True

OS / Environment

Arch Linux ansible-lint 6.3.0-1

Relevant log output

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
priyamsahoocommented, Aug 16, 2022

Sorry for the delay. We will discuss this and let you know the solution/ decision.

1reaction
felixfonteincommented, Oct 10, 2022

@priyamsahoo by not treating this as a bug you are risking that your uses will suffer a lot when they have to undo all these suggestions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java 9+ modularity: The difficulties and pitfalls of migrating ...
If you use internal APIs, then jdeps might suggest replacements ... The JAR's file name (minus the .jar extension) becomes its module name, ......
Read more >
Module Composition | Terraform - HashiCorp Developer
Module composition allows infrastructure to be described from modular building blocks.
Read more >
importlib — The implementation of import — Python 3.11.1 ...
A method that returns the module object to use when importing a module. This method may return None , indicating that default module...
Read more >
Publishing Extensions - Visual Studio Code
You will see following error, if an extension name already exist in the Marketplace. ERROR The extension 'name' already exists in the Marketplace....
Read more >
Modules, introduction - The Modern JavaScript Tutorial
UMD – one more module system, suggested as a universal one, compatible with AMD and CommonJS. Now these all slowly became a part...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found