Skip to content

Commit

Permalink
Merge pull request #4 from Azure/main
Browse files Browse the repository at this point in the history
Synced with official repo
  • Loading branch information
ShichaoQiu committed Dec 28, 2023
2 parents 9834a50 + 568eb13 commit d662917
Show file tree
Hide file tree
Showing 2,098 changed files with 959,348 additions and 369,119 deletions.
22 changes: 14 additions & 8 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
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
W503 # line break before binary operator effect on readability is subjective
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 before binary operator effect on readability is subjective
W503
# line break after binary operator effect on readability is subjective
W504
exclude =
*/vendored_sdks
docs
Expand Down
10 changes: 9 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

/src/subscription/ @wilcobmsft

/src/apic-extension/ @arpishahmsft

/src/alias/ @Juliehzl

/src/managementpartner/ @jeffrey-ace
Expand Down Expand Up @@ -242,7 +244,7 @@

/src/containerapp/ @ruslany @sanchitmehta @ebencarek @JennyLawrance @howang-ms @vinisoto @chinadragon0515 @vturecek @torosent @pagariyaalok @Juliehzl @jijohn14

/src/scvmm/ @nascarsayan
/src/scvmm/ @nascarsayan @hsurana06

/src/spring/ @yuwzho

Expand Down Expand Up @@ -311,3 +313,9 @@
/src/graphservices/ @amatukmolina

/src/site-recovery/ @calvinhzy

/src/hdinsightonaks/ @aim-for-better @yuc-Li

/src/network-analytics/ @pikanghosh1

/src/azurelargeinstance/ @8Gitbrix
24 changes: 23 additions & 1 deletion .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3187,7 +3187,7 @@ configuration:
- requestReview:
reviewer: zhoxing-ms
- requestReview:
reviewer: wangzelin007
reviewer: yanzhudd
- requestReview:
reviewer: yonzhan
- assignTo:
Expand Down Expand Up @@ -5729,6 +5729,8 @@ configuration:
reviewer: zhoxing-ms
- requestReview:
reviewer: yanzhudd
- requestReview:
reviewer: qwuae1
- addLabel:
label: Auto-Assign
- assignTo:
Expand Down Expand Up @@ -5905,5 +5907,25 @@ configuration:
users:
- kairu-ms
description: '[Connected Vmware] Auto assign labels and reviewers based on PR title/description.'
- if:
- payloadType: Issues
- or:
- titleContains:
pattern: az datafactory
isRegex: True
- bodyContains:
pattern: az datafactory
isRegex: True
- or:
- isAction:
action: Opened
then:
- addLabel:
label: Auto-Assign
- addLabel:
label: Data Factory
- addLabel:
label: Service Attention
description: '[Data Factory] auto assign labels and users based on issue description.'
onFailure:
onSuccess:
2 changes: 1 addition & 1 deletion .github/workflows/AddIssueComment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Say thanks for the Issue
steps:
- name: comment on the issue
uses: hasura/comment-progress@v2.2.0
uses: hasura/comment-progress@v2.3.0
with:
github-token: ${{ secrets.CLI_BOT }}
repository: 'Azure/azure-cli-extensions'
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/BlockPRMerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Block PR merging on "do-not-merge" label

on:
pull_request_target:
types: [labeled, unlabeled]

jobs:
block-merge:
runs-on: ubuntu-latest
steps:
- name: Check "do-not-merge" label
uses: actions/github-script@v7
with:
script: |
const labels = context.payload.pull_request.labels.map(label => label.name);
if (labels.includes("do-not-merge")) {
console.log("It is not allowed to merge a PR with 'do-not-merge' label.");
process.exit(1); // Exit with a non-zero status code to block merge
} else {
console.log("It is allowed to merge a PR without 'do-not-merge' label.");
}
66 changes: 40 additions & 26 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,39 +57,25 @@ jobs:
name: 'pool-ubuntu-2004'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
#!/usr/bin/env bash
set -ev
source ./env/bin/activate
azdev verify license
- job: StaticAnalysis
displayName: "Static Analysis"
pool:
name: 'pool-ubuntu-2004'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
inputs:
versionSpec: 3.6
- bash: pip install wheel==0.30.0 pylint==1.9.5 flake8==3.5.0 requests
displayName: 'Install wheel, pylint, flake8, requests'
- bash: python scripts/ci/source_code_static_analysis.py
displayName: "Static Analysis"

- job: IndexVerify
displayName: "Verify Extensions Index"
pool:
name: 'pool-ubuntu-2004'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11
- bash: |
#!/usr/bin/env bash
set -ev
Expand All @@ -110,6 +96,8 @@ jobs:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
Expand All @@ -129,16 +117,17 @@ jobs:
ADO_PULL_REQUEST_LATEST_COMMIT: HEAD
ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
- job: LintModifiedExtensions
displayName: "CLI Linter on Modified Extensions"
- job: AzdevStyleModifiedExtensions
displayName: "azdev style on Modified Extensions"
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
continueOnError: true
pool:
name: 'pool-ubuntu-2004'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
#!/usr/bin/env bash
Expand All @@ -147,8 +136,33 @@ jobs:
# overwrite the default AZURE_EXTENSION_DIR set by ADO
AZURE_EXTENSION_DIR=~/.azure/cliextensions az --version
AZURE_EXTENSION_DIR=~/.azure/cliextensions python scripts/ci/verify_linter.py
displayName: "CLI Linter on Modified Extension"
AZURE_EXTENSION_DIR=~/.azure/cliextensions python scripts/ci/azdev_linter_style.py --type style
displayName: "azdev style on Modified Extensions"
env:
ADO_PULL_REQUEST_LATEST_COMMIT: HEAD
ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
- job: AzdevLinterModifiedExtensions
displayName: "azdev linter on Modified Extensions"
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
pool:
name: 'pool-ubuntu-2004'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
#!/usr/bin/env bash
set -ev
source ./env/bin/activate
# overwrite the default AZURE_EXTENSION_DIR set by ADO
AZURE_EXTENSION_DIR=~/.azure/cliextensions az --version
# TODO: remove --type linter once all extensions are fixed
AZURE_EXTENSION_DIR=~/.azure/cliextensions python scripts/ci/azdev_linter_style.py --type linter
displayName: "azdev linter on Modified Extensions"
env:
ADO_PULL_REQUEST_LATEST_COMMIT: HEAD
ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
Expand All @@ -160,9 +174,9 @@ jobs:
name: 'pool-ubuntu-2004'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.10
versionSpec: 3.11
- bash: pip install wheel==0.30.0
displayName: 'Install wheel==0.30.0'
- task: Bash@3
Expand Down
3 changes: 3 additions & 0 deletions linter_exclusions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ aks update:
enable_network_observability:
rule_exclusions:
- option_length_too_long
disable_network_observability:
rule_exclusions:
- option_length_too_long
arcdata dc create:
parameters:
logs_ui_private_key_file:
Expand Down
75 changes: 45 additions & 30 deletions pylintrc
Original file line number Diff line number Diff line change
@@ -1,27 +1,58 @@
[MASTER]
ignore=tests,generated,vendored_sdks,privates
ignore-patterns=test.*,azure_devops_build.*
ignore-paths=.*/aaz
reports=no

[MESSAGES CONTROL]
# For all codes, run 'pylint --list-msgs' or go to 'https://pylint.readthedocs.io/en/latest/reference_guide/features.html'
# cyclic-import: because of https://github.com/PyCQA/pylint/issues/850
# import-outside-toplevel: Lazy import to improve performance
# locally-disabled: Warning locally suppressed using disable-msg
# cyclic-import: Because of https://github.com/PyCQA/pylint/issues/850
# too-many-arguments: Due to the nature of the CLI many commands have large arguments set which reflect in large arguments set in corresponding methods.
# import-outside-toplevel: Lazy import to improve performance
# consider-using-f-string: str.format is still a Python standard
# unspecified-encoding: Allow using the system encoding, instead of forcing utf-8 to avoid opening errors
disable=
missing-docstring,
locally-disabled,
fixme,
arguments-out-of-order,
bad-option-value,
consider-using-with,
cyclic-import,
too-many-arguments,
invalid-name,
duplicate-code,
fixme,
import-outside-toplevel,
too-many-lines

[TYPECHECK]
# For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI
ignored-modules=azure,azure.cli,azure.cli.core,azure.cli.core.commands,knack,msrestazure,argcomplete,azure.cli.testsdk,isodate,OpenSSL
inconsistent-return-statements,
invalid-name,
invalid-str-returned,
locally-disabled,
missing-docstring,
missing-kwoa,
no-member,
no-value-for-parameter,
raise-missing-from,
subprocess-run-check,
super-with-arguments,
too-many-arguments,
too-many-function-args,
too-many-lines,
using-constant-test,
wrong-import-order,
consider-using-f-string,
unspecified-encoding,
use-maxsplit-arg,
arguments-renamed,
consider-using-in,
use-dict-literal,
consider-using-dict-items,
consider-using-enumerate,
redundant-u-string-prefix,
raising-bad-type,
unused-private-member,
used-before-assignment,
# These rules were added in Pylint >= 2.12, disable them to avoid making retroactive change
missing-timeout,
superfluous-parens,
implicit-str-concat,
unnecessary-dunder-call,

[FORMAT]
max-line-length=120
Expand All @@ -35,24 +66,8 @@ init-import=yes
max-locals=25
# Maximum number of branch for function / method body
max-branches=20
# Temporally disable this check as inline disable is not working, see https://github.com/pylint-dev/pylint/issues/8806
max-statements=500

[SIMILARITIES]
min-similarity-lines=10

[BASIC]
# Naming hints based on PEP 8 (https://www.python.org/dev/peps/pep-0008/#naming-conventions).
# Consider these guidelines and not hard rules. Read PEP 8 for more details.

# The invalid-name checker must be **enabled** for these hints to be used.
include-naming-hint=yes

module-name-hint=lowercase (keep short; underscores are discouraged)
const-name-hint=UPPER_CASE_WITH_UNDERSCORES
class-name-hint=CapitalizedWords
class-attribute-name-hint=lower_case_with_underscores
attr-name-hint=lower_case_with_underscores
method-name-hint=lower_case_with_underscores
function-name-hint=lower_case_with_underscores
argument-name-hint=lower_case_with_underscores
variable-name-hint=lower_case_with_underscores
inlinevar-name-hint=lower_case_with_underscores (short is OK)
Loading

0 comments on commit d662917

Please sign in to comment.