Skip to content

Commit

Permalink
Merge branch 'Azure:dev' into nguyenma/revertPolling
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenm2151 authored Dec 6, 2024
2 parents cafde21 + f92f723 commit 414266d
Show file tree
Hide file tree
Showing 1,205 changed files with 177,313 additions and 58,646 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://learn.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.
2 changes: 1 addition & 1 deletion .github/azure-client-tools-bot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ cli_common_issues:
- https://github.com/Azure/azure-cli/issues/19640#issuecomment-1133875268
- https://github.com/Azure/azure-cli/issues/19640#issuecomment-1148202854
Please follow https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux to install Microsoft official Azure CLI.
Please follow https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux to install Microsoft official Azure CLI.
If you feel that further discussion is needed, please add a comment with the text `/clibot unresolve` to reopen the issue.
- tag: latest_api_version_not_available
Expand Down
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)**",
});
}
4 changes: 2 additions & 2 deletions Dockerfile.nanoserver
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ LABEL maintainer="Microsoft" \
org.label-schema.version=$CLI_VERSION \
org.label-schema.license="MIT" \
org.label-schema.description="The Azure CLI 2.0 is the new Azure CLI and is applicable when you use the Resource Manager deployment model." \
org.label-schema.url="https://docs.microsoft.com/cli/azure/overview" \
org.label-schema.usage="https://docs.microsoft.com/cli/azure/install-az-cli2#docker" \
org.label-schema.url="https://learn.microsoft.com/cli/azure/overview" \
org.label-schema.usage="https://learn.microsoft.com/cli/azure/install-az-cli2#docker" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/Azure/azure-cli.git" \
org.label-schema.docker.cmd="docker run -v $HOME\.azure:C:\Users\ContainerUser\.azure -it mcr.microsoft.com/azure-cli:$CLI_VERSION"
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Take a test run now from [Azure Cloud Shell](https://portal.azure.com/#cloudshel

## Installation

Please refer to the [install guide](https://docs.microsoft.com/cli/azure/install-azure-cli) for detailed install instructions.
Please refer to the [install guide](https://learn.microsoft.com/cli/azure/install-azure-cli) for detailed install instructions.

A list of common install issues and their resolutions are available at [install troubleshooting](https://github.com/Azure/azure-cli/blob/dev/doc/install_troubleshooting.md).

Expand All @@ -28,7 +28,7 @@ $ az [ group ] [ subgroup ] [ command ] {parameters}

### Get Started

Please refer to the ["get started" guide](https://docs.microsoft.com/cli/azure/get-started-with-az-cli2) for in-depth instructions.
Please refer to the ["get started" guide](https://learn.microsoft.com/cli/azure/get-started-with-az-cli2) for in-depth instructions.

For usage and help content, pass in the `-h` parameter, for example:

Expand Down Expand Up @@ -87,21 +87,21 @@ For scripting purposes, we output certain exit codes for differing scenarios.

### Common scenarios and use Azure CLI effectively

Please check [Tips for using Azure CLI effectively](https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively). It describes some common scenarios:
Please check [Tips for using Azure CLI effectively](https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively). It describes some common scenarios:

- [Output formatting (json, table, or tsv)](https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively#output-formatting-json-table-or-tsv)
- [Pass values from one command to another](https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively#pass-values-from-one-command-to-another)
- [Async operations](https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively#async-operations)
- [Generic update arguments](https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively#generic-update-arguments)
- [Generic resource commands - `az resource`](https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively#generic-resource-commands---az-resource)
- [REST API command - `az rest`](https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively#rest-api-command---az-rest)
- [Quoting issues](https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively#quoting-issues)
- [Work behind a proxy](https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively#work-behind-a-proxy)
- [Concurrent builds](https://docs.microsoft.com/en-us/cli/azure/use-cli-effectively#concurrent-builds)
- [Output formatting (json, table, or tsv)](https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively#output-formatting-json-table-or-tsv)
- [Pass values from one command to another](https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively#pass-values-from-one-command-to-another)
- [Async operations](https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively#async-operations)
- [Generic update arguments](https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively#generic-update-arguments)
- [Generic resource commands - `az resource`](https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively#generic-resource-commands---az-resource)
- [REST API command - `az rest`](https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively#rest-api-command---az-rest)
- [Quoting issues](https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively#quoting-issues)
- [Work behind a proxy](https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively#work-behind-a-proxy)
- [Concurrent builds](https://learn.microsoft.com/en-us/cli/azure/use-cli-effectively#concurrent-builds)

### More samples and snippets

For more usage examples, take a look at our [GitHub samples repo](http://github.com/Azure/azure-cli-samples) or [https://docs.microsoft.com/cli/azure/overview](https://docs.microsoft.com/cli/azure/overview).
For more usage examples, take a look at our [GitHub samples repo](http://github.com/Azure/azure-cli-samples) or [https://learn.microsoft.com/cli/azure/overview](https://learn.microsoft.com/cli/azure/overview).

### Write and run commands in Visual Studio Code

Expand Down
33 changes: 15 additions & 18 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ jobs:
echo "== Test docker image =="
docker load < $TAR_FILE
docker run $IMAGE_NAME /bin/bash -c "time az self-test && time az --version && sleep 5"
docker run $IMAGE_NAME /bin/bash -c "time az self-test && time az --version && tdnf list --installed && sleep 5"
displayName: 'Bash Script'
- job: BuildPythonWheel
Expand Down Expand Up @@ -747,7 +747,7 @@ jobs:
BuildDropPath: $(Build.ArtifactStagingDirectory)

- task: PublishPipelineArtifact@0
displayName: 'Publish Artifact: rpm-mariner'
displayName: 'Publish Artifact: rpm-azurelinux'
inputs:
TargetPath: $(Build.ArtifactStagingDirectory)
ArtifactName: $(artifact)
Expand Down Expand Up @@ -798,7 +798,7 @@ jobs:
docker pull $IMAGE
docker run --rm -e RPM_NAME=$RPM_NAME -v $SYSTEM_ARTIFACTSDIRECTORY/rpm:/mnt/rpm -v $(pwd):/azure-cli $IMAGE /bin/bash "/azure-cli/scripts/release/rpm/test_azurelinux_in_docker.sh"
displayName: 'Test Rpm Package Mariner'
displayName: 'Test Rpm Package Azure Linux'
# TODO: rpmbuild on Red Hat UBI 8 is slow for unknown reason. Still working with Red Hat to investigate.
- job: BuildRpmPackages
Expand Down Expand Up @@ -1137,28 +1137,32 @@ 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
condition: and(succeededOrFailed(), in(variables['Build.Reason'], 'BatchedCI'))
displayName: "Codegen Coverage"
continueOnError: true
pool:
name: ${{ variables.ubuntu_pool }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.12'
displayName: 'Use Python 3.11'
inputs:
versionSpec: 3.12
versionSpec: 3.11
- template: .azure-pipelines/templates/azdev_setup.yml
- bash: |
set -ev
Expand All @@ -1167,24 +1171,17 @@ jobs:
cd ..
git clone --depth 1 -b main https://github.com/Azure/azure-cli-extensions.git ./azure-cli-extensions
azdev extension repo add ./azure-cli-extensions
pip install setuptools==70.0.0 wheel==0.30.0
azdev extension add "*"
# Some extension will change the dependence, so run `azdev setup` again after all extensions installed.
azdev setup -c $CLI_REPO_PATH -r ./azure-cli-extensions
# 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
# azure-kusto is not compatible with azure-cli
# so we need run azdev statistics before installing azure-kusto to avoid the error `No module named azure.cli`
pip install azure-kusto-data azure-kusto-ingest
python s/scripts/ci/codegen_report.py
env:
BUILD_ID: $(Build.BuildId)
BUILD_BRANCH: $(Build.SourceBranchName)
KUSTO_CLIENT_ID: $(KUSTO_CLIENT_ID)
KUSTO_CLIENT_SECRET: $(KUSTO_CLIENT_SECRET)
KUSTO_CLUSTER: $(KUSTO_CLUSTER)
KUSTO_DATABASE: $(KUSTO_DATABASE)
KUSTO_TABLE: $(KUSTO_TABLE)
KUSTO_TENANT_ID: $(KUSTO_TENANT_ID)
enabled: false
enabled: true
6 changes: 3 additions & 3 deletions build_scripts/windows/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
<Icon Id="AzureIcon" SourceFile="$(var.ProductResources)windowsazure.ico" />

<Property Id="ARPPRODUCTICON" Value="AzureIcon" />
<Property Id="ARPHELPLINK" Value="https://docs.microsoft.com/cli/azure" />
<Property Id="ARPURLINFOABOUT" Value="https://docs.microsoft.com/cli/azure/overview" />
<Property Id="ARPURLUPDATEINFO" Value="https://docs.microsoft.com/cli/azure/overview" />
<Property Id="ARPHELPLINK" Value="https://learn.microsoft.com/cli/azure" />
<Property Id="ARPURLINFOABOUT" Value="https://learn.microsoft.com/cli/azure/overview" />
<Property Id="ARPURLUPDATEINFO" Value="https://learn.microsoft.com/cli/azure/overview" />
<Property Id="MSIFASTINSTALL" Value="7" />
<Property Id="ApplicationFolderName" Value="Microsoft SDKs\Azure" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
Expand Down
2 changes: 1 addition & 1 deletion doc/authoring_command_modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The document provides instructions and guidelines on how to author command modul

**Test Authoring**:<br>https://github.com/Azure/azure-cli/blob/dev/doc/authoring_tests.md

**Generating Documentation**:<br>https://review.docs.microsoft.com/help/onboard/admin/reference/cli/azure-cli-ci?branch=master#documenting-a-new-azure-cli-module
**Generating Documentation**:<br>https://review.learn.microsoft.com/help/onboard/admin/reference/cli/azure-cli-ci?branch=master#documenting-a-new-azure-cli-module

<a name="heading_set_up"></a>Set Up
------
Expand Down
8 changes: 0 additions & 8 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,17 +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,
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,
# These rules were added in Pylint >= 3.2
possibly-used-before-assignment,
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/automation_full_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def save_pipeline_result(pipeline_result):
logger.info(f"save pipeline result to file: {filename}")


class AutomaticScheduling(object):
class AutomaticScheduling:

def __init__(self):
"""
Expand Down
Loading

0 comments on commit 414266d

Please sign in to comment.