Azure / Azure/azure-cli-dev-tools

{CI} Linter check faulty_help_example_parameters_rule error

Ouverte
#331 0 commentaires 0 réactions 1 personne assignée Réclamée par @wangzelin007 Voir sur GitHub
bug CI
Langage dominant
Python
Étoiles
91
Forks
134
Merge moyen
2 h 51 min
PR mergées (30 j)
1

Description

Linter check raise the following error in [PR](https://github.com/Azure/azure-cli/pull/22201):
https://dev.azure.com/azure-sdk/public/_build/results?buildId=1532217&view=logs&j=168ccbe3-da49-5c0b-6478-08f7016e4bf5&t=10a595be-4223-5cc7-9a73-012871b6eaee&s=96ac2280-8cb4-5df5-99de-dd2da759617d
![image](https://user-images.githubusercontent.com/18628534/165687848-80731fa0-78a6-4d86-a7ed-cf2efa0385d0.png)

After debugging, it is caused by:
https://github.com/Azure/azure-cli-dev-tools/blob/c94bff479f633845ccce1279eebac60426e985ab/azdev/operations/linter/rules/help_rules.py#L124

Linter rule `faulty_help_example_parameters_rule` will get `example_text` from _help.py file.

One of the generated example_text
`az aks connection create keyvault -g ClusterRG -n MyCluster --tg KeyvaultRG --vault MyVault --service-principal client-id=XX secret=XX` missing optional parameter `object-id=XX`

The workaround is adding object-id=XX to [_help.py](https://github.com/Azure/azure-cli/blob/3b9d2f02d9b82bbefcd0772fede513cbb098324f/src/azure-cli/azure/cli/command_modules/serviceconnector/_help.py#L50) file

The following three problems need to be solved :
1. The generation logic of example_text
2. How to optimize the error message, there is no connection between the current error log and the actual problem.
3. An exception in one of the linter checks will cause the remaining linter checks to abort and exit

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.