Skip to content

Commit

Permalink
Merge branch 'Azure:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Tejaswikandula authored Aug 14, 2024
2 parents 6817d6f + baee355 commit d699c62
Show file tree
Hide file tree
Showing 411 changed files with 38,313 additions and 13,129 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ProcessCodeReview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,27 @@ jobs:
env:
bash_sha: ${{ github.event.pull_request.base.sha }}
base_branch: ${{ github.event.pull_request.base.ref }}
base_repo: ${{ github.event.pull_request.base.repo.clone_url }}
base_branch_pre: "upstream"
diff_sha: ${{ github.event.pull_request.head.sha }}
diff_branch: ${{ github.event.pull_request.head.ref }}
repo_full_name: ${{ github.event.pull_request.head.repo.full_name }}
run: |
set -x
git --version
git log --oneline | head -n 30
git log --oneline | head -n 10
git branch -a
git fetch https://github.com/Azure/azure-cli-extensions.git "$base_branch":"$base_branch_pre"/"$base_branch"
git fetch "$base_repo" "$base_branch":"$base_branch_pre"/"$base_branch"
git checkout "$base_branch_pre"/"$base_branch"
git log --oneline | head -n 30
git log --oneline | head -n 10
git checkout "$diff_branch"
git log --oneline | head -n 30
git log --oneline | head -n 10
git --no-pager diff --name-only --diff-filter=ACMRT "$base_branch_pre"/"$base_branch"..."$diff_branch" > changed_files
cat changed_files
echo "changed_module_list=$(cat changed_files | grep azext_ | awk -F"azext_" '{print $1}'| awk -F"/" '{print $2}' | sort | uniq | xargs)" >> $GITHUB_ENV
echo "changed_module_list=$(cat changed_files | grep src/ | awk -F"src/" '{print $2}'| grep / | awk -F"/" '{print $1}' | sort | uniq | xargs)" >> $GITHUB_ENV
- name: Display Diff Modules
run: |
for mod in "$changed_module_list"
for mod in ${changed_module_list[@]}
do
echo changed module: "${mod}"
done
Expand Down
88 changes: 65 additions & 23 deletions .github/workflows/VersionCalPRComment.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Generate Release Version and Comment PR
name: Release Version Calculation

on:
workflow_dispatch:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]
branches:
- main
paths:
- '!**/test_*.py'

permissions: {}

