Skip to content

Commit ada2aa3

Browse files
authored
[SDK generation pipeline] Fix logic to judge preview or stable for generated SDK code (Azure#39879)
* update logic to judge preview or stable * update
1 parent bdacba7 commit ada2aa3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@ def judge_tag_preview(path: str, package_name: str) -> bool:
216216
for line in list_in:
217217
if "DEFAULT_API_VERSION = " in line:
218218
default_api_version += line.split("=")[-1].strip("\n") # collect all default api version
219-
if default_api_version == "" and "api_version" in line:
220-
api_version += ", ".join(re.findall("\d{4}-\d{2}-\d{2}[-a-z]*", line)) # collect all single api version
219+
if default_api_version == "" and "api_version" in line and "method_added_on" not in line:
220+
api_version += ", ".join(
221+
re.findall('"\d{4}-\d{2}-\d{2}[-a-z]*"[^:]', line)
222+
) # collect all single api version
221223
if default_api_version != "":
222224
_LOGGER.info(f"find default api version:{default_api_version}")
223225
return "preview" in default_api_version

0 commit comments

Comments
 (0)