From 9c9d05d777a07197419a1661b01007e161fb79ff Mon Sep 17 00:00:00 2001 From: v-soujanya <101401302+v-soujanya@users.noreply.github.com> Date: Mon, 16 Jan 2023 15:10:12 +0530 Subject: [PATCH] pipelinefailedissuefixes (#1334) --- .azure-pipelines/azure-pipelines-pr.yml | 9 ++++++--- .flake8 | 18 ++++++++++++------ .../azext_devops/dev/pipelines/build.py | 2 +- .../azext_devops/dev/repos/arguments.py | 2 +- doc/security_tokens.md | 2 +- doc/troubleshooting_common_errors.md | 2 +- tests/test_pipelinesBuildCancelTest.py | 2 +- 7 files changed, 23 insertions(+), 14 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-pr.yml b/.azure-pipelines/azure-pipelines-pr.yml index a9f5e5c7f..0ba7e8ac1 100644 --- a/.azure-pipelines/azure-pipelines-pr.yml +++ b/.azure-pipelines/azure-pipelines-pr.yml @@ -45,9 +45,9 @@ jobs: strategy: matrix: Python36: - python.version: '3.6.x' + python.version: '3.10' Python37: - python.version: '3.x' + python.version: '3.10' maxParallel: 3 steps: @@ -138,7 +138,7 @@ jobs: steps: - task: UsePythonVersion@0 inputs: - versionSpec: '3.x' + versionSpec: '3.8' architecture: 'x64' - template: templates/install-azure-cli-edge.yml @@ -155,6 +155,9 @@ jobs: targetType: 'filePath' filePath: 'scripts/runStyleCheck.ps1' + + + - job: 'Run_HelpText_Check' dependsOn: 'Build_Publish_Azure_CLI_Test_SDK' pool: diff --git a/.flake8 b/.flake8 index 1dda9d408..caa89c014 100644 --- a/.flake8 +++ b/.flake8 @@ -2,12 +2,18 @@ max-line-length = 120 max-complexity = 10 ignore = - E501, # line too long, it is covered by pylint - E722, # bare except, bad practice, to be removed in the future - F401, # imported but unused, too many violations, to be removed in the future - F811, # redefinition of unused, to be removed in the future - C901, # code flow is too complex, too many violations, to be removed in the future - W504 # line break after binary operator effect on readability is subjective + # line too long, it is covered by pylint + E501, + # bare except, bad practice, to be removed in the future + E722, + # imported but unused, too many violations, to be removed in the future + F401, + # redefinition of unused, to be removed in the future + F811, + # code flow is too complex, too many violations, to be removed in the future + C901, + # line break after binary operator effect on readability is subjective + W504 exclude = tests build diff --git a/azure-devops/azext_devops/dev/pipelines/build.py b/azure-devops/azext_devops/dev/pipelines/build.py index a3c4a6981..c208c8165 100644 --- a/azure-devops/azext_devops/dev/pipelines/build.py +++ b/azure-devops/azext_devops/dev/pipelines/build.py @@ -123,7 +123,7 @@ def build_list(definition_ids=None, branch=None, organization=None, project=None return builds -def build_cancel(build_id, open=False, organization=None, project=None, detect=None): +def build_cancel(build_id, open=False, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Cancels if build is running. :param build_id: ID of the build. :type build_id: int diff --git a/azure-devops/azext_devops/dev/repos/arguments.py b/azure-devops/azext_devops/dev/repos/arguments.py index 96d87d033..e346f60e6 100644 --- a/azure-devops/azext_devops/dev/repos/arguments.py +++ b/azure-devops/azext_devops/dev/repos/arguments.py @@ -22,7 +22,7 @@ def load_code_arguments(self, _): with self.argument_context('repos policy') as context: context.argument('policy_configuration', options_list=('--policy-configuration', '--config'), help='Local file path for configuration file. ' + - 'Please use backslash(\) when typing in directory path. ') + 'Please use \\backslash when typing in directory path.') context.argument('policy_id', options_list=('--policy-id', '--id'), help='ID of the policy.') context.argument('repository_id', help='Id of the repository on which to apply the policy') diff --git a/doc/security_tokens.md b/doc/security_tokens.md index d28d3ed2a..d388507b7 100644 --- a/doc/security_tokens.md +++ b/doc/security_tokens.md @@ -132,4 +132,4 @@ If the tokens have variable-length path parts, then a separator character is use Token format for project level permissions : 'repoV2/PROJECT_ID/REPO_ID' - For more information on this namespace and its tokens refer this [blog](https://devblogs.microsoft.com/devops/git-repo-tokens-for-the-security-service/) \ No newline at end of file + For more information on this namespace and its tokens refer this [blog](https://devblogs.microsoft.com/devops/git-repo-tokens-for-the-security-service/) diff --git a/doc/troubleshooting_common_errors.md b/doc/troubleshooting_common_errors.md index 10d477bd2..d3e3af4b4 100644 --- a/doc/troubleshooting_common_errors.md +++ b/doc/troubleshooting_common_errors.md @@ -6,4 +6,4 @@ |----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Team level iterations| `VS1530019: Cannot find iteration with id 'b1e33737-e943-xxxx-xxxx-e3f1cbaxxxx'. The iteration might have been deleted, or it might not be selected for your team.` | Cannot find iteration: When you try to add a backlog iteration to a team. | You can only add child iterations of backlog iteration to your team. Create child iterations of your backlog iteration using command `az boards iteration project create --name "child_iteration_name" --path `. Get the identifier of this iteration and add it to your team using `az boards iteration team add -h` command.| | Team level Areas | `DefaultValue` | If you are trying to add your first area to a team without passing the flag --set-as-default. |Pass `--set-as-default` when adding an area to a team or use `az boards area team update` command to change the default area for the team. Refer help for `az boards area team add -h`| -| Team level Areas | `TF400499: You have not set your team field.`| Adding/removing/updating area to team | Be cautious while working with team areas, --path parameter for team area must be `\ProjectName\RootAreaName\ChildArea1` and not `\ProjectName\Area\RootAreaName\ChildArea1`. Team area commands don't expect 'Area' keyword to be passed in the --path parameter. | \ No newline at end of file +| Team level Areas | `TF400499: You have not set your team field.`| Adding/removing/updating area to team | Be cautious while working with team areas, --path parameter for team area must be `\ProjectName\RootAreaName\ChildArea1` and not `\ProjectName\Area\RootAreaName\ChildArea1`. Team area commands don't expect 'Area' keyword to be passed in the --path parameter. | diff --git a/tests/test_pipelinesBuildCancelTest.py b/tests/test_pipelinesBuildCancelTest.py index 13930360f..8b931835c 100644 --- a/tests/test_pipelinesBuildCancelTest.py +++ b/tests/test_pipelinesBuildCancelTest.py @@ -26,6 +26,6 @@ def test_build_cancel(self): queued_build_id = queue_build_output["id"] #Cancel the running build - cancel_running_build_command = 'az pipelines build cancel --id ' + str(queued_build_id) + ' --detect false --output json' + cancel_running_build_command = 'az pipelines build cancel --build-id ' + str(queued_build_id) + ' --detect false --output json' cancel_running_build_output = self.cmd(cancel_running_build_command).get_output_in_json() assert cancel_running_build_output["status"] == "cancelling" \ No newline at end of file