|
24 | 24 | OPENAPI_VERSION_FILE,
|
25 | 25 | PYTHON_REQUIREMENTS_FILE,
|
26 | 26 | PYTHON_VERSION_FILE,
|
| 27 | + RELEASE_COMMIT_REGEX, |
27 | 28 | REPO_LIST_ALL,
|
28 | 29 | REPO_LIST_PYTHON_REQUIREMENTS,
|
29 | 30 | REPO_LIST_SHARED,
|
|
46 | 47 | update_module_in_cluster_components,
|
47 | 48 | upgrade_requirements,
|
48 | 49 | validate_directory,
|
| 50 | + get_commit_pr_suffix, |
49 | 51 | )
|
50 | 52 |
|
51 | 53 |
|
@@ -163,7 +165,7 @@ def git_create_release_commit(
|
163 | 165 | next_version: Optional[str] = None,
|
164 | 166 | ) -> bool:
|
165 | 167 | """Create a release commit for the given component."""
|
166 |
| - if "release:" in get_current_commit(get_srcdir(component)): |
| 168 | + if is_last_commit_release_commit(component): |
167 | 169 | display_message("Nothing to do, last commit is a release commit.", component)
|
168 | 170 | return False
|
169 | 171 |
|
@@ -199,8 +201,11 @@ def git_create_release_commit(
|
199 | 201 | if modified_files:
|
200 | 202 | run_command(f"git add {' '.join(modified_files)}", component)
|
201 | 203 |
|
| 204 | + commit_msg = ( |
| 205 | + f"chore({base}): release {next_version}{get_commit_pr_suffix(component)}" |
| 206 | + ) |
202 | 207 | run_command(
|
203 |
| - f"git commit -m 'release: {next_version}' {'--allow-empty' if not modified_files else ''}", |
| 208 | + f"git commit -m '{commit_msg}' {'--allow-empty' if not modified_files else ''}", |
204 | 209 | component,
|
205 | 210 | )
|
206 | 211 | return True
|
@@ -289,7 +294,8 @@ def print_branch_difference_report(
|
289 | 294 | def is_last_commit_release_commit(package):
|
290 | 295 | """Check whether the last commit is a release commit."""
|
291 | 296 | current_commit = get_current_commit(get_srcdir(package))
|
292 |
| - return current_commit.split()[1] == "release:" |
| 297 | + commit_msg = current_commit.split(maxsplit=1)[1] |
| 298 | + return RELEASE_COMMIT_REGEX.match(commit_msg) |
293 | 299 |
|
294 | 300 |
|
295 | 301 | def git_push_to_origin(components):
|
@@ -1280,7 +1286,7 @@ def git_upgrade_shared_modules(
|
1280 | 1286 |
|
1281 | 1287 | def _create_commit_or_amend(components):
|
1282 | 1288 | for c in components:
|
1283 |
| - commit_cmd = 'git commit -m "installation: bump shared modules"' |
| 1289 | + commit_cmd = f'git commit -m "build(deps): bump shared modules{get_commit_pr_suffix(component)}"' |
1284 | 1290 | if amend:
|
1285 | 1291 | commit_cmd = "git commit --amend --no-edit"
|
1286 | 1292 |
|
@@ -1365,7 +1371,8 @@ def git_upgrade_requirements(ctx, component, exclude_components): # noqa: D301
|
1365 | 1371 | if upgrade_requirements(component):
|
1366 | 1372 | run_command(f"git add {PYTHON_REQUIREMENTS_FILE}", component)
|
1367 | 1373 | run_command(
|
1368 |
| - 'git commit -m "installation: bump all dependencies"', component |
| 1374 | + f'git commit -m "build(deps): bump all dependencies{get_commit_pr_suffix(component)}"', |
| 1375 | + component, |
1369 | 1376 | )
|
1370 | 1377 |
|
1371 | 1378 |
|
|
0 commit comments