Repository: ansible/ansible
Pull request: Update pylint deprecated plugin to use ansible-invalid* symbols
##### SUMMARY
Update pylint deprecated plugin to use ansible-invalid* symbols

Fixes #77085 
##### ISSUE TYPE
- Test Pull Request

##### COMPONENT NAME
test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py

##### ADDITIONAL INFORMATION
<!--- Include additional information to help people understand the change here -->
<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->

<!--- Paste verbatim command output below, e.g. before and after your change -->
```paste below

```


Problem statement:
`deprecated` pylint plugin bug
### Summary

```
00:55   File "/root/.ansible/test/venv/sanity.pylint/3.10/1d079f27/lib/python3.10/site-packages/pylint/utils/ast_walker.py", line 74, in walk
00:55     callback(astroid)
00:55   File "/root/ansible/test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py", line 252, in visit_call
00:55     self._check_version(node, version, collection_name)
00:55   File "/root/ansible/test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py", line 175, in _check_version
00:55     self.add_message('invalid-version', node=node, args=(version,))
00:55   File "/root/.ansible/test/venv/sanity.pylint/3.10/1d079f27/lib/python3.10/site-packages/pylint/checkers/base_checker.py", line 111, in add_message
00:55     self.linter.add_message(msgid, line, node, args, confidence, col_offset)
00:55   File "/root/.ansible/test/venv/sanity.pylint/3.10/1d079f27/lib/python3.10/site-packages/pylint/message/message_handler_mix_in.py", line 222, in add_message
00:55     message_definitions = self.msgs_store.get_message_definitions(msgid)
00:55   File "/root/.ansible/test/venv/sanity.pylint/3.10/1d079f27/lib/python3.10/site-packages/pylint/message/message_definition_store.py", line 50, in get_message_definitions
00:55     for m in self.message_id_store.get_active_msgids(msgid_or_symbol)
00:55   File "/root/.ansible/test/venv/sanity.pylint/3.10/1d079f27/lib/python3.10/site-packages/pylint/message/message_id_store.py", line 116, in get_active_msgids
00:55     raise UnknownMessageError(error_msg)
00:55 pylint.exceptions.UnknownMessageError: No such message id or symbol 'invalid-version'.
```

`invalid-version` is not defined in that plugin.

Additionally, we probably need to handle the issue where the `version` is a reference to a variable that cannot be resolved via astroid:

```
display.deprecated(msg, version=deprecation[1]['version'])
```

### Issue Type

Bug Report

### Component Name

test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py

### Ansible Version

```console
$ ansible --version
```


### Configuration

```console
$ ansible-config dump --only-changed
```


### OS / Environment

N/A

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)

```


### Expected Results

N/A

### Actual Results

```console
N/A
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct

Hints from issue discussion:
Files identified in the description:
* [`test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py`](https://github.com/ansible/ansible/blob/devel/test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->

Commit message: Update pylint deprecated plugin to use ansible-invalid* symbols

Patch to review:
diff --git a/test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py b/test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py
index 851d8d75985bbb..f480d4be0c7b86 100644
--- a/test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py
+++ b/test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py
@@ -158,7 +158,7 @@ def set_option(self, optname, value, action=None, optdict=None):
 
     def _check_date(self, node, date):
         if not isinstance(date, str):
-            self.add_message('invalid-date', node=node, args=(date,))
+            self.add_message('ansible-invalid-deprecated-date', node=node, args=(date,))
             return
 
         try:
@@ -172,7 +172,7 @@ def _check_date(self, node, date):
 
     def _check_version(self, node, version, collection_name):
         if not isinstance(version, (str, float)):
-            self.add_message('invalid-version', node=node, args=(version,))
+            self.add_message('ansible-invalid-deprecated-version', node=node, args=(version,))
             return
 
         version_no = str(version)


Code review comments:
diff_hunk: @@ -172,7 +172,7 @@ def _check_date(self, node, date):
 
     def _check_version(self, node, version, collection_name):
         if not isinstance(version, (str, float)):
-            self.add_message('invalid-version', node=node, args=(version,))
+            self.add_message('ansible-invalid-deprecated-version', node=node, args=(version,))
path: test/lib/ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py
text: @user1:
Shouldn't this check `collection_name` as is done below and then return either `ansible-invalid-deprecated-version` or `collection-invalid-deprecated-version`?

@author:
Oops, this has been addressed.