Expand Down Expand Up @@ -56,29 +54,31 @@ jobs:
env:
bash_sha: ${{ github.event.pull_request.base.sha }}
base_branch: ${{ github.event.pull_request.base.ref }}
base_repo: ${{ github.event.pull_request.base.repo.clone_url }}
base_branch_pre: "upstream"
diff_code_file: "diff_codes.txt"
diff_sha: ${{ github.event.pull_request.head.sha }}
diff_branch: ${{ github.event.pull_request.head.ref }}
repo_full_name: ${{ github.event.pull_request.head.repo.full_name }}
run: |
set -x
git --version
git log --oneline | head -n 30
git branch -a
git fetch https://github.com/Azure/azure-cli-extensions.git "$base_branch":"$base_branch_pre"/"$base_branch"
git checkout "$base_branch_pre"/"$base_branch"
git log --oneline | head -n 30
git checkout "$diff_branch"
git log --oneline | head -n 30
git --no-pager diff --name-only --diff-filter=ACMRT "$base_branch_pre"/"$base_branch"..."$diff_branch" > changed_files
cat changed_files
cat changed_files | grep azext_ | awk -F"azext_" '{print $1}'| awk -F"/" '{print $2}' | sort | uniq > changed_modules
echo "changed_module_list=$(cat changed_files | grep azext_ | awk -F"azext_" '{print $1}'| awk -F"/" '{print $2}' | sort | uniq | xargs)" >> $GITHUB_ENV
git --no-pager diff --diff-filter=ACMRT "$base_branch_pre"/"$base_branch"..."$diff_branch" > "$diff_code_file"
- name: Display PR Diff Modules
set -x
git --version
git log --oneline | head -n 10
git branch -a
git fetch "$base_repo" "$base_branch":"$base_branch_pre"/"$base_branch"
git checkout "$base_branch_pre"/"$base_branch"
git log --oneline | head -n 10
git checkout "$diff_branch"
git log --oneline | head -n 10
git --no-pager diff --name-only --diff-filter=ACMRT "$base_branch_pre"/"$base_branch"..."$diff_branch"
git --no-pager diff --name-only --diff-filter=ACMRT "$base_branch_pre"/"$base_branch"..."$diff_branch" | grep -v "/tests/" > changed_files
cat changed_files
cat changed_files | grep src/ | awk -F"src/" '{print $2}'| grep / | awk -F"/" '{print $1}' | sort | uniq
echo "changed_module_list=$(cat changed_files | grep src/ | awk -F"src/" '{print $2}'| grep / | awk -F"/" '{print $1}' | sort | uniq | xargs)" >> $GITHUB_ENV
git --no-pager diff --diff-filter=ACMRT "$base_branch_pre"/"$base_branch"..."$diff_branch" > "$diff_code_file"
- name: Display PR Diff Modules
run: |
for mod in "$changed_module_list"
for mod in ${changed_module_list[@]}
do
echo changed module: "${mod}"
done
Expand All @@ -87,6 +87,8 @@ jobs:
else
echo "no_changed_mod=false" >> $GITHUB_ENV
fi
echo array length
echo ${#changed_module_list[@]}
- name: Checkout CLI main repo
if: ${{ env.no_changed_mod == 'false' }}
uses: actions/checkout@v4
Expand Down Expand Up @@ -121,6 +123,7 @@ jobs:
id: get_comment_message
env:
pr_label_list: ${{ toJson(github.event.pull_request.labels.*.name) }}
pr_user: ${{ github.event.pull_request.user.login }}
base_branch: ${{ github.event.pull_request.base.ref }}
base_branch_pre: "upstream"
diff_code_file: "diff_codes.txt"
Expand All @@ -137,14 +140,14 @@ jobs:
set -ev
git checkout "$base_branch_pre"/"$base_branch"
mkdir "$base_meta_path"
for mod in "$changed_module_list"
for mod in ${changed_module_list[@]}
do
echo changed module: "${mod}"
azdev extension add "${mod}" && azdev command-change meta-export "${mod}" --meta-output-path ./"$base_meta_path"/ && azdev extension remove "${mod}"
done
git checkout "$diff_branch"
mkdir "$diff_meta_path"
for mod in "$changed_module_list"
for mod in ${changed_module_list[@]}
do
echo changed module: "${mod}"
azdev extension add "${mod}" && azdev command-change meta-export "${mod}" --meta-output-path ./"$diff_meta_path"/
Expand All @@ -156,6 +159,7 @@ jobs:
python scripts/ci/release_version_cal.py
ls "$result_path"
cat "$result_path"/"$remove_labels_file"
cat "$result_path"/"$output_file"
# echo "commit_message=$(cat $output_file)" >> $GITHUB_ENV
- name: Archive pr version cal output
uses: actions/upload-artifact@v4
Expand All @@ -164,8 +168,39 @@ jobs:
path: |
cal_result
!cal_result/**/*.md
skip-version-cal:
if: ${{ contains(github.event.pull_request.labels.*.name, 'skip-cal-version') }}
runs-on: ubuntu-latest
permissions:
pull-requests: read
contents: read
steps:
- name: Check Init GH Event
env:
action: ${{ toJSON(github.event.action) }}
label: ${{ toJSON(github.event.label) }}
run: |
echo prepare default version cal output
- name: Set Default Version Output
env:
result_path: "./cal_result"
remove_labels_file: "labels_removed.txt"
run: |
set -x
mkdir "$result_path"
cd "$result_path"
echo "release-version-block" > "$remove_labels_file"
cd ../
ls "$result_path"
- name: Archive pr version cal output
uses: actions/upload-artifact@v4
with:
name: version-cal-output
path: |
cal_result
version-output:
needs: version-cal
needs: [version-cal, skip-version-cal]
if: always()
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand Down Expand Up @@ -226,4 +261,11 @@ jobs:
curl -X DELETE \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/${del_lab}" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}"
done
done
- uses: snnaplab/get-labels-action@v1
- name: Check real time labels
if: contains(fromJSON(env.LABELS), 'release-version-block')
run: |
echo label: $LABELS
echo blocked
exit 1
5 changes: 5 additions & 0 deletions linter_exclusions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1782,6 +1782,11 @@ monitor action-rule list:
target_resource_group:
rule_exclusions:
- option_length_too_long
network bastion ssh:
parameters:
ssh_args:
rule_exclusions:
- no_positional_parameters
network cross-connection peering create:
parameters:
advertised_public_prefixes:
Expand Down
31 changes: 18 additions & 13 deletions scripts/ci/release_version_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
output_file = os.environ.get('output_file', None)
add_labels_file = os.environ.get('add_labels_file', None)
remove_labels_file = os.environ.get('remove_labels_file', None)
pr_user = os.environ.get('pr_user', "")

changed_module_list = os.environ.get('changed_module_list', "").split()
diff_code_file = os.environ.get('diff_code_file', "")
Expand Down Expand Up @@ -65,21 +66,24 @@ def extract_module_version_update_info(mod_update_info, mod):
--- a/src/monitor-control-service/HISTORY.RST
py files exclude tests, vendored_sdks and aaz folder
"""
mod_update_info["setup_updated"] = False
diff_file_started = False
module_setup_update_pattern = re.compile(r"\+\+\+.*?src/%s/(?!.*(?:tests|vendored_sdks|aaz)/).*?.py" % mod)
module_version_update_pattern = re.compile(r"\+\s?VERSION\s?\=\s?[\'\"]([0-9\.b]+)[\'\"]")
with open(diff_code_file, "r") as f:
for line in f:
if mod_update_info["setup_updated"]:
if line.find("---") == 0 or mod_update_info.get("version_diff", None):
if diff_file_started:
if mod_update_info.get("version_diff", None):
break
if line.find("diff") == 0:
diff_file_started = False
continue
mod_version_update_match = re.findall(module_version_update_pattern, line)
if mod_version_update_match and len(mod_version_update_match) == 1:
mod_update_info["version_diff"] = mod_version_update_match[0]
else:
mod_setup_update_match = re.findall(module_setup_update_pattern, line)
if mod_setup_update_match:
mod_update_info["setup_updated"] = True
diff_file_started = True


def extract_module_metadata_update_info(mod_update_info, mod):
Expand Down Expand Up @@ -211,16 +215,17 @@ def get_next_version_segment_tag():

def add_suggest_header(comment_message):
comment_message.insert(0, "## :warning: Release Suggestions")
comment_message.insert(0, "Hi @" + pr_user)


def gen_history_comment_message(mod, mod_update_info, mod_message):
if not mod_update_info["history_updated"]:
mod_message.append(" - :warning: Please log updates into to `src/{0}/HISTORY.rst`".format(mod))
mod_message.append(" - Please log updates into to `src/{0}/HISTORY.rst`".format(mod))


def gen_version_comment_message(mod, mod_update_info, mod_message):
global block_pr
if not mod_update_info["setup_updated"]:
if not mod_update_info.get("version_diff", None):
if mod_update_info.get("version", None):
mod_message.append(" - Update `VERSION` to `{0}` in `src/{1}/setup.py`".format(mod_update_info.get("version", "-"), mod))
else:
Expand All @@ -241,7 +246,7 @@ def gen_preview_comment_message(mod, mod_update_info, mod_message):
if mod_update_info.get("preview_tag", "-") == mod_update_info.get("preview_tag_diff", "-"):
return
preview_comment_message = " - "
if mod_update_info["setup_updated"] and mod_update_info.get("version_diff", None):
if mod_update_info.get("version_diff", None):
block_pr = 1
preview_comment_message += ":warning: "
if mod_update_info.get("preview_tag", None) and mod_update_info.get("preview_tag_diff", None):
Expand All @@ -267,7 +272,7 @@ def gen_exp_comment_message(mod, mod_update_info, mod_message):
if mod_update_info.get("exp_tag", "-") == mod_update_info.get("exp_tag_diff", "-"):
return
exp_comment_message = " - "
if mod_update_info["setup_updated"]:
if mod_update_info.get("version_diff", None):
block_pr = 1
exp_comment_message += ":warning: "
if mod_update_info.get("exp_tag", None) and mod_update_info.get("exp_tag_diff", None):
Expand Down Expand Up @@ -301,11 +306,11 @@ def gen_comment_message(mod, mod_update_info, comment_message):

def add_label_hint_message(comment_message):
comment_message.append("#### Notes")
comment_message.append(" - Stable/preview tag is inherited from last release. "
"If needed, please add `stable`/`preview` label to modify it.")
comment_message.append(" - Major/minor/patch/pre increment of version number is calculated by pull request "
"code changes automatically. "
"If needed, please add `major`/`minor`/`patch`/`pre` label to adjust it.")
# comment_message.append(" - Stable/preview tag is inherited from last release. "
# "If needed, please add `stable`/`preview` label to modify it.")
# comment_message.append(" - Major/minor/patch/pre increment of version number is calculated by pull request "
# "code changes automatically. "
# "If needed, please add `major`/`minor`/`patch`/`pre` label to adjust it.")
comment_message.append(DEFAULT_MESSAGE)


Expand Down
17 changes: 14 additions & 3 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,24 @@ If there is no rush to release a new version, please just add a description of t

To release a new version, please select a new version number (usually plus 1 to last patch version, X.Y.Z -> Major.Minor.Patch, more details in `\doc <https://semver.org/>`_), and then add a new section named as the new version number in this file, the content should include the new modifications and everything from the *Pending* section. Finally, update the `VERSION` variable in `setup.py` with this new version number.

Pending
7.0.0b5
+++++++
* Add option `--enable-acns`, `--disable-acns` to `az aks create/update`
* Add option `--enable-fqdn-policy`, `--disable-fqdn-policy` to `az aks create/update`
* az aks create/update: Support in place param updates for managed prom
* Vendor new SDK and bump API version to 2024-06-02-preview.

7.0.0b4
++++++++
* Fix bug related to the --ampls-resource-id option in the `az aks enable-addons` command.
* Vendor new SDK and bump API version to 2024-06-02-preview.
* Add support for default nginx ingress controller config for app routing add-on

7.0.0b3
++++++++
* Add option `--enable-high-log-scale-mode` to `az aks create --enable-addons monitoring` and `az aks enable-addons -a monitoring` .
* Add option `--ampls-resource-id` to `az aks create --enable-addons monitoring` and `az aks enable-addons -a monitoring` .
* Add option `--enable-high-log-scale-mode` to `az aks create --enable-addons monitoring` and `az aks enable-addons -a monitoring`.
* Add option `--ampls-resource-id` to `az aks create --enable-addons monitoring` and `az aks enable-addons -a monitoring`.
* Vendor new SDK and bump API version to 2024-05-02-preview.

7.0.0b2
++++++++
Expand Down
8 changes: 7 additions & 1 deletion src/aks-preview/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ Released version and adopted API version
* - 3.0.0b10 ~ 5.0.0b1
- 2024-03-02-preview
-
* - 5.0.0b2 ~ latest
* - 5.0.0b2 ~ 7.0.0b2
- 2024-04-02-preview
-
* - 7.0.0b3 ~ 7.0.0b3
- 2024-05-02-preview
-
* - 7.0.0b4 ~ latest
- 2024-06-02-preview
-
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@
],
"mixed sku, enabled in staging only": [
"test_vms_agentpool_type"
],
"fqdn policy, enabled in staging only": [
"test_aks_update_enable_fqdn_policy",
"test_aks_create_with_enable_fqdn_policy",
"test_aks_create_with_enable_fqdn_policy_observability",
"test_aks_create_with_enable_acns",
"test_aks_create_with_enable_acns_complex",
"test_aks_update_enable_acns"
]
}
}
2 changes: 1 addition & 1 deletion src/aks-preview/azext_aks_preview/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def register_aks_preview_resource_type():
register_resource_type(
"latest",
CUSTOM_MGMT_AKS_PREVIEW,
SDKProfile("2024-05-02-preview", {"container_services": "2017-07-01"}),
SDKProfile("2024-06-02-preview", {"container_services": "2017-07-01"}),
)


Expand Down
4 changes: 4 additions & 0 deletions src/aks-preview/azext_aks_preview/_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@
# only used as the key of the corresponding description, not to map to the key name in addonProfiles,
# since its configuration is actually stored in a separate ingress profile
CONST_WEB_APPLICATION_ROUTING_KEY_NAME = "ingress/webApplicationRouting"
CONST_APP_ROUTING_ANNOTATION_CONTROLLED_NGINX = "AnnotationControlled"
CONST_APP_ROUTING_EXTERNAL_NGINX = "External"
CONST_APP_ROUTING_INTERNAL_NGINX = "Internal"
CONST_APP_ROUTING_NONE_NGINX = "None"

# all supported addons
ADDONS = {
Expand Down
Loading

0 comments on commit d699c62

Please sign in to comment.