Skip to content

Commit 0b9bd3a

Browse files
authored
[pipeline] some features and fixes (Azure#25641)
* code * breaking change
1 parent 07b1cff commit 0b9bd3a

File tree

7 files changed

+28
-11
lines changed

7 files changed

+28
-11
lines changed

scripts/auto_release/main.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ def preview_version_plus(preview_label: str, last_version: str) -> str:
5454

5555
def stable_version_plus(changelog: str, last_version: str):
5656
flag = [False, False, False] # breaking, feature, bugfix
57-
flag[0] = '**Breaking changes**' in changelog
58-
flag[1] = '**Features**' in changelog
59-
flag[2] = '**Bugfixes**' in changelog
57+
flag[0] = '### Breaking Changes' in changelog
58+
flag[1] = '### Features Added' in changelog
59+
flag[2] = '### Bugs Fixed' in changelog
6060

6161
num = last_version.split('.')
6262
if flag[0]:
@@ -380,6 +380,16 @@ def get_need_dependency():
380380
target_mgmt_core = line.strip().strip(',').strip('\'')
381381
yield target_mgmt_core
382382

383+
@staticmethod
384+
def insert_line_num(content: List[str]) -> int:
385+
start_num = 0
386+
end_num = len(content)
387+
for i in range(end_num):
388+
if content[i].find("#override azure-mgmt-") > -1:
389+
start_num = i
390+
break
391+
return (int(str(time.time()).split('.')[-1]) % max(end_num - start_num, 1)) + start_num
392+
383393
def check_ci_file_proc(self, dependency: str):
384394
def edit_ci_file(content: List[str]):
385395
new_line = f'#override azure-mgmt-{self.package_name} {dependency}'
@@ -391,7 +401,7 @@ def edit_ci_file(content: List[str]):
391401
content[i] = new_line + '\n'
392402
return
393403
prefix = '' if '\n' in content[-1] else '\n'
394-
content.append(prefix + new_line + '\n')
404+
content.insert(self.insert_line_num(content), prefix + new_line + '\n')
395405

396406
modify_file(str(Path('shared_requirements.txt')), edit_ci_file)
397407
print_exec('git add shared_requirements.txt')

scripts/release_helper/python.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
_7_DAY_ATTENTION = '7days attention'
2020
_MultiAPI = 'MultiAPI'
2121
_ON_TIME = 'on time'
22+
_HOLD_ON = 'HoldOn'
2223
# record published issues
2324
_FILE_OUT = 'published_issues_python.csv'
2425

@@ -114,7 +115,11 @@ def attention_policy(self):
114115

115116
def on_time_policy(self):
116117
if _ON_TIME in self.issue_package.labels_name:
117-
self.bot_advice.append('on time')
118+
self.bot_advice.append('On time')
119+
120+
def hold_on_policy(self):
121+
if _HOLD_ON in self.issue_package.labels_name:
122+
self.bot_advice.append('Hold on')
118123

119124
def remind_policy(self):
120125
if self.delay_time >= 15 and _7_DAY_ATTENTION in self.issue_package.labels_name and self.date_from_target < 0:
@@ -133,6 +138,7 @@ def auto_bot_advice(self):
133138
self.multi_api_policy()
134139
self.attention_policy()
135140
self.on_time_policy()
141+
self.hold_on_policy()
136142
self.remind_policy()
137143

138144

tools/azure-sdk-tools/packaging_tools/auto_package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def main(generate_input, generate_output):
2727
md_output = "data-plan skip changelog generation temporarily"
2828
package["changelog"] = {
2929
"content": md_output,
30-
"hasBreakingChange": "Breaking changes" in md_output,
30+
"hasBreakingChange": "Breaking Changes" in md_output,
3131
"breakingChangeItems": extract_breaking_change(md_output),
3232
}
3333
package["version"] = last_version[-1]

tools/azure-sdk-tools/packaging_tools/change_log.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ def build_md(self):
3131
self.sort()
3232
buffer = []
3333
if self.features:
34-
_build_md(sorted(set(self.features), key=self.features.index), "**Features**", buffer)
34+
_build_md(sorted(set(self.features), key=self.features.index), "### Features Added", buffer)
3535
if self.breaking_changes:
36-
_build_md(sorted(set(self.breaking_changes), key=self.breaking_changes.index), "**Breaking changes**", buffer)
36+
_build_md(sorted(set(self.breaking_changes), key=self.breaking_changes.index), "### Breaking Changes", buffer)
3737
if not (self.features or self.breaking_changes) and self.optional_features:
38-
_build_md(sorted(set(self.optional_features), key=self.optional_features.index), "**Features**", buffer)
38+
_build_md(sorted(set(self.optional_features), key=self.optional_features.index), "### Features Added", buffer)
3939

4040
return "\n".join(buffer).strip()
4141

tools/azure-sdk-tools/packaging_tools/code_report.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ def merge_report(report_paths):
165165
merged_report["models"]["exceptions"].update(report_json["models"]["exceptions"])
166166
merged_report["models"]["models"].update(report_json["models"]["models"])
167167
merged_report["operations"].update(report_json["operations"])
168+
merged_report["client"] = report_json["client"]
168169
return merged_report
169170

170171

tools/azure-sdk-tools/packaging_tools/package_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def extract_breaking_change(changelog):
3636
log = changelog.split("\n")
3737
breaking_change = []
3838
for i in range(0, len(log)):
39-
if log[i].find("Breaking changes") > -1:
39+
if log[i].find("Breaking Changes") > -1:
4040
breaking_change = log[min(i + 2, len(log) - 1) :]
4141
break
4242
return sorted([x.replace(" - ", "") for x in breaking_change])

tools/azure-sdk-tools/packaging_tools/sdk_package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def main(generate_input, generate_output):
2727
md_output = "data-plan skip changelog generation temporarily"
2828
package["changelog"] = {
2929
"content": md_output,
30-
"hasBreakingChange": "Breaking changes" in md_output,
30+
"hasBreakingChange": "Breaking Changes" in md_output,
3131
"breakingChangeItems": extract_breaking_change(md_output),
3232
}
3333
package["version"] = last_version[-1]

0 commit comments

Comments
 (0)