Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
00b9235
{Docs} Remove stale reference in README to closed issue about extensi…
dkmiller Apr 27, 2020
ab16df0
Merge remote-tracking branch 'upstream/release'
azclibot Apr 28, 2020
03436bc
Merge remote-tracking branch 'upstream/release'
azclibot Apr 30, 2020
7d98b1f
Merge remote-tracking branch 'upstream/release'
azclibot May 19, 2020
06f6ec5
Merge remote-tracking branch 'upstream/release'
azclibot Jun 2, 2020
125406f
Merge branch 'master' of git://github.com/Azure/azure-cli into dev
Jun 16, 2020
a497390
Preliminary changes made to add support for template-specs
Jun 22, 2020
e43a151
Reconfiguration
Jun 22, 2020
adab2d2
Merge remote-tracking branch 'upstream/release'
azclibot Jun 23, 2020
37c8522
Merge branch 'master' of git://github.com/Azure/azure-cli into dev
Jun 23, 2020
ef1e3f2
Merge remote-tracking branch 'upstream/dev' into dev
Jun 26, 2020
50e7c9c
validate function error rectified
Jun 27, 2020
68f47fd
validate command works for template-uri
Jun 29, 2020
7f184f8
Merge branch 'dev' of git://github.com/Azure/azure-cli into dev
Jun 29, 2020
bf962b1
Template-specs deployment works at resource-group level
Jun 29, 2020
4b90edd
Group deployment updated to function with 2020 SDK
Jun 30, 2020
4f39504
validate with template specs added
Jun 30, 2020
2e04882
Management scope and tenant scope errors fixed
Jul 1, 2020
7be894f
Testing Complete
Jul 2, 2020
87ccc2e
Merge branch 'dev' of git://github.com/Azure/azure-cli into dev
Jul 6, 2020
4f1348c
Template-Specs Deployment Added
Jul 6, 2020
9eb09f2
Template-Specs Deployment Added
Jul 6, 2020
44362eb
Merge branch 'dev' of git://github.com/Azure/azure-cli into dev
Jul 6, 2020
cf7b97a
Updated test cases and removed unnecessary comments
Jul 6, 2020
fb78986
Removed test cases from launch.json
Jul 6, 2020
504fda7
Uncommented test case
Jul 6, 2020
8f21f7c
Cleaned up repo
Jul 6, 2020
e73132c
Cleaned up repo
Jul 6, 2020
e8153f8
Merge branch 'dev' of git://github.com/Azure/azure-cli into dev
Jul 7, 2020
eac8414
Style checks complete, template_spec parameter placed at the end, tim…
Jul 8, 2020
74666fe
Merged with /dev
Jul 8, 2020
0e28ed8
Fixed failing CLI Check Test
Jul 8, 2020
583352f
Added fixes for deployment create_or_update and validate usage
Jul 9, 2020
a6344b8
Merge branch 'dev' of git://github.com/Azure/azure-cli into dev
Jul 9, 2020
2b43c88
Fix getting resource API version in ARM cmdlt
eladperets Aug 5, 2020
045b6e1
resetting branch
Aug 6, 2020
9b3fa34
reset
Aug 6, 2020
8153cec
Merge branch 'dev' of git://github.com/Azure/azure-cli into dev
Sep 1, 2020
f4f8df7
Merge branch 'dev' of git://github.com/Azure/azure-cli into dev
Oct 11, 2020
00cf5e3
[Billing] Introduce new commands and upgrade to 2020-05-01 (#15568)
Oct 26, 2020
a804e5f
{Core} Honor scopes specified by Track 2 SDK (#15184)
jiasli Oct 27, 2020
5aeb787
[KeyVault] Refine error messages for HSM `list-deleted` and `purge` (…
bim-msft Oct 27, 2020
9c68bfa
{Doc} Update doc for hotfix PR (#15552)
jiasli Oct 27, 2020
6f25ca6
{CI} Pin to Python 3.8 for "Verify src/azure-cli/requirements.*.Windo…
jiasli Oct 28, 2020
be93427
Commit#1346 (#15497)
ThejaChoudary Oct 28, 2020
c6dfb4e
{Core} Do not append/strip trailing slash in scope (#15698)
jiasli Oct 29, 2020
452c022
[Role] az role assignment create: Make description, condition, condit…
jiasli Oct 29, 2020
47ac4ea
[Compute] Fix update permission check issue (#15606)
qwordy Oct 29, 2020
d8d95f9
Update check for pfx file in batch create_certificate (#15509)
Zay2k Oct 29, 2020
533e55a
[Storage] Fix issue #15600: az storage fs exists: in case fs does not…
Juliehzl Oct 30, 2020
dc4b934
[Storage] Fix issue #15706: The examples for storage container create…
Juliehzl Oct 30, 2020
a2d80ac
Merge branch 'dev' of git://github.com/Azure/azure-cli into dev
Oct 30, 2020
a3dd306
{Test} Fix live tests for aks, advisor, appconfig, cognitiveservices,…
fengzhou-msft Oct 30, 2020
9952bbb
fix cloud register example (#15655)
fengzhou-msft Oct 30, 2020
4e2250c
{Test} Pipeline (#15654)
qwordy Nov 2, 2020
39a2360
[AKS] add ephemeral os functionality (#15673)
alexeldeib Nov 2, 2020
b64a1e8
[BACKUP] Fix #14976: KeyError fixed and help text improved (#15718)
akshayneema Nov 2, 2020
0a453c1
Merge branch 'dev' of git://github.com/Azure/azure-cli into daetienn/…
Nov 2, 2020
f1a9ed3
Root issue found and fixed
Nov 2, 2020
01bae39
New Changes Tested
Nov 2, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- bash: |
echo "Check Title of Pull Request: #$(System.PullRequest.PullRequestNumber)"
title=$(curl https://api.github.com/repos/$(Build.Repository.Name)/pulls/$(System.PullRequest.PullRequestNumber) | jq -r '.title')
if [ "$(System.PullRequest.TargetBranch)" != "release" ] && echo $title | grep -iqF hotfix; then
if [ "$(System.PullRequest.TargetBranch)" != "release" ] && echo $title | grep -iqF hotfix:; then
echo "Hotfix PR should target release branch."
exit 1
fi
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
- task: UsePythonVersion@0
displayName: 'Use Python 3'
inputs:
versionSpec: 3.x
versionSpec: 3.8

- task: BatchScript@1
inputs:
Expand Down Expand Up @@ -685,7 +685,7 @@ jobs:
distro: stretch
Buster:
deb_system: debian
distro: buster
distro: buster
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build Artifacts'
Expand Down Expand Up @@ -739,7 +739,7 @@ jobs:
distro: stretch
Buster:
deb_system: debian
distro: buster
distro: buster
pool:
vmImage: 'ubuntu-16.04'
steps:
Expand Down
19 changes: 11 additions & 8 deletions doc/authoring_command_modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ History notes are auto-generated based on PR titles and descriptions starting fr

Examples of customer-facing change PR title:

>[Storage] BREAKING CHANGE: az storage remove: Remove --auth-mode argument
>[ARM] Fix #10246: az resource tag crashes when the parameter --ids passed in is resource group ID
> [Storage] BREAKING CHANGE: az storage remove: Remove --auth-mode argument
> [ARM] Fix #10246: az resource tag crashes when the parameter --ids passed in is resource group ID

An example of non-customer-facing change PR title:

>{Aladdin} Add help example for dns
> {Aladdin} Add help example for dns

### Format PR Description

Expand All @@ -227,11 +227,14 @@ Please follow the instruction in the PR template to provide a description of the
If you would like to write multiple history notes for one PR or overwrite the message in the PR title as a history note, please write the notes under `History Notes` section in the PR description, following the same format described above. The PR template already contains the history note template, just change it if needed. In this case, the PR title could be a summary of all the changes in this PR and will not be put into `HISTORY.rst` in our pipeline. The PR title still needs to start with `[Component Name]`. You can delete the `History Notes` section if not needed.

### Hotfix PR
Step 1: Create a hotfix branch based on release branch, then submit a PR to merge hotfix into release.
In this PR, the second part of the PR title should be `Hotfix`. If you have customer-facing changes, you need to manually modify `HISTORY.rst` to add history notes. The auto generated history notes for the next regular release will ignore the PR that contains `Hotfix`.
Step 2: Submit a PR to merge the release branch back into dev branch after the hotfix release.
Do **NOT** squash and merge this PR. After the PR gets approved by code owners, you should fast forward dev to release on your local machine and then push dev to upstream repository.
Step 1: Create a hotfix branch based on `release` branch, then submit a PR to merge the hotfix branch into `release`.

In this PR, the second part of the PR title should be `Hotfix`. If you have customer-facing changes, you need to manually modify `HISTORY.rst` to add history notes. The auto-generated history notes for the next regular release will ignore the PR that contains `Hotfix`.

An example title of hotfix change PR:

>{Packaging} Hotfix: Fix dependency error
> {Packaging} Hotfix: Fix dependency error

Step 2: After the hotfix version is released, submit a PR to merge `release` branch back to `dev` (e.g. [#15505](https://github.com/Azure/azure-cli/pull/15505)).

⚠ Do **NOT** squash merge this PR. After the PR gets approved by code owners, merge `release` to `dev` by creating a **merge commit** on your local machine, then push `dev` to upstream repository. The PR will automatically be marked as **Merged**.
16 changes: 8 additions & 8 deletions scripts/live_test/CLITest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
displayName: Live Test Python 3.8
timeoutInMinutes: 9999
strategy:
maxParallel: 20
maxParallel: 5
matrix:
acr:
Target: acr
Expand Down Expand Up @@ -324,7 +324,7 @@ jobs:
echo "##vso[task.setvariable variable=Match]0"
fi
- task: UsePythonVersion@0
condition: eq(variables.Match, '1')
condition: and(succeededOrFailed(), eq(variables.Match, '1'))
inputs:
versionSpec: '3.8'
addToPath: true
Expand Down Expand Up @@ -399,34 +399,34 @@ jobs:
git push origin $(USER_BRANCH)
fi

condition: eq(variables.Match, '1')
condition: and(succeededOrFailed(), eq(variables.Match, '1'))
- task: PublishTestResults@2
condition: eq(variables.Match, '1')
condition: and(succeededOrFailed(), eq(variables.Match, '1'))
inputs:
testResultsFiles: '/home/vsts/work/1/test_results.*.xml'
testRunTitle: 'Azure CLI live test results of $(Target)'
mergeTestResults: true
# testResultsFormat: 'JUnit'
- task: PublishBuildArtifacts@1
condition: eq(variables.Match, '1')
condition: and(succeededOrFailed(), eq(variables.Match, '1'))
inputs:
PathtoPublish: '/home/vsts/work/1/$(Target).report.sequential.json'
ArtifactName: '$(Target).report.sequential.json'
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
condition: eq(variables.Match, '1')
condition: and(succeededOrFailed(), eq(variables.Match, '1'))
inputs:
PathtoPublish: '/home/vsts/work/1/$(Target).report.sequential.html'
ArtifactName: '$(Target).report.sequential.html'
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
condition: eq(variables.Match, '1')
condition: and(succeededOrFailed(), eq(variables.Match, '1'))
inputs:
PathtoPublish: '/home/vsts/work/1/$(Target).report.parallel.json'
ArtifactName: '$(Target).report.parallel.json'
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
condition: eq(variables.Match, '1')
condition: and(succeededOrFailed(), eq(variables.Match, '1'))
inputs:
PathtoPublish: '/home/vsts/work/1/$(Target).report.parallel.html'
ArtifactName: '$(Target).report.parallel.html'
Expand Down
20 changes: 14 additions & 6 deletions scripts/live_test/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,49 @@
Release History
===============

0.6.0
0.7.0 (10/23/2020)
++++++

* Improve index.html. Move report link inside table. Display number of tests in link name.
* Fix a small problem of job condition.

0.6.0 (10/19/2020)
++++++

* Remove module iotcentral.
* Support testing Azure CLI extensions.

0.5.0
0.5.0 (10/10/2020)
++++++

* Update index.html design.
* Add module data table.
* Add retry for CLI commands.

0.4.0
0.4.0 (9/27/2020)
++++++

* Update pipeline run title.
* Generate index.html of testing results.
* Design a unique representation of a pipeline run.
* Make storage account container public.

0.3.0
0.3.0 (9/14/2020)
++++++

* Support upgrading API version in pipeline.
* Fix a tiny DB bug.
* Fix pipe not close problem.

0.2.0
0.2.0 (9/4/2020)
++++++

* Fix a tiny bug of sequential run.
* Save testing results to database.
* Fix a bug of module name sorting.
* Update notification email format.

0.1.0
0.1.0 (8/24/2020)
++++++

* Remove schedule in debug mode.
Expand Down
47 changes: 36 additions & 11 deletions scripts/live_test/generate_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""
import traceback
import os
import re
import requests
import xml.etree.ElementTree as ET

Expand All @@ -20,6 +21,7 @@ def generate(container, container_url, testdata, USER_REPO, USER_BRANCH, COMMIT_
:return:
"""
print('Enter generate()')
# [{'name': name, 'url': url}]
data = []
url = container_url + '?restype=container&comp=list'
content = requests.get(url).content
Expand Down Expand Up @@ -100,6 +102,7 @@ def render(data, container, container_url, testdata, USER_REPO, USER_BRANCH, COM
<th>Pass</th>
<th>Fail</th>
<th>Pass rate</th>
<th>Reports</th>
</tr>
"""

Expand All @@ -109,34 +112,56 @@ def render(data, container, container_url, testdata, USER_REPO, USER_BRANCH, COM
<td>{}</td>
<td>{}</td>
<td>{}</td>
<td></td>
</tr>
""".format(testdata.total[1], testdata.total[2], testdata.total[3])

for module, passed, failed, rate in testdata.modules:
reports = ''
for x in data:
name = x['name']
url = x['url']
if name.startswith(module + '.'):
display_name = 'report'
if 'parallel' in name:
display_name = 'parallel'
elif 'sequential' in name:
display_name = 'sequential'
try:
html = requests.get(url).content.__str__()
pattern = re.compile('\\d+ tests ran in')
match = pattern.search(html)
number = match.group().split()[0]
if number.isdigit():
display_name += '(' + number + ')'
except:
traceback.print_exc()
reports += '<a href="{}">{}</a> '.format(url, display_name)
table += """
<tr>
<td>{}</td>
<td>{}</td>
<td>{}</td>
<td>{}</td>
<td>{}</td>
</tr>
""".format(module, passed, failed, rate)
""".format(module, passed, failed, rate, reports)

table += """
</table>
"""
content += table

content += """
<p><b>Reports</b></p>
"""

for item in data:
name = item['name']
url = item['url']
content += """
<a href={}>{}</a><br>
""".format(url, name)
# content += """
# <p><b>Reports</b></p>
# """
#
# for item in data:
# name = item['name']
# url = item['url']
# content += """
# <a href={}>{}</a><br>
# """.format(url, name)

content += """
</body>
Expand Down
25 changes: 18 additions & 7 deletions src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,26 +559,35 @@ def get_login_credentials(self, resource=None, subscription_id=None, aux_subscri
external_tenants_info.append(sub[_TENANT_ID])

if identity_type is None:
def _retrieve_token():
def _retrieve_token(sdk_resource=None):
# When called by
# - Track 1 SDK, use `resource` specified by CLI
# - Track 2 SDK, use `sdk_resource` specified by SDK and ignore `resource` specified by CLI
token_resource = sdk_resource or resource
logger.debug("Retrieving token from ADAL for resource %r", token_resource)

if in_cloud_console() and account[_USER_ENTITY].get(_CLOUD_SHELL_ID):
return self._get_token_from_cloud_shell(resource)
return self._get_token_from_cloud_shell(token_resource)
if user_type == _USER:
return self._creds_cache.retrieve_token_for_user(username_or_sp_id,
account[_TENANT_ID], resource)
account[_TENANT_ID], token_resource)
use_cert_sn_issuer = account[_USER_ENTITY].get(_SERVICE_PRINCIPAL_CERT_SN_ISSUER_AUTH)
return self._creds_cache.retrieve_token_for_service_principal(username_or_sp_id, resource,
return self._creds_cache.retrieve_token_for_service_principal(username_or_sp_id, token_resource,
account[_TENANT_ID],
use_cert_sn_issuer)

def _retrieve_tokens_from_external_tenants():
def _retrieve_tokens_from_external_tenants(sdk_resource=None):
token_resource = sdk_resource or resource
logger.debug("Retrieving token from ADAL for external tenants and resource %r", token_resource)

external_tokens = []
for sub_tenant_id in external_tenants_info:
if user_type == _USER:
external_tokens.append(self._creds_cache.retrieve_token_for_user(
username_or_sp_id, sub_tenant_id, resource))
username_or_sp_id, sub_tenant_id, token_resource))
else:
external_tokens.append(self._creds_cache.retrieve_token_for_service_principal(
username_or_sp_id, resource, sub_tenant_id, resource))
username_or_sp_id, token_resource, sub_tenant_id, token_resource))
return external_tokens

from azure.cli.core.adal_authentication import AdalAuthentication
Expand Down Expand Up @@ -621,6 +630,8 @@ def get_refresh_token(self, resource=None,
return username_or_sp_id, sp_secret, None, str(account[_TENANT_ID])

def get_raw_token(self, resource=None, subscription=None, tenant=None):
logger.debug("Profile.get_raw_token invoked with resource=%r, subscription=%r, tenant=%r",
resource, subscription, tenant)
if subscription and tenant:
raise CLIError("Please specify only one of subscription and tenant, not both")
account = self.get_subscription(subscription)
Expand Down
Loading