Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion .azure-pipelines/breaking-change-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
pool:
name: ${{ variables.ubuntu_pool }}
steps:
- checkout: self
fetchDepth: 0
fetchTags: true
persistCredentials: true
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
inputs:
Expand All @@ -33,7 +37,8 @@ jobs:
echo "##vso[task.setvariable variable=breakingChangeTest]$breakingChangeTest"
displayName: "Breaking Change Test"
env:
SRC_BRANCH: $(system.pullRequest.targetBranchName)
PR_SRC_BRANCH: $(System.PullRequest.SourceBranch)
PR_TARGET_BRANCH: $(System.PullRequest.TargetBranch)
PULL_REQUEST_NUMBER: $(System.PullRequest.PullRequestNumber)
JOB_NAME: "breaking_change_test"
- task: PublishBuildArtifacts@1
Expand Down
2 changes: 2 additions & 0 deletions .github/azure-client-tools-bot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pull_request:
init_comment: |
Validation for Azure CLI Full Test Starting...
Thanks for your contribution!
disable_check_suit: true
- azure_pipeline:
allow_list:
- "Azure.azure-cli Breaking Change Test"
Expand All @@ -31,6 +32,7 @@ pull_request:
init_comment: |
Validation for Breaking Change Starting...
Thanks for your contribution!
disable_check_suit: true
cli_common_issues:
issues:
- tag: unofficial_cli
Expand Down
14 changes: 11 additions & 3 deletions scripts/ci/breaking_change_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,26 @@
pull_request_number = os.environ.get('PULL_REQUEST_NUMBER', None)
job_name = os.environ.get('JOB_NAME', None)
azdev_test_result_dir = os.path.expanduser("~/.azdev/env_config/mnt/vss/_work/1/s/env")
src_branch = os.environ.get('SRC_BRANCH', None)
# refs/remotes/pull/24765/merge
target_branch = f'refs/remotes/pull/{pull_request_number}/merge'
src_branch = os.environ.get('PR_TARGET_BRANCH', None)
target_branch = 'merged_pr'
base_meta_path = '~/_work/1/base_meta'
diff_meta_path = '~/_work/1/diff_meta'
output_path = '~/_work/1/output_meta'


def get_diff_meta_files():
cmd = ['git', 'checkout', '-b', target_branch]
print(cmd)
subprocess.run(cmd)
cmd = ['git', 'checkout', src_branch]
print(cmd)
subprocess.run(cmd)
cmd = ['git', 'checkout', target_branch]
print(cmd)
subprocess.run(cmd)
cmd = ['git', 'rev-parse', 'HEAD']
print(cmd)
subprocess.run(cmd)
cmd = ['azdev', 'command-change', 'meta-export', '--src', src_branch, '--tgt', target_branch, '--repo', get_cli_repo_path(), '--meta-output-path', diff_meta_path]
print(cmd)
subprocess.run(cmd)
Expand All @@ -45,6 +50,9 @@ def get_base_meta_files():
cmd = ['git', 'checkout', src_branch]
print(cmd)
subprocess.run(cmd)
cmd = ['git', 'rev-parse', 'HEAD']
print(cmd)
subprocess.run(cmd)
cmd = ['azdev', 'setup', '--cli', get_cli_repo_path()]
print(cmd)
subprocess.run(cmd)
Expand Down