Skip to content

Commit

Permalink
Merge branch 'dev' into fix-parens
Browse files Browse the repository at this point in the history
  • Loading branch information
bebound authored Dec 3, 2024
2 parents d92fa3e + 978b94c commit cbe7e00
Show file tree
Hide file tree
Showing 543 changed files with 45,975 additions and 13,570 deletions.
4 changes: 4 additions & 0 deletions .githooks/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ else
against=$(git hash-object -t tree /dev/null)
fi
has_secrets=0

IFS_OLD=${IFS}
IFS=$'\n'
for FILE in `git diff --cached --name-only --diff-filter=AM $against` ; do
# Check if the file contains secrets
detected=$(azdev scan -f "$FILE" | python -c "import sys, json; print(json.load(sys.stdin)['secrets_detected'])")
Expand All @@ -28,6 +31,7 @@ for FILE in `git diff --cached --name-only --diff-filter=AM $against` ; do
has_secrets=1
fi
done
IFS=${IFS_OLD}

if [ $has_secrets -eq 1 ]; then
printf "\033[0;31mSecret detected. If you want to skip that, run add '--no-verify' in the end of 'git commit' command.\033[0m\n"
Expand Down
77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/docs_feedback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: ✒️ Reference documentation issue or question
description: Report reference documentation related issue
title: '[Reference feedback]: '
labels: [needs-triage]

body:
- type: markdown
attributes:
value: >
Azure CLI documentation includes 3 categories:
- Conceptual doc about Azure CLI: https://docs.microsoft.com/en-us/CLI/azure
- Engineering doc on Github repo (Core): https://github.com/Azure/azure-CLI
- Engineering doc on Github repo (Extensions): https://github.com/Azure/azure-CLI-extensions
- type: markdown
attributes:
value: Select the issue type, and describe the issue in the text box below. Add as much detail as needed to help us resolve the issue.
- type: dropdown
id: issue-type
attributes:
label: Type of issue
options:
- Other (describe below)
- Code doesn't work
- Missing information
- Outdated article
- Typo
validations:
required: true
- type: textarea
id: referencecommand
validations:
required: true
attributes:
label: Reference command name
description: >-
Enter the reference command name. Example: `az vm create`. Do not include parameters in this section.
- type: textarea
id: userfeedback
validations:
required: true
attributes:
label: Feedback
description: >-
Please provide extended details that will add context and help the team update
Azure CLI reference documentation. For technical or factual errors, include code
snippets and output from the `--debug` parameter. For examples on using `--debug`,
see https://learn.microsoft.com/cli/azure/use-azure-cli-successfully-troubleshooting#the---debug-parameter.
- type: markdown
attributes:
value: Article information
- type: markdown
attributes:
value: "*If the following fields are automatically filled in for you, please don't modify them*"
- type: input
id: pageUrl
attributes:
label: Page URL
- type: input
id: contentSourceUrl
attributes:
label: Content source URL
- type: input
id: author
attributes:
label: Author
description: GitHub Id of the author
- type: input
id: documentVersionIndependentId
attributes:
label: Document Id
- type: markdown
attributes:
value: >
The Azure CLI team is listening, please let us know how we are doing: https://learn.microsoft.com/cli/azure/command-line-tools-survey-guidance.
3 changes: 3 additions & 0 deletions .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2543,6 +2543,9 @@ configuration:
- mentionUsers:
mentionees:
- kenieva
- shanhix1
- calecarter
- mentat9
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
assignMentionees: False
- if:
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/CCOA.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CCOA

on:
pull_request_target:
types:
- opened
- reopened
branches:
- dev

permissions:
pull-requests: write

jobs:
add_label_and_comment:
runs-on: ubuntu-latest

steps:
- name: Check current date securely
id: date_check
run: |
# Define the block date (Jan 7, 2025)
BLOCK_DATE=$(date -d "2025-01-07" +%s)
# Get the current date in seconds
CURRENT_DATE=$(date +%s)
# Validate the dates and safely output the result
if [ "$CURRENT_DATE" -lt "$BLOCK_DATE" ]; then
echo "continue=true" >> "$GITHUB_OUTPUT"
else
echo "continue=false" >> "$GITHUB_OUTPUT"
fi
- name: Comment on PR
if: steps.date_check.outputs.continue == 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// Fetch existing comments
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
// Check if the specific comment already exists
const existingComment = comments.data.find(comment =>
comment.body.includes("⚠️**Your changes in this PR will be released on Jan 14, 2025 due to CCOA (extend to Jan 6, 2025)**")
);
if (existingComment) {
console.log("Comment already exists. Skipping...");
} else {
console.log("No comment found. Adding a new one...");
// Add a new comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: "⚠️**Your changes in this PR will be released on Jan 14, 2025 due to CCOA (extend to Jan 6, 2025)**",
});
}
10 changes: 8 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1137,20 +1137,25 @@ jobs:
. env/bin/activate
git fetch origin --depth=1 $(System.PullRequest.TargetBranch)
declare -A secret_files
IFS_OLD=${IFS}
IFS=$'\n'
for FILE in `git diff --name-only --diff-filter=AM origin/$(System.PullRequest.TargetBranch)` ; do
detected=$(azdev scan -f $FILE | python -c "import sys, json; print(json.load(sys.stdin)['secrets_detected'])")
echo $FILE
detected=$(azdev scan -f "$FILE" | python -c "import sys, json; print(json.load(sys.stdin)['secrets_detected'])")
if [ $detected == 'True' ]; then
echo "Secrets detected from "$FILE", Please remove or replace it. You can leverage 'azdev scan'/'azdev mask' command if needed." 1>&2
printf "\033[0;31mDetected secrets from %s, You can run 'azdev mask' to remove secrets.\033[0m\n" "$FILE"
secret_files+=$FILE
fi
done
IFS=${IFS_OLD}
if [ "${#secret_files[@]}" -gt 0 ]; then
exit 1
fi
- job: CodegenCoverage
displayName: "Codegen Coverage"
continueOnError: true
pool:
name: ${{ variables.ubuntu_pool }}
steps:
Expand All @@ -1173,6 +1178,7 @@ jobs:
# CLI repo only
azdev statistics list-command-table CLI --statistics-only
# CLI + EXT repos
pip install jinja2 -U
azdev statistics list-command-table --statistics-only > /tmp/codegen_report.json
python s/scripts/ci/codegen_report.py
env:
Expand Down
4 changes: 0 additions & 4 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ disable=
no-value-for-parameter,
raise-missing-from,
subprocess-run-check,
super-with-arguments,
too-many-arguments,
too-many-positional-arguments,
too-many-function-args,
Expand All @@ -42,13 +41,10 @@ disable=
use-maxsplit-arg,
arguments-renamed,
consider-using-in,
use-dict-literal,
consider-using-dict-items,
consider-using-enumerate,
redundant-u-string-prefix,
# These rules were added in Pylint >= 2.12, disable them to avoid making retroactive change
missing-timeout,
implicit-str-concat,
unnecessary-dunder-call,
# These rules were added in Pylint >= 3.2
possibly-used-before-assignment,
Expand Down
2 changes: 1 addition & 1 deletion scripts/dump_command_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Exporter(json.JSONEncoder):

def default(self, o):#pylint: disable=method-hidden
try:
return super(Exporter, self).default(o)
return super().default(o)
except TypeError:
return str(o)

Expand Down
2 changes: 1 addition & 1 deletion scripts/dump_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Exporter(json.JSONEncoder):

def default(self, o):#pylint: disable=method-hidden
try:
return super(Exporter, self).default(o)
return super().default(o)
except TypeError:
return str(o)

Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_command_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Exporter(json.JSONEncoder):

def default(self, o):#pylint: disable=method-hidden
try:
return super(Exporter, self).default(o)
return super().default(o)
except TypeError:
return str(o)

Expand Down
8 changes: 4 additions & 4 deletions scripts/temp_help/help_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,23 +173,23 @@ def get_all_mod_names():

def _get_new_yaml_dict(help_dict):

result = dict(version=1, content=[])
result = {"version": 1, "content": []}
content = result['content']

for command_or_group, yaml_text in help_dict.items():
help_dict = yaml.safe_load(yaml_text)

type = help_dict["type"]

elem = {type: dict(name=command_or_group)}
elem = {type: {"name": command_or_group}}
elem_content = elem[type]

_convert_summaries(old_dict=help_dict, new_dict=elem_content)

if "parameters" in help_dict:
parameters = []
for param in help_dict["parameters"]:
new_param = dict()
new_param = {}
if "name" in param:
options = param["name"].split()
new_param["name"] = max(options, key=lambda x: len(x))
Expand All @@ -205,7 +205,7 @@ def _get_new_yaml_dict(help_dict):
if "examples" in help_dict:
elem_examples = []
for ex in help_dict["examples"]:
new_ex = dict()
new_ex = {}
if "name" in ex:
new_ex["summary"] = ex["name"]
if "text" in ex:
Expand Down
10 changes: 5 additions & 5 deletions src/azure-cli-core/azure/cli/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _configure_knack():
class AzCli(CLI):

def __init__(self, **kwargs):
super(AzCli, self).__init__(**kwargs)
super().__init__(**kwargs)

from azure.cli.core.breaking_change import register_upcoming_breaking_change_info
from azure.cli.core.commands import register_cache_arguments
Expand Down Expand Up @@ -200,7 +200,7 @@ class MainCommandsLoader(CLICommandsLoader):
item_ext_format_string = item_format_string + " %s"

def __init__(self, cli_ctx=None):
super(MainCommandsLoader, self).__init__(cli_ctx)
super().__init__(cli_ctx)
self.cmd_to_loader_map = {}
self.loaders = []

Expand Down Expand Up @@ -677,9 +677,9 @@ def __init__(self, cli_ctx=None, command_group_cls=None, argument_context_cls=No
suppress_extension=None, **kwargs):
from azure.cli.core.commands import AzCliCommand, AzCommandGroup, AzArgumentContext

super(AzCommandsLoader, self).__init__(cli_ctx=cli_ctx,
command_cls=AzCliCommand,
excluded_command_handler_args=EXCLUDED_PARAMS)
super().__init__(cli_ctx=cli_ctx,
command_cls=AzCliCommand,
excluded_command_handler_args=EXCLUDED_PARAMS)
self.suppress_extension = suppress_extension
self.module_kwargs = kwargs
self.command_name = None
Expand Down
Loading

0 comments on commit cbe7e00

Please sign in to comment